commit 7a8181cb61ec4df15ff8b1e9b80c6a92ccd23d6f Author: wrenge Date: Wed Apr 10 10:42:31 2024 +0300 Initial commit diff --git a/bin/phar b/bin/phar new file mode 120000 index 0000000..d3d566b --- /dev/null +++ b/bin/phar @@ -0,0 +1 @@ +phar.phar \ No newline at end of file diff --git a/bin/phar.phar b/bin/phar.phar new file mode 100755 index 0000000..80b063e Binary files /dev/null and b/bin/phar.phar differ diff --git a/bin/php b/bin/php new file mode 100755 index 0000000..311a8eb Binary files /dev/null and b/bin/php differ diff --git a/bin/php-cgi b/bin/php-cgi new file mode 100755 index 0000000..d2e989e Binary files /dev/null and b/bin/php-cgi differ diff --git a/bin/php-config b/bin/php-config new file mode 100755 index 0000000..b86d634 --- /dev/null +++ b/bin/php-config @@ -0,0 +1,98 @@ +#! /bin/sh + +SED="/usr/bin/sed" +prefix="/home/wreng/php-8.3.3-linux" +datarootdir="/home/wreng/php-8.3.3-linux/php" +exec_prefix="${prefix}" +version="8.3.3-dev" +vernum="80303" +include_dir="${prefix}/include/php" +includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib" +ldflags="" +libs=" -lrt -lrt -lm -lxml2 -lsqlite3 -lxml2 -lsqlite3 -lxml2 -lxml2 -lxml2 -lxml2 " +extension_dir='/home/wreng/php-8.3.3-linux/lib/php/extensions/no-debug-non-zts-20230831' +man_dir=`eval echo ${datarootdir}/man` +program_prefix="" +program_suffix="" +exe_extension="" +php_cli_binary=NONE +php_cgi_binary=NONE +configure_options=" '--prefix=/home/wreng/php-8.3.3-linux/'" +php_sapis=" cli phpdbg cgi" +ini_dir="" +ini_path="/home/wreng/php-8.3.3-linux/lib" + +# Set php_cli_binary and php_cgi_binary if available +for sapi in $php_sapis; do + case $sapi in + cli) + php_cli_binary="${exec_prefix}/bin/${program_prefix}php${program_suffix}${exe_extension}" + ;; + cgi) + php_cgi_binary="${exec_prefix}/bin/${program_prefix}php-cgi${program_suffix}${exe_extension}" + ;; + esac +done + +# Determine which (if any) php binary is available +if test "$php_cli_binary" != "NONE"; then + php_binary="$php_cli_binary" +else + php_binary="$php_cgi_binary" +fi + +# Remove quotes +configure_options=`echo $configure_options | $SED -e "s#'##g"` + +case "$1" in +--prefix) + echo $prefix;; +--includes) + echo $includes;; +--ldflags) + echo $ldflags;; +--libs) + echo $libs;; +--extension-dir) + echo $extension_dir;; +--include-dir) + echo $include_dir;; +--php-binary) + echo $php_binary;; +--php-sapis) + echo $php_sapis;; +--configure-options) + echo $configure_options;; +--man-dir) + echo $man_dir;; +--ini-path) + echo $ini_path;; +--ini-dir) + echo $ini_dir;; +--version) + echo $version;; +--vernum) + echo $vernum;; +*) + cat << EOF +Usage: $0 [OPTION] +Options: + --prefix [$prefix] + --includes [$includes] + --ldflags [$ldflags] + --libs [$libs] + --extension-dir [$extension_dir] + --include-dir [$include_dir] + --man-dir [$man_dir] + --php-binary [$php_binary] + --php-sapis [$php_sapis] + --ini-path [$ini_path] + --ini-dir [$ini_dir] + --configure-options [$configure_options] + --version [$version] + --vernum [$vernum] +EOF + exit 1;; +esac + +exit 0 diff --git a/bin/phpdbg b/bin/phpdbg new file mode 100755 index 0000000..f8be3bc Binary files /dev/null and b/bin/phpdbg differ diff --git a/bin/phpize b/bin/phpize new file mode 100755 index 0000000..bddb214 --- /dev/null +++ b/bin/phpize @@ -0,0 +1,211 @@ +#!/bin/sh + +# Variable declaration +prefix='/home/wreng/php-8.3.3-linux' +datarootdir='/home/wreng/php-8.3.3-linux/php' +exec_prefix="`eval echo ${prefix}`" +phpdir="`eval echo ${exec_prefix}/lib/php`/build" +includedir="`eval echo ${prefix}/include`/php" +builddir="`pwd`" +SED="/usr/bin/sed" + +FILES_BUILD="php.m4 shtool libtool.m4 ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4 pkg.m4 \ + config.guess config.sub ltmain.sh Makefile.global gen_stub.php" +FILES="run-tests*.php" +CLEAN_FILES="$FILES *.o *.lo *.la .libs/ build/ modules/ \ + config.nice configure configure.ac \ + config.h config.h.in conftest* libtool config.cache autom4te.cache/ \ + config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \ + run-tests*.php tests/*.diff tests/*.exp tests/*.log tests/*.out tests/*.php" + +# function declaration +phpize_usage() +{ + echo "Usage: $0 [--clean|--help|--version|-v]" +} + +phpize_no_configm4() +{ + if test $@ -eq 1; then + clean=" --clean" + fi + + echo "Cannot find config.m4. " + echo "Make sure that you run '$0$clean' in the top level source directory of the module" + echo +} + +phpize_clean() +{ + echo "Cleaning.." + for i in $CLEAN_FILES; do + if test -f "$i"; then + rm -f $i + elif test -d "$i"; then + rm -rf $i + fi + done +} + +phpize_check_configm4() +{ + if test ! -r config.m4; then + phpize_no_configm4 $@ + exit 1 + fi + +} + +phpize_get_api_numbers() +{ + # extracting API NOs: + PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|$SED 's/#define PHP_API_VERSION//'` + ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO//'` + ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|$SED 's/#define ZEND_EXTENSION_API_NO//'` +} + +phpize_print_api_numbers() +{ + phpize_get_api_numbers + echo "Configuring for:" + echo "PHP Api Version: "$PHP_API_VERSION + echo "Zend Module Api No: "$ZEND_MODULE_API_NO + echo "Zend Extension Api No: "$ZEND_EXTENSION_API_NO +} + +phpize_check_build_files() +{ + if test ! -d "$phpdir"; then + cat < configure.ac +} + +phpize_autotools() +{ + # Remove aclocal.m4 if present. It is automatically included by autoconf but + # not used by the PHP build system since PHP 7.4. + rm -f aclocal.m4 + + $PHP_AUTOCONF || exit 1 + $PHP_AUTOHEADER || exit 1 +} + +# Main script + +case "$1" in + # Cleanup + --clean) + phpize_check_configm4 1 + phpize_clean + exit 0 + ;; + + # Usage + --help) + phpize_usage + exit 0 + ;; + + # Version + --version|-v) + phpize_print_api_numbers + exit 0 + ;; + + # Default + *) + phpize_check_configm4 0 + + phpize_check_build_files + + phpize_print_api_numbers + + phpize_copy_files + + phpize_replace_prefix + + phpize_check_shtool + + phpize_check_autotools + + phpize_autotools + ;; +esac + +exit 0 diff --git a/include/php/TSRM/TSRM.h b/include/php/TSRM/TSRM.h new file mode 100644 index 0000000..3bb32e4 --- /dev/null +++ b/include/php/TSRM/TSRM.h @@ -0,0 +1,200 @@ +/* + +----------------------------------------------------------------------+ + | Thread Safe Resource Manager | + +----------------------------------------------------------------------+ + | Copyright (c) 1999-2011, Andi Gutmans, Sascha Schumann, Zeev Suraski | + | This source file is subject to the TSRM license, that is bundled | + | with this package in the file LICENSE | + +----------------------------------------------------------------------+ + | Authors: Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef TSRM_H +#define TSRM_H + +#if !defined(__CYGWIN__) && defined(WIN32) +# define TSRM_WIN32 +# include "Zend/zend_config.w32.h" +#else +# include "main/php_config.h" +#endif + +#include +#include + +#ifdef TSRM_WIN32 +# ifdef TSRM_EXPORTS +# define TSRM_API __declspec(dllexport) +# else +# define TSRM_API __declspec(dllimport) +# endif +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define TSRM_API __attribute__ ((visibility("default"))) +#else +# define TSRM_API +#endif + +typedef intptr_t tsrm_intptr_t; +typedef uintptr_t tsrm_uintptr_t; + +/* Only compile multi-threading functions if we're in ZTS mode */ +#ifdef ZTS + +#ifdef TSRM_WIN32 +# ifndef TSRM_INCLUDE_FULL_WINDOWS_HEADERS +# define WIN32_LEAN_AND_MEAN +# endif +#else +# include +#endif + +#if SIZEOF_SIZE_T == 4 +# define TSRM_ALIGNED_SIZE(size) \ + (((size) + INT32_C(15)) & ~INT32_C(15)) +#else +# define TSRM_ALIGNED_SIZE(size) \ + (((size) + INT64_C(15)) & ~INT64_C(15)) +#endif + +typedef int ts_rsrc_id; + +/* Define THREAD_T and MUTEX_T */ +#ifdef TSRM_WIN32 +# define THREAD_T DWORD +# define MUTEX_T CRITICAL_SECTION * +#else +# define THREAD_T pthread_t +# define MUTEX_T pthread_mutex_t * +#endif + +#include + +typedef void (*ts_allocate_ctor)(void *); +typedef void (*ts_allocate_dtor)(void *); + +#define THREAD_HASH_OF(thr,ts) (unsigned long)thr%(unsigned long)ts + +#ifdef __cplusplus +extern "C" { +#endif + +/* startup/shutdown */ +TSRM_API bool tsrm_startup(int expected_threads, int expected_resources, int debug_level, const char *debug_filename); +TSRM_API void tsrm_shutdown(void); + +/* environ lock API */ +TSRM_API void tsrm_env_lock(void); +TSRM_API void tsrm_env_unlock(void); + +/* allocates a new thread-safe-resource id */ +TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor); + +/* Fast resource in reserved (pre-allocated) space */ +TSRM_API void tsrm_reserve(size_t size); +TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor); + +/* fetches the requested resource for the current thread */ +TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id); +#define ts_resource(id) ts_resource_ex(id, NULL) + +/* frees all resources allocated for the current thread */ +TSRM_API void ts_free_thread(void); + +/* deallocates all occurrences of a given id */ +TSRM_API void ts_free_id(ts_rsrc_id id); + + +/* Debug support */ +#define TSRM_ERROR_LEVEL_ERROR 1 +#define TSRM_ERROR_LEVEL_CORE 2 +#define TSRM_ERROR_LEVEL_INFO 3 + +typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id); +typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id); +typedef void (*tsrm_shutdown_func_t)(void); + + +TSRM_API int tsrm_error(int level, const char *format, ...); +TSRM_API void tsrm_error_set(int level, const char *debug_filename); + +/* utility functions */ +TSRM_API THREAD_T tsrm_thread_id(void); +TSRM_API MUTEX_T tsrm_mutex_alloc(void); +TSRM_API void tsrm_mutex_free(MUTEX_T mutexp); +TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp); +TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp); +#ifdef HAVE_SIGPROCMASK +TSRM_API int tsrm_sigmask(int how, const sigset_t *set, sigset_t *oldset); +#endif + +TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler); +TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler); +TSRM_API void *tsrm_set_shutdown_handler(tsrm_shutdown_func_t shutdown_handler); + +TSRM_API void *tsrm_get_ls_cache(void); +TSRM_API size_t tsrm_get_ls_cache_tcb_offset(void); +TSRM_API bool tsrm_is_main_thread(void); +TSRM_API bool tsrm_is_shutdown(void); +TSRM_API const char *tsrm_api_name(void); +TSRM_API bool tsrm_is_managed_thread(void); + +#ifdef TSRM_WIN32 +# define TSRM_TLS __declspec(thread) +#else +# define TSRM_TLS __thread +#endif + +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif + +#if !__has_attribute(tls_model) || defined(__FreeBSD__) || defined(__MUSL__) || defined(__HAIKU__) +# define TSRM_TLS_MODEL_ATTR +#elif __PIC__ +# define TSRM_TLS_MODEL_ATTR __attribute__((tls_model("initial-exec"))) +#else +# define TSRM_TLS_MODEL_ATTR __attribute__((tls_model("local-exec"))) +#endif + +#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1) +#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1) + +#define TSRMG(id, type, element) (TSRMG_BULK(id, type)->element) +#define TSRMG_BULK(id, type) ((type) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(id)]) +#define TSRMG_FAST(offset, type, element) (TSRMG_FAST_BULK(offset, type)->element) +#define TSRMG_FAST_BULK(offset, type) ((type) (((char*) tsrm_get_ls_cache())+(offset))) + +#define TSRMG_STATIC(id, type, element) (TSRMG_BULK_STATIC(id, type)->element) +#define TSRMG_BULK_STATIC(id, type) ((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)]) +#define TSRMG_FAST_STATIC(offset, type, element) (TSRMG_FAST_BULK_STATIC(offset, type)->element) +#define TSRMG_FAST_BULK_STATIC(offset, type) ((type) (((char*) TSRMLS_CACHE)+(offset))) +#define TSRMLS_MAIN_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE TSRM_TLS_MODEL_ATTR; +#define TSRMLS_MAIN_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE TSRM_TLS_MODEL_ATTR = NULL; +#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE; +#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL; +#define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache() +#define TSRMLS_CACHE _tsrm_ls_cache + +#ifdef __cplusplus +} +#endif + +#else /* non ZTS */ + +#define tsrm_env_lock() +#define tsrm_env_unlock() + +#define TSRMG_STATIC(id, type, element) +#define TSRMLS_MAIN_CACHE_EXTERN() +#define TSRMLS_MAIN_CACHE_DEFINE() +#define TSRMLS_CACHE_EXTERN() +#define TSRMLS_CACHE_DEFINE() +#define TSRMLS_CACHE_UPDATE() +#define TSRMLS_CACHE + +#define TSRM_TLS + +#endif /* ZTS */ + +#endif /* TSRM_H */ diff --git a/include/php/TSRM/tsrm_win32.h b/include/php/TSRM/tsrm_win32.h new file mode 100644 index 0000000..c5bdc49 --- /dev/null +++ b/include/php/TSRM/tsrm_win32.h @@ -0,0 +1,106 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Daniel Beulshausen | + +----------------------------------------------------------------------+ +*/ + +#ifndef TSRM_WIN32_H +#define TSRM_WIN32_H + +#include "TSRM.h" +#include +#include +#include "win32/ipc.h" + +struct ipc_perm { + key_t key; + unsigned short uid; + unsigned short gid; + unsigned short cuid; + unsigned short cgid; + unsigned short mode; + unsigned short seq; +}; + +struct shmid_ds { + struct ipc_perm shm_perm; + size_t shm_segsz; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; + unsigned short shm_cpid; + unsigned short shm_lpid; + short shm_nattch; +}; + +typedef struct { + FILE *stream; + HANDLE prochnd; +} process_pair; + +typedef struct { + void *addr; + HANDLE segment; + struct shmid_ds *descriptor; +} shm_pair; + +typedef struct { + process_pair *process; + shm_pair *shm; + int process_size; + int shm_size; + char *comspec; + HANDLE impersonation_token; + PSID impersonation_token_sid; +} tsrm_win32_globals; + +#ifdef ZTS +# define TWG(v) TSRMG_STATIC(win32_globals_id, tsrm_win32_globals *, v) +TSRMLS_CACHE_EXTERN() +#else +# define TWG(v) (win32_globals.v) +#endif + +#define IPC_PRIVATE 0 +#define IPC_CREAT 00001000 +#define IPC_EXCL 00002000 +#define IPC_NOWAIT 00004000 + +#define IPC_RMID 0 +#define IPC_SET 1 +#define IPC_STAT 2 +#define IPC_INFO 3 + +#define SHM_R PAGE_READONLY +#define SHM_W PAGE_READWRITE + +#define SHM_RDONLY FILE_MAP_READ +#define SHM_RND FILE_MAP_WRITE +#define SHM_REMAP FILE_MAP_COPY + +const char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, size_t *key_len); + +TSRM_API void tsrm_win32_startup(void); +TSRM_API void tsrm_win32_shutdown(void); + +TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, const char *env); +TSRM_API FILE *popen(const char *command, const char *type); +TSRM_API int pclose(FILE *stream); +TSRM_API int tsrm_win32_access(const char *pathname, int mode); +TSRM_API int win32_utime(const char *filename, struct utimbuf *buf); + +TSRM_API int shmget(key_t key, size_t size, int flags); +TSRM_API void *shmat(int key, const void *shmaddr, int flags); +TSRM_API int shmdt(const void *shmaddr); +TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf); +#endif diff --git a/include/php/Zend/Optimizer/zend_call_graph.h b/include/php/Zend/Optimizer/zend_call_graph.h new file mode 100644 index 0000000..3a02425 --- /dev/null +++ b/include/php/Zend/Optimizer/zend_call_graph.h @@ -0,0 +1,70 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine, Call Graph | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_CALL_GRAPH_H +#define ZEND_CALL_GRAPH_H + +#include "zend_ssa.h" +#include "zend_func_info.h" +#include "zend_optimizer.h" + +typedef struct _zend_send_arg_info { + zend_op *opline; +} zend_send_arg_info; + +struct _zend_call_info { + zend_op_array *caller_op_array; + zend_op *caller_init_opline; + zend_op *caller_call_opline; + zend_function *callee_func; + zend_call_info *next_caller; + zend_call_info *next_callee; + bool recursive; + bool send_unpack; /* Parameters passed by SEND_UNPACK or SEND_ARRAY */ + bool named_args; /* Function has named arguments */ + bool is_prototype; /* An overridden child method may be called */ + int num_args; /* Number of arguments, excluding named and variadic arguments */ + zend_send_arg_info arg_info[1]; +}; + +struct _zend_func_info { + int num; + uint32_t flags; + zend_ssa ssa; /* Static Single Assignment Form */ + zend_call_info *caller_info; /* where this function is called from */ + zend_call_info *callee_info; /* which functions are called from this one */ + zend_call_info **call_map; /* Call info associated with init/call/send opnum */ + zend_ssa_var_info return_info; +}; + +typedef struct _zend_call_graph { + int op_arrays_count; + zend_op_array **op_arrays; + zend_func_info *func_infos; +} zend_call_graph; + +BEGIN_EXTERN_C() + +ZEND_API void zend_build_call_graph(zend_arena **arena, zend_script *script, zend_call_graph *call_graph); +ZEND_API void zend_analyze_call_graph(zend_arena **arena, zend_script *script, zend_call_graph *call_graph); +ZEND_API zend_call_info **zend_build_call_map(zend_arena **arena, zend_func_info *info, const zend_op_array *op_array); +ZEND_API void zend_analyze_calls(zend_arena **arena, zend_script *script, uint32_t build_flags, zend_op_array *op_array, zend_func_info *func_info); + +END_EXTERN_C() + +#endif /* ZEND_CALL_GRAPH_H */ diff --git a/include/php/Zend/Optimizer/zend_cfg.h b/include/php/Zend/Optimizer/zend_cfg.h new file mode 100644 index 0000000..93d4550 --- /dev/null +++ b/include/php/Zend/Optimizer/zend_cfg.h @@ -0,0 +1,126 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine, CFG - Control Flow Graph | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_CFG_H +#define ZEND_CFG_H + +/* zend_basic_block.flags */ +#define ZEND_BB_START (1<<0) /* first block */ +#define ZEND_BB_FOLLOW (1<<1) /* follows the next block */ +#define ZEND_BB_TARGET (1<<2) /* jump target */ +#define ZEND_BB_EXIT (1<<3) /* without successors */ +#define ZEND_BB_ENTRY (1<<4) /* stackless entry */ +#define ZEND_BB_TRY (1<<5) /* start of try block */ +#define ZEND_BB_CATCH (1<<6) /* start of catch block */ +#define ZEND_BB_FINALLY (1<<7) /* start of finally block */ +#define ZEND_BB_FINALLY_END (1<<8) /* end of finally block */ +#define ZEND_BB_UNREACHABLE_FREE (1<<11) /* unreachable loop free */ +#define ZEND_BB_RECV_ENTRY (1<<12) /* RECV entry */ + +#define ZEND_BB_LOOP_HEADER (1<<16) +#define ZEND_BB_IRREDUCIBLE_LOOP (1<<17) + +#define ZEND_BB_REACHABLE (1U<<31) + +#define ZEND_BB_PROTECTED (ZEND_BB_ENTRY|ZEND_BB_RECV_ENTRY|ZEND_BB_TRY|ZEND_BB_CATCH|ZEND_BB_FINALLY|ZEND_BB_FINALLY_END|ZEND_BB_UNREACHABLE_FREE) + +typedef struct _zend_basic_block { + int *successors; /* successor block indices */ + uint32_t flags; + uint32_t start; /* first opcode number */ + uint32_t len; /* number of opcodes */ + int successors_count; /* number of successors */ + int predecessors_count; /* number of predecessors */ + int predecessor_offset; /* offset of 1-st predecessor */ + int idom; /* immediate dominator block */ + int loop_header; /* closest loop header, or -1 */ + int level; /* steps away from the entry in the dom. tree */ + int children; /* list of dominated blocks */ + int next_child; /* next dominated block */ + int successors_storage[2]; /* up to 2 successor blocks */ +} zend_basic_block; + +/* ++------------+---+---+---+---+---+ +| |OP1|OP2|EXT| 0 | 1 | ++------------+---+---+---+---+---+ +|JMP |ADR| | |OP1| - | +|JMPZ | |ADR| |OP2|FOL| +|JMPNZ | |ADR| |OP2|FOL| +|JMPZ_EX | |ADR| |OP2|FOL| +|JMPNZ_EX | |ADR| |OP2|FOL| +|JMP_SET | |ADR| |OP2|FOL| +|COALESCE | |ADR| |OP2|FOL| +|ASSERT_CHK | |ADR| |OP2|FOL| +|NEW | |ADR| |OP2|FOL| +|DCL_ANON* |ADR| | |OP1|FOL| +|FE_RESET_* | |ADR| |OP2|FOL| +|FE_FETCH_* | | |ADR|EXT|FOL| +|CATCH | | |ADR|EXT|FOL| +|FAST_CALL |ADR| | |OP1|FOL| +|FAST_RET | | | | - | - | +|RETURN* | | | | - | - | +|EXIT | | | | - | - | +|THROW | | | | - | - | +|* | | | |FOL| - | ++------------+---+---+---+---+---+ +*/ + +typedef struct _zend_cfg { + int blocks_count; /* number of basic blocks */ + int edges_count; /* number of edges */ + zend_basic_block *blocks; /* array of basic blocks */ + int *predecessors; + uint32_t *map; + uint32_t flags; +} zend_cfg; + +/* Build Flags */ +#define ZEND_CFG_STACKLESS (1<<30) +#define ZEND_SSA_DEBUG_LIVENESS (1<<29) +#define ZEND_SSA_DEBUG_PHI_PLACEMENT (1<<28) +#define ZEND_SSA_RC_INFERENCE (1<<27) +#define ZEND_CFG_NO_ENTRY_PREDECESSORS (1<<25) +#define ZEND_CFG_RECV_ENTRY (1<<24) +#define ZEND_CALL_TREE (1<<23) +#define ZEND_SSA_USE_CV_RESULTS (1<<22) + +#define CRT_CONSTANT_EX(op_array, opline, node) \ + (((op_array)->fn_flags & ZEND_ACC_DONE_PASS_TWO) ? \ + RT_CONSTANT(opline, (node)) \ + : \ + CT_CONSTANT_EX(op_array, (node).constant) \ + ) + +#define CRT_CONSTANT(node) \ + CRT_CONSTANT_EX(op_array, opline, node) + +#define RETURN_VALUE_USED(opline) \ + ((opline)->result_type != IS_UNUSED) + +BEGIN_EXTERN_C() + +ZEND_API void zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, uint32_t build_flags, zend_cfg *cfg); +void zend_cfg_remark_reachable_blocks(const zend_op_array *op_array, zend_cfg *cfg); +ZEND_API void zend_cfg_build_predecessors(zend_arena **arena, zend_cfg *cfg); +ZEND_API void zend_cfg_compute_dominators_tree(const zend_op_array *op_array, zend_cfg *cfg); +ZEND_API void zend_cfg_identify_loops(const zend_op_array *op_array, zend_cfg *cfg); + +END_EXTERN_C() + +#endif /* ZEND_CFG_H */ diff --git a/include/php/Zend/Optimizer/zend_dfg.h b/include/php/Zend/Optimizer/zend_dfg.h new file mode 100644 index 0000000..b59dc62 --- /dev/null +++ b/include/php/Zend/Optimizer/zend_dfg.h @@ -0,0 +1,51 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine, DFG - Data Flow Graph | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_DFG_H +#define ZEND_DFG_H + +#include "zend_bitset.h" +#include "zend_cfg.h" + +typedef struct _zend_dfg { + int vars; + uint32_t size; + zend_bitset tmp; + zend_bitset def; + zend_bitset use; + zend_bitset in; + zend_bitset out; +} zend_dfg; + +#define DFG_BITSET(set, set_size, block_num) \ + ((set) + ((block_num) * (set_size))) + +#define DFG_SET(set, set_size, block_num, var_num) \ + zend_bitset_incl(DFG_BITSET(set, set_size, block_num), (var_num)) + +#define DFG_ISSET(set, set_size, block_num, var_num) \ + zend_bitset_in(DFG_BITSET(set, set_size, block_num), (var_num)) + +BEGIN_EXTERN_C() + +void zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg *dfg, uint32_t build_flags); +ZEND_API void zend_dfg_add_use_def_op(const zend_op_array *op_array, const zend_op *opline, uint32_t build_flags, zend_bitset use, zend_bitset def); + +END_EXTERN_C() + +#endif /* ZEND_DFG_H */ diff --git a/include/php/Zend/Optimizer/zend_dump.h b/include/php/Zend/Optimizer/zend_dump.h new file mode 100644 index 0000000..8eba476 --- /dev/null +++ b/include/php/Zend/Optimizer/zend_dump.h @@ -0,0 +1,52 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine, Bytecode Visualisation | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_DUMP_H +#define ZEND_DUMP_H + +#include "zend_ssa.h" +#include "zend_dfg.h" + +#include + +#define ZEND_DUMP_HIDE_UNREACHABLE (1<<0) +#define ZEND_DUMP_RC_INFERENCE (1<<1) +#define ZEND_DUMP_CFG (1<<2) +#define ZEND_DUMP_SSA (1<<3) +#define ZEND_DUMP_LIVE_RANGES (1<<4) +#define ZEND_DUMP_LINE_NUMBERS (1<<5) + +BEGIN_EXTERN_C() + +ZEND_API void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, const char *msg, const void *data); +ZEND_API void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *b, const zend_op *opline, uint32_t dump_flags, const zend_ssa *ssa, const zend_ssa_op *ssa_op); +ZEND_API void zend_dump_op_line(const zend_op_array *op_array, const zend_basic_block *b, const zend_op *opline, uint32_t dump_flags, const void *data); +void zend_dump_dominators(const zend_op_array *op_array, const zend_cfg *cfg); +void zend_dump_dfg(const zend_op_array *op_array, const zend_cfg *cfg, const zend_dfg *dfg); +void zend_dump_phi_placement(const zend_op_array *op_array, const zend_ssa *ssa); +void zend_dump_variables(const zend_op_array *op_array); +void zend_dump_ssa_variables(const zend_op_array *op_array, const zend_ssa *ssa, uint32_t dump_flags); +ZEND_API void zend_dump_ssa_var(const zend_op_array *op_array, const zend_ssa *ssa, int ssa_var_num, uint8_t var_type, int var_num, uint32_t dump_flags); +ZEND_API void zend_dump_var(const zend_op_array *op_array, uint8_t var_type, int var_num); +void zend_dump_op_array_name(const zend_op_array *op_array); +void zend_dump_const(const zval *zv); +void zend_dump_ht(HashTable *ht); + +END_EXTERN_C() + +#endif /* ZEND_DUMP_H */ diff --git a/include/php/Zend/Optimizer/zend_func_info.h b/include/php/Zend/Optimizer/zend_func_info.h new file mode 100644 index 0000000..b53683b --- /dev/null +++ b/include/php/Zend/Optimizer/zend_func_info.h @@ -0,0 +1,70 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine, Func Info | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_FUNC_INFO_H +#define ZEND_FUNC_INFO_H + +#include "zend_ssa.h" + +/* func/cfg flags */ +#define ZEND_FUNC_INDIRECT_VAR_ACCESS (1<<0) /* accesses variables by name */ +#define ZEND_FUNC_HAS_CALLS (1<<1) +#define ZEND_FUNC_VARARG (1<<2) /* uses func_get_args() */ +#define ZEND_FUNC_NO_LOOPS (1<<3) +#define ZEND_FUNC_IRREDUCIBLE (1<<4) +#define ZEND_FUNC_FREE_LOOP_VAR (1<<5) +#define ZEND_FUNC_RECURSIVE (1<<7) +#define ZEND_FUNC_RECURSIVE_DIRECTLY (1<<8) +#define ZEND_FUNC_RECURSIVE_INDIRECTLY (1<<9) +#define ZEND_FUNC_HAS_EXTENDED_FCALL (1<<10) +#define ZEND_FUNC_HAS_EXTENDED_STMT (1<<11) +#define ZEND_SSA_TSSA (1<<12) /* used by tracing JIT */ + +#define ZEND_FUNC_JIT_ON_FIRST_EXEC (1<<13) /* used by JIT */ +#define ZEND_FUNC_JIT_ON_PROF_REQUEST (1<<14) /* used by JIT */ +#define ZEND_FUNC_JIT_ON_HOT_COUNTERS (1<<15) /* used by JIT */ +#define ZEND_FUNC_JIT_ON_HOT_TRACE (1<<16) /* used by JIT */ + + +typedef struct _zend_func_info zend_func_info; +typedef struct _zend_call_info zend_call_info; + +#define ZEND_FUNC_INFO(op_array) \ + ((zend_func_info*)((op_array)->reserved[zend_func_info_rid])) + +#define ZEND_SET_FUNC_INFO(op_array, info) do { \ + zend_func_info** pinfo = (zend_func_info**)&(op_array)->reserved[zend_func_info_rid]; \ + *pinfo = info; \ + } while (0) + +BEGIN_EXTERN_C() + +extern ZEND_API int zend_func_info_rid; + +uint32_t zend_get_internal_func_info( + const zend_function *callee_func, const zend_call_info *call_info, const zend_ssa *ssa); +ZEND_API uint32_t zend_get_func_info( + const zend_call_info *call_info, const zend_ssa *ssa, + zend_class_entry **ce, bool *ce_is_instanceof); + +zend_result zend_func_info_startup(void); +zend_result zend_func_info_shutdown(void); + +END_EXTERN_C() + +#endif /* ZEND_FUNC_INFO_H */ diff --git a/include/php/Zend/Optimizer/zend_inference.h b/include/php/Zend/Optimizer/zend_inference.h new file mode 100644 index 0000000..ffcf4f0 --- /dev/null +++ b/include/php/Zend/Optimizer/zend_inference.h @@ -0,0 +1,246 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine, e-SSA based Type & Range Inference | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_INFERENCE_H +#define ZEND_INFERENCE_H + +#include "zend_optimizer.h" +#include "zend_ssa.h" +#include "zend_bitset.h" + +/* Bitmask for type inference (zend_ssa_var_info.type) */ +#include "zend_type_info.h" + +#include + +#define MAY_BE_PACKED_GUARD (1<<27) /* needs packed array guard */ +#define MAY_BE_CLASS_GUARD (1<<27) /* needs class guard */ +#define MAY_BE_GUARD (1<<28) /* needs type guard */ + +#define MAY_HAVE_DTOR \ + (MAY_BE_OBJECT|MAY_BE_RESOURCE \ + |MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE) + +#define DEFINE_SSA_OP_HAS_RANGE(opN) \ + static zend_always_inline bool _ssa_##opN##_has_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ + { \ + if (opline->opN##_type == IS_CONST) { \ + zval *zv = CRT_CONSTANT(opline->opN); \ + return (Z_TYPE_P(zv) == IS_LONG); \ + } else { \ + return (opline->opN##_type != IS_UNUSED && \ + ssa->var_info && \ + ssa_op->opN##_use >= 0 && \ + ssa->var_info[ssa_op->opN##_use].has_range); \ + } \ + return 0; \ + } \ + +#define DEFINE_SSA_OP_MIN_RANGE(opN) \ + static zend_always_inline zend_long _ssa_##opN##_min_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ + { \ + if (opline->opN##_type == IS_CONST) { \ + zval *zv = CRT_CONSTANT(opline->opN); \ + if (Z_TYPE_P(zv) == IS_LONG) { \ + return Z_LVAL_P(zv); \ + } \ + } else if (opline->opN##_type != IS_UNUSED && \ + ssa->var_info && \ + ssa_op->opN##_use >= 0 && \ + ssa->var_info[ssa_op->opN##_use].has_range) { \ + return ssa->var_info[ssa_op->opN##_use].range.min; \ + } \ + return ZEND_LONG_MIN; \ + } \ + +#define DEFINE_SSA_OP_MAX_RANGE(opN) \ + static zend_always_inline zend_long _ssa_##opN##_max_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ + { \ + if (opline->opN##_type == IS_CONST) { \ + zval *zv = CRT_CONSTANT(opline->opN); \ + if (Z_TYPE_P(zv) == IS_LONG) { \ + return Z_LVAL_P(zv); \ + } \ + } else if (opline->opN##_type != IS_UNUSED && \ + ssa->var_info && \ + ssa_op->opN##_use >= 0 && \ + ssa->var_info[ssa_op->opN##_use].has_range) { \ + return ssa->var_info[ssa_op->opN##_use].range.max; \ + } \ + return ZEND_LONG_MAX; \ + } \ + +#define DEFINE_SSA_OP_RANGE_UNDERFLOW(opN) \ + static zend_always_inline char _ssa_##opN##_range_underflow(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ + { \ + if (opline->opN##_type == IS_CONST) { \ + zval *zv = CRT_CONSTANT(opline->opN); \ + if (Z_TYPE_P(zv) == IS_LONG) { \ + return 0; \ + } \ + } else if (opline->opN##_type != IS_UNUSED && \ + ssa->var_info && \ + ssa_op->opN##_use >= 0 && \ + ssa->var_info[ssa_op->opN##_use].has_range) { \ + return ssa->var_info[ssa_op->opN##_use].range.underflow; \ + } \ + return 1; \ + } \ + +#define DEFINE_SSA_OP_RANGE_OVERFLOW(opN) \ + static zend_always_inline char _ssa_##opN##_range_overflow(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ + { \ + if (opline->opN##_type == IS_CONST) { \ + zval *zv = CRT_CONSTANT(opline->opN); \ + if (Z_TYPE_P(zv) == IS_LONG) { \ + return 0; \ + } \ + } else if (opline->opN##_type != IS_UNUSED && \ + ssa->var_info && \ + ssa_op->opN##_use >= 0 && \ + ssa->var_info[ssa_op->opN##_use].has_range) { \ + return ssa->var_info[ssa_op->opN##_use].range.overflow; \ + } \ + return 1; \ + } \ + +DEFINE_SSA_OP_HAS_RANGE(op1) +DEFINE_SSA_OP_MIN_RANGE(op1) +DEFINE_SSA_OP_MAX_RANGE(op1) +DEFINE_SSA_OP_RANGE_UNDERFLOW(op1) +DEFINE_SSA_OP_RANGE_OVERFLOW(op1) +DEFINE_SSA_OP_HAS_RANGE(op2) +DEFINE_SSA_OP_MIN_RANGE(op2) +DEFINE_SSA_OP_MAX_RANGE(op2) +DEFINE_SSA_OP_RANGE_UNDERFLOW(op2) +DEFINE_SSA_OP_RANGE_OVERFLOW(op2) + +#define OP1_HAS_RANGE() (_ssa_op1_has_range (op_array, ssa, opline, ssa_op)) +#define OP1_MIN_RANGE() (_ssa_op1_min_range (op_array, ssa, opline, ssa_op)) +#define OP1_MAX_RANGE() (_ssa_op1_max_range (op_array, ssa, opline, ssa_op)) +#define OP1_RANGE_UNDERFLOW() (_ssa_op1_range_underflow (op_array, ssa, opline, ssa_op)) +#define OP1_RANGE_OVERFLOW() (_ssa_op1_range_overflow (op_array, ssa, opline, ssa_op)) +#define OP2_HAS_RANGE() (_ssa_op2_has_range (op_array, ssa, opline, ssa_op)) +#define OP2_MIN_RANGE() (_ssa_op2_min_range (op_array, ssa, opline, ssa_op)) +#define OP2_MAX_RANGE() (_ssa_op2_max_range (op_array, ssa, opline, ssa_op)) +#define OP2_RANGE_UNDERFLOW() (_ssa_op2_range_underflow (op_array, ssa, opline, ssa_op)) +#define OP2_RANGE_OVERFLOW() (_ssa_op2_range_overflow (op_array, ssa, opline, ssa_op)) + +BEGIN_EXTERN_C() +ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv); +END_EXTERN_C() + +static zend_always_inline uint32_t _const_op_type(const zval *zv) { + if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { + return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY; + } else if (Z_TYPE_P(zv) == IS_ARRAY) { + return zend_array_type_info(zv); + } else { + uint32_t tmp = (1 << Z_TYPE_P(zv)); + + if (Z_REFCOUNTED_P(zv)) { + tmp |= MAY_BE_RC1 | MAY_BE_RCN; + } else if (Z_TYPE_P(zv) == IS_STRING) { + tmp |= MAY_BE_RCN; + } + return tmp; + } +} + +static zend_always_inline uint32_t get_ssa_var_info(const zend_ssa *ssa, int ssa_var_num) +{ + if (ssa->var_info && ssa_var_num >= 0) { + return ssa->var_info[ssa_var_num].type; + } else { + return MAY_BE_UNDEF | MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_REF | MAY_BE_INDIRECT | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; + } +} + +#define DEFINE_SSA_OP_INFO(opN) \ + static zend_always_inline uint32_t _ssa_##opN##_info(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ + { \ + if (opline->opN##_type == IS_CONST) { \ + return _const_op_type(CRT_CONSTANT(opline->opN)); \ + } else { \ + return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_use : -1); \ + } \ + } \ + +#define DEFINE_SSA_OP_DEF_INFO(opN) \ + static zend_always_inline uint32_t _ssa_##opN##_def_info(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \ + { \ + return get_ssa_var_info(ssa, ssa->var_info ? ssa_op->opN##_def : -1); \ + } \ + + +DEFINE_SSA_OP_INFO(op1) +DEFINE_SSA_OP_INFO(op2) +DEFINE_SSA_OP_INFO(result) +DEFINE_SSA_OP_DEF_INFO(op1) +DEFINE_SSA_OP_DEF_INFO(op2) +DEFINE_SSA_OP_DEF_INFO(result) + +#define OP1_INFO() (_ssa_op1_info(op_array, ssa, opline, ssa_op)) +#define OP2_INFO() (_ssa_op2_info(op_array, ssa, opline, ssa_op)) +#define OP1_DATA_INFO() (_ssa_op1_info(op_array, ssa, (opline+1), (ssa_op+1))) +#define OP2_DATA_INFO() (_ssa_op2_info(op_array, ssa, (opline+1), (ssa_op+1))) +#define RES_USE_INFO() (_ssa_result_info(op_array, ssa, opline, ssa_op)) +#define OP1_DEF_INFO() (_ssa_op1_def_info(op_array, ssa, opline, ssa_op)) +#define OP2_DEF_INFO() (_ssa_op2_def_info(op_array, ssa, opline, ssa_op)) +#define OP1_DATA_DEF_INFO() (_ssa_op1_def_info(op_array, ssa, (opline+1), (ssa_op+1))) +#define OP2_DATA_DEF_INFO() (_ssa_op2_def_info(op_array, ssa, (opline+1), (ssa_op+1))) +#define RES_INFO() (_ssa_result_def_info(op_array, ssa, opline, ssa_op)) + +static zend_always_inline bool zend_add_will_overflow(zend_long a, zend_long b) { + return (b > 0 && a > ZEND_LONG_MAX - b) + || (b < 0 && a < ZEND_LONG_MIN - b); +} +static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) { + return (b > 0 && a < ZEND_LONG_MIN + b) + || (b < 0 && a > ZEND_LONG_MAX + b); +} + +BEGIN_EXTERN_C() + +ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ssa); +ZEND_API void zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa); +ZEND_API zend_result zend_ssa_inference(zend_arena **raena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimization_level); + +ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, int write, int insert); + +ZEND_API bool zend_inference_propagate_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op* ssa_op, int var, zend_ssa_range *tmp); + +ZEND_API uint32_t zend_fetch_arg_info_type( + const zend_script *script, const zend_arg_info *arg_info, zend_class_entry **pce); +ZEND_API void zend_init_func_return_info( + const zend_op_array *op_array, const zend_script *script, zend_ssa_var_info *ret); +uint32_t zend_get_return_info_from_signature_only( + const zend_function *func, const zend_script *script, + zend_class_entry **ce, bool *ce_is_instanceof, bool use_tentative_return_info); + +ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, const zend_ssa *ssa, uint32_t t1, uint32_t t2); +ZEND_API bool zend_may_throw(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, const zend_ssa *ssa); + +ZEND_API zend_result zend_update_type_info( + const zend_op_array *op_array, zend_ssa *ssa, const zend_script *script, + zend_op *opline, zend_ssa_op *ssa_op, const zend_op **ssa_opcodes, + zend_long optimization_level); + +END_EXTERN_C() + +#endif /* ZEND_INFERENCE_H */ diff --git a/include/php/Zend/Optimizer/zend_optimizer.h b/include/php/Zend/Optimizer/zend_optimizer.h new file mode 100644 index 0000000..16bfd75 --- /dev/null +++ b/include/php/Zend/Optimizer/zend_optimizer.h @@ -0,0 +1,103 @@ +/* + +----------------------------------------------------------------------+ + | Zend OPcache | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Stanislav Malyshev | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_OPTIMIZER_H +#define ZEND_OPTIMIZER_H + +#include "zend.h" +#include "zend_compile.h" + +#define ZEND_OPTIMIZER_PASS_1 (1<<0) /* Simple local optimizations */ +#define ZEND_OPTIMIZER_PASS_2 (1<<1) /* */ +#define ZEND_OPTIMIZER_PASS_3 (1<<2) /* Jump optimization */ +#define ZEND_OPTIMIZER_PASS_4 (1<<3) /* INIT_FCALL_BY_NAME -> DO_FCALL */ +#define ZEND_OPTIMIZER_PASS_5 (1<<4) /* CFG based optimization */ +#define ZEND_OPTIMIZER_PASS_6 (1<<5) /* DFA based optimization */ +#define ZEND_OPTIMIZER_PASS_7 (1<<6) /* CALL GRAPH optimization */ +#define ZEND_OPTIMIZER_PASS_8 (1<<7) /* SCCP (constant propagation) */ +#define ZEND_OPTIMIZER_PASS_9 (1<<8) /* TMP VAR usage */ +#define ZEND_OPTIMIZER_PASS_10 (1<<9) /* NOP removal */ +#define ZEND_OPTIMIZER_PASS_11 (1<<10) /* Merge equal constants */ +#define ZEND_OPTIMIZER_PASS_12 (1<<11) /* Adjust used stack */ +#define ZEND_OPTIMIZER_PASS_13 (1<<12) /* Remove unused variables */ +#define ZEND_OPTIMIZER_PASS_14 (1<<13) /* DCE (dead code elimination) */ +#define ZEND_OPTIMIZER_PASS_15 (1<<14) /* (unsafe) Collect constants */ +#define ZEND_OPTIMIZER_PASS_16 (1<<15) /* Inline functions */ + +#define ZEND_OPTIMIZER_IGNORE_OVERLOADING (1<<16) /* (unsafe) Ignore possibility of operator overloading */ + +#define ZEND_OPTIMIZER_NARROW_TO_DOUBLE (1<<17) /* try to narrow long constant assignments to double */ + +#define ZEND_OPTIMIZER_ALL_PASSES 0x7FFFFFFF + +#define DEFAULT_OPTIMIZATION_LEVEL "0x7FFEBFFF" + + +#define ZEND_DUMP_AFTER_PASS_1 ZEND_OPTIMIZER_PASS_1 +#define ZEND_DUMP_AFTER_PASS_2 ZEND_OPTIMIZER_PASS_2 +#define ZEND_DUMP_AFTER_PASS_3 ZEND_OPTIMIZER_PASS_3 +#define ZEND_DUMP_AFTER_PASS_4 ZEND_OPTIMIZER_PASS_4 +#define ZEND_DUMP_AFTER_PASS_5 ZEND_OPTIMIZER_PASS_5 +#define ZEND_DUMP_AFTER_PASS_6 ZEND_OPTIMIZER_PASS_6 +#define ZEND_DUMP_AFTER_PASS_7 ZEND_OPTIMIZER_PASS_7 +#define ZEND_DUMP_AFTER_PASS_8 ZEND_OPTIMIZER_PASS_8 +#define ZEND_DUMP_AFTER_PASS_9 ZEND_OPTIMIZER_PASS_9 +#define ZEND_DUMP_AFTER_PASS_10 ZEND_OPTIMIZER_PASS_10 +#define ZEND_DUMP_AFTER_PASS_11 ZEND_OPTIMIZER_PASS_11 +#define ZEND_DUMP_AFTER_PASS_12 ZEND_OPTIMIZER_PASS_12 +#define ZEND_DUMP_AFTER_PASS_13 ZEND_OPTIMIZER_PASS_13 +#define ZEND_DUMP_AFTER_PASS_14 ZEND_OPTIMIZER_PASS_14 + +#define ZEND_DUMP_BEFORE_OPTIMIZER (1<<16) +#define ZEND_DUMP_AFTER_OPTIMIZER (1<<17) + +#define ZEND_DUMP_BEFORE_BLOCK_PASS (1<<18) +#define ZEND_DUMP_AFTER_BLOCK_PASS (1<<19) +#define ZEND_DUMP_BLOCK_PASS_VARS (1<<20) + +#define ZEND_DUMP_BEFORE_DFA_PASS (1<<21) +#define ZEND_DUMP_AFTER_DFA_PASS (1<<22) +#define ZEND_DUMP_DFA_CFG (1<<23) +#define ZEND_DUMP_DFA_DOMINATORS (1<<24) +#define ZEND_DUMP_DFA_LIVENESS (1<<25) +#define ZEND_DUMP_DFA_PHI (1<<26) +#define ZEND_DUMP_DFA_SSA (1<<27) +#define ZEND_DUMP_DFA_SSA_VARS (1<<28) +#define ZEND_DUMP_SCCP (1<<29) + +typedef struct _zend_script { + zend_string *filename; + zend_op_array main_op_array; + HashTable function_table; + HashTable class_table; +} zend_script; + +typedef void (*zend_optimizer_pass_t)(zend_script *, void *context); + +BEGIN_EXTERN_C() +ZEND_API void zend_optimize_script(zend_script *script, zend_long optimization_level, zend_long debug_level); +ZEND_API int zend_optimizer_register_pass(zend_optimizer_pass_t pass); +ZEND_API void zend_optimizer_unregister_pass(int idx); +zend_result zend_optimizer_startup(void); +zend_result zend_optimizer_shutdown(void); +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/Optimizer/zend_ssa.h b/include/php/Zend/Optimizer/zend_ssa.h new file mode 100644 index 0000000..b59c59a --- /dev/null +++ b/include/php/Zend/Optimizer/zend_ssa.h @@ -0,0 +1,328 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine, SSA - Static Single Assignment Form | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_SSA_H +#define ZEND_SSA_H + +#include "zend_optimizer.h" +#include "zend_cfg.h" + +typedef struct _zend_ssa_range { + zend_long min; + zend_long max; + bool underflow; + bool overflow; +} zend_ssa_range; + +typedef enum _zend_ssa_negative_lat { + NEG_NONE = 0, + NEG_INIT = 1, + NEG_INVARIANT = 2, + NEG_USE_LT = 3, + NEG_USE_GT = 4, + NEG_UNKNOWN = 5 +} zend_ssa_negative_lat; + +/* Special kind of SSA Phi function used in eSSA */ +typedef struct _zend_ssa_range_constraint { + zend_ssa_range range; /* simple range constraint */ + int min_var; + int max_var; + int min_ssa_var; /* ((min_var>0) ? MIN(ssa_var) : 0) + range.min */ + int max_ssa_var; /* ((max_var>0) ? MAX(ssa_var) : 0) + range.max */ + zend_ssa_negative_lat negative; +} zend_ssa_range_constraint; + +typedef struct _zend_ssa_type_constraint { + uint32_t type_mask; /* Type mask to intersect with */ + zend_class_entry *ce; /* Class entry for instanceof constraints */ +} zend_ssa_type_constraint; + +typedef union _zend_ssa_pi_constraint { + zend_ssa_range_constraint range; + zend_ssa_type_constraint type; +} zend_ssa_pi_constraint; + +/* SSA Phi - ssa_var = Phi(source0, source1, ...sourceN) */ +typedef struct _zend_ssa_phi zend_ssa_phi; +struct _zend_ssa_phi { + zend_ssa_phi *next; /* next Phi in the same BB */ + int pi; /* if >= 0 this is actually a e-SSA Pi */ + zend_ssa_pi_constraint constraint; /* e-SSA Pi constraint */ + int var; /* Original CV, VAR or TMP variable index */ + int ssa_var; /* SSA variable index */ + int block; /* current BB index */ + bool has_range_constraint : 1; + zend_ssa_phi **use_chains; + zend_ssa_phi *sym_use_chain; + int *sources; /* Array of SSA IDs that produce this var. + As many as this block has + predecessors. */ +}; + +typedef struct _zend_ssa_block { + zend_ssa_phi *phis; +} zend_ssa_block; + +typedef struct _zend_ssa_op { + int op1_use; + int op2_use; + int result_use; + int op1_def; + int op2_def; + int result_def; + int op1_use_chain; + int op2_use_chain; + int res_use_chain; +} zend_ssa_op; + +typedef enum _zend_ssa_alias_kind { + NO_ALIAS, + SYMTABLE_ALIAS, + HTTP_RESPONSE_HEADER_ALIAS +} zend_ssa_alias_kind; + +typedef enum _zend_ssa_escape_state { + ESCAPE_STATE_UNKNOWN, + ESCAPE_STATE_NO_ESCAPE, + ESCAPE_STATE_FUNCTION_ESCAPE, + ESCAPE_STATE_GLOBAL_ESCAPE +} zend_ssa_escape_state; + +typedef struct _zend_ssa_var { + int var; /* original var number; op.var for CVs and following numbers for VARs and TMP_VARs */ + int scc; /* strongly connected component */ + int definition; /* opcode that defines this value */ + int use_chain; /* uses of this value, linked through opN_use_chain */ + zend_ssa_phi *definition_phi; /* phi that defines this value */ + zend_ssa_phi *phi_use_chain; /* uses of this value in Phi, linked through use_chain */ + zend_ssa_phi *sym_use_chain; /* uses of this value in Pi constraints */ + unsigned int no_val : 1; /* value doesn't matter (used as op1 in ZEND_ASSIGN) */ + unsigned int scc_entry : 1; + unsigned int alias : 2; /* value may be changed indirectly */ + unsigned int escape_state : 2; +} zend_ssa_var; + +typedef struct _zend_ssa_var_info { + uint32_t type; /* inferred type (see zend_inference.h) */ + bool has_range : 1; + bool is_instanceof : 1; /* 0 - class == "ce", 1 - may be child of "ce" */ + bool recursive : 1; + bool use_as_double : 1; + bool delayed_fetch_this : 1; + bool avoid_refcounting : 1; + bool guarded_reference : 1; + bool indirect_reference : 1; /* IS_INDIRECT returned by FETCH_DIM_W/FETCH_OBJ_W */ + zend_ssa_range range; + zend_class_entry *ce; +} zend_ssa_var_info; + +typedef struct _zend_ssa { + zend_cfg cfg; /* control flow graph */ + int vars_count; /* number of SSA variables */ + int sccs; /* number of SCCs */ + zend_ssa_block *blocks; /* array of SSA blocks */ + zend_ssa_op *ops; /* array of SSA instructions */ + zend_ssa_var *vars; /* use/def chain of SSA variables */ + zend_ssa_var_info *var_info; +} zend_ssa; + +BEGIN_EXTERN_C() + +ZEND_API zend_result zend_build_ssa(zend_arena **arena, const zend_script *script, const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa); +ZEND_API void zend_ssa_compute_use_def_chains(zend_arena **arena, const zend_op_array *op_array, zend_ssa *ssa); +ZEND_API int zend_ssa_rename_op(const zend_op_array *op_array, const zend_op *opline, uint32_t k, uint32_t build_flags, int ssa_vars_count, zend_ssa_op *ssa_ops, int *var); +void zend_ssa_unlink_use_chain(zend_ssa *ssa, int op, int var); +void zend_ssa_replace_use_chain(zend_ssa *ssa, int op, int new_op, int var); + +void zend_ssa_remove_predecessor(zend_ssa *ssa, int from, int to); +void zend_ssa_remove_defs_of_instr(zend_ssa *ssa, zend_ssa_op *ssa_op); +void zend_ssa_remove_instr(zend_ssa *ssa, zend_op *opline, zend_ssa_op *ssa_op); +void zend_ssa_remove_phi(zend_ssa *ssa, zend_ssa_phi *phi); +void zend_ssa_remove_uses_of_var(zend_ssa *ssa, int var_num); +void zend_ssa_remove_block(zend_op_array *op_array, zend_ssa *ssa, int b); +void zend_ssa_rename_var_uses(zend_ssa *ssa, int old_var, int new_var, bool update_types); +void zend_ssa_remove_block_from_cfg(zend_ssa *ssa, int b); + +static zend_always_inline void _zend_ssa_remove_def(zend_ssa_var *var) +{ + ZEND_ASSERT(var->definition >= 0); + ZEND_ASSERT(var->use_chain < 0); + ZEND_ASSERT(!var->phi_use_chain); + var->definition = -1; +} + +static zend_always_inline void zend_ssa_remove_result_def(zend_ssa *ssa, zend_ssa_op *ssa_op) +{ + zend_ssa_var *var = &ssa->vars[ssa_op->result_def]; + _zend_ssa_remove_def(var); + ssa_op->result_def = -1; +} + +static zend_always_inline void zend_ssa_remove_op1_def(zend_ssa *ssa, zend_ssa_op *ssa_op) +{ + zend_ssa_var *var = &ssa->vars[ssa_op->op1_def]; + _zend_ssa_remove_def(var); + ssa_op->op1_def = -1; +} + +static zend_always_inline void zend_ssa_remove_op2_def(zend_ssa *ssa, zend_ssa_op *ssa_op) +{ + zend_ssa_var *var = &ssa->vars[ssa_op->op2_def]; + _zend_ssa_remove_def(var); + ssa_op->op2_def = -1; +} + +END_EXTERN_C() + +static zend_always_inline int zend_ssa_next_use(const zend_ssa_op *ssa_op, int var, int use) +{ + ssa_op += use; + if (ssa_op->op1_use == var) { + return ssa_op->op1_use_chain; + } else if (ssa_op->op2_use == var) { + return ssa_op->op2_use_chain; + } else { + return ssa_op->res_use_chain; + } +} + +static zend_always_inline zend_ssa_phi* zend_ssa_next_use_phi(const zend_ssa *ssa, int var, const zend_ssa_phi *p) +{ + if (p->pi >= 0) { + return p->use_chains[0]; + } else { + int j; + for (j = 0; j < ssa->cfg.blocks[p->block].predecessors_count; j++) { + if (p->sources[j] == var) { + return p->use_chains[j]; + } + } + } + return NULL; +} + +static zend_always_inline bool zend_ssa_is_no_val_use(const zend_op *opline, const zend_ssa_op *ssa_op, int var) +{ + if (opline->opcode == ZEND_ASSIGN + || opline->opcode == ZEND_UNSET_CV + || opline->opcode == ZEND_BIND_GLOBAL + || opline->opcode == ZEND_BIND_STATIC) { + return ssa_op->op1_use == var && ssa_op->op2_use != var; + } + if (opline->opcode == ZEND_FE_FETCH_R || opline->opcode == ZEND_FE_FETCH_RW) { + return ssa_op->op2_use == var && ssa_op->op1_use != var; + } + if (ssa_op->result_use == var + && opline->opcode != ZEND_ADD_ARRAY_ELEMENT + && opline->opcode != ZEND_ADD_ARRAY_UNPACK) { + return ssa_op->op1_use != var && ssa_op->op2_use != var; + } + return 0; +} + +static zend_always_inline void zend_ssa_rename_defs_of_instr(zend_ssa *ssa, zend_ssa_op *ssa_op) { + /* Rename def to use if possible. Mark variable as not defined otherwise. */ + if (ssa_op->op1_def >= 0) { + if (ssa_op->op1_use >= 0) { + zend_ssa_rename_var_uses(ssa, ssa_op->op1_def, ssa_op->op1_use, 1); + } + ssa->vars[ssa_op->op1_def].definition = -1; + ssa_op->op1_def = -1; + } + if (ssa_op->op2_def >= 0) { + if (ssa_op->op2_use >= 0) { + zend_ssa_rename_var_uses(ssa, ssa_op->op2_def, ssa_op->op2_use, 1); + } + ssa->vars[ssa_op->op2_def].definition = -1; + ssa_op->op2_def = -1; + } + if (ssa_op->result_def >= 0) { + if (ssa_op->result_use >= 0) { + zend_ssa_rename_var_uses(ssa, ssa_op->result_def, ssa_op->result_use, 1); + } + ssa->vars[ssa_op->result_def].definition = -1; + ssa_op->result_def = -1; + } +} + +#define NUM_PHI_SOURCES(phi) \ + ((phi)->pi >= 0 ? 1 : (ssa->cfg.blocks[(phi)->block].predecessors_count)) + +/* FOREACH_USE and FOREACH_PHI_USE explicitly support "continue" + * and changing the use chain of the current element */ +#define FOREACH_USE(var, use) do { \ + int _var_num = (var) - ssa->vars, next; \ + for (use = (var)->use_chain; use >= 0; use = next) { \ + next = zend_ssa_next_use(ssa->ops, _var_num, use); +#define FOREACH_USE_END() \ + } \ +} while (0) + +#define FOREACH_PHI_USE(var, phi) do { \ + int _var_num = (var) - ssa->vars; \ + zend_ssa_phi *next_phi; \ + for (phi = (var)->phi_use_chain; phi; phi = next_phi) { \ + next_phi = zend_ssa_next_use_phi(ssa, _var_num, phi); +#define FOREACH_PHI_USE_END() \ + } \ +} while (0) + +#define FOREACH_PHI_SOURCE(phi, source) do { \ + zend_ssa_phi *_phi = (phi); \ + int _i, _end = NUM_PHI_SOURCES(phi); \ + for (_i = 0; _i < _end; _i++) { \ + ZEND_ASSERT(_phi->sources[_i] >= 0); \ + source = _phi->sources[_i]; +#define FOREACH_PHI_SOURCE_END() \ + } \ +} while (0) + +#define FOREACH_PHI(phi) do { \ + int _i; \ + for (_i = 0; _i < ssa->cfg.blocks_count; _i++) { \ + phi = ssa->blocks[_i].phis; \ + for (; phi; phi = phi->next) { +#define FOREACH_PHI_END() \ + } \ + } \ +} while (0) + +#define FOREACH_BLOCK(block) do { \ + int _i; \ + for (_i = 0; _i < ssa->cfg.blocks_count; _i++) { \ + (block) = &ssa->cfg.blocks[_i]; \ + if (!((block)->flags & ZEND_BB_REACHABLE)) { \ + continue; \ + } +#define FOREACH_BLOCK_END() \ + } \ +} while (0) + +/* Does not support "break" */ +#define FOREACH_INSTR_NUM(i) do { \ + zend_basic_block *_block; \ + FOREACH_BLOCK(_block) { \ + uint32_t _end = _block->start + _block->len; \ + for ((i) = _block->start; (i) < _end; (i)++) { +#define FOREACH_INSTR_NUM_END() \ + } \ + } FOREACH_BLOCK_END(); \ +} while (0) + +#endif /* ZEND_SSA_H */ diff --git a/include/php/Zend/zend.h b/include/php/Zend/zend.h new file mode 100644 index 0000000..cddd0f3 --- /dev/null +++ b/include/php/Zend/zend.h @@ -0,0 +1,419 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_H +#define ZEND_H + +#define ZEND_VERSION "4.3.3-dev" + +#define ZEND_ENGINE_3 + +#include "zend_types.h" +#include "zend_map_ptr.h" +#include "zend_errors.h" +#include "zend_alloc.h" +#include "zend_llist.h" +#include "zend_string.h" +#include "zend_hash.h" +#include "zend_ast.h" +#include "zend_gc.h" +#include "zend_variables.h" +#include "zend_iterators.h" +#include "zend_stream.h" +#include "zend_smart_str_public.h" +#include "zend_smart_string_public.h" +#include "zend_signal.h" +#include "zend_max_execution_timer.h" + +#define zend_sprintf sprintf + +#define HANDLE_BLOCK_INTERRUPTIONS() ZEND_SIGNAL_BLOCK_INTERRUPTIONS() +#define HANDLE_UNBLOCK_INTERRUPTIONS() ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() + +#define INTERNAL_FUNCTION_PARAMETERS zend_execute_data *execute_data, zval *return_value +#define INTERNAL_FUNCTION_PARAM_PASSTHRU execute_data, return_value + +#define USED_RET() \ + (!EX(prev_execute_data) || \ + !ZEND_USER_CODE(EX(prev_execute_data)->func->common.type) || \ + (EX(prev_execute_data)->opline->result_type != IS_UNUSED)) + +#ifdef ZEND_ENABLE_STATIC_TSRMLS_CACHE +#define ZEND_TSRMG TSRMG_STATIC +#define ZEND_TSRMG_FAST TSRMG_FAST_STATIC +#define ZEND_TSRMLS_CACHE_EXTERN() TSRMLS_CACHE_EXTERN() +#define ZEND_TSRMLS_CACHE_DEFINE() TSRMLS_CACHE_DEFINE() +#define ZEND_TSRMLS_CACHE_UPDATE() TSRMLS_CACHE_UPDATE() +#define ZEND_TSRMLS_CACHE TSRMLS_CACHE +#else +#define ZEND_TSRMG TSRMG +#define ZEND_TSRMG_FAST TSRMG_FAST +#define ZEND_TSRMLS_CACHE_EXTERN() +#define ZEND_TSRMLS_CACHE_DEFINE() +#define ZEND_TSRMLS_CACHE_UPDATE() +#define ZEND_TSRMLS_CACHE +#endif + +#ifndef ZEND_COMPILE_DL_EXT +TSRMLS_MAIN_CACHE_EXTERN() +#else +ZEND_TSRMLS_CACHE_EXTERN() +#endif + +struct _zend_serialize_data; +struct _zend_unserialize_data; + +typedef struct _zend_serialize_data zend_serialize_data; +typedef struct _zend_unserialize_data zend_unserialize_data; + +typedef struct _zend_class_name { + zend_string *name; + zend_string *lc_name; +} zend_class_name; + +typedef struct _zend_trait_method_reference { + zend_string *method_name; + zend_string *class_name; +} zend_trait_method_reference; + +typedef struct _zend_trait_precedence { + zend_trait_method_reference trait_method; + uint32_t num_excludes; + zend_string *exclude_class_names[1]; +} zend_trait_precedence; + +typedef struct _zend_trait_alias { + zend_trait_method_reference trait_method; + + /** + * name for method to be added + */ + zend_string *alias; + + /** + * modifiers to be set on trait method + */ + uint32_t modifiers; +} zend_trait_alias; + +typedef struct _zend_class_mutable_data { + zval *default_properties_table; + HashTable *constants_table; + uint32_t ce_flags; + HashTable *backed_enum_table; +} zend_class_mutable_data; + +typedef struct _zend_class_dependency { + zend_string *name; + zend_class_entry *ce; +} zend_class_dependency; + +typedef struct _zend_inheritance_cache_entry zend_inheritance_cache_entry; + +typedef struct _zend_error_info { + int type; + uint32_t lineno; + zend_string *filename; + zend_string *message; +} zend_error_info; + +struct _zend_inheritance_cache_entry { + zend_inheritance_cache_entry *next; + zend_class_entry *ce; + zend_class_entry *parent; + zend_class_dependency *dependencies; + uint32_t dependencies_count; + uint32_t num_warnings; + zend_error_info **warnings; + zend_class_entry *traits_and_interfaces[1]; +}; + +struct _zend_class_entry { + char type; + zend_string *name; + /* class_entry or string depending on ZEND_ACC_LINKED */ + union { + zend_class_entry *parent; + zend_string *parent_name; + }; + int refcount; + uint32_t ce_flags; + + int default_properties_count; + int default_static_members_count; + zval *default_properties_table; + zval *default_static_members_table; + ZEND_MAP_PTR_DEF(zval *, static_members_table); + HashTable function_table; + HashTable properties_info; + HashTable constants_table; + + ZEND_MAP_PTR_DEF(zend_class_mutable_data*, mutable_data); + zend_inheritance_cache_entry *inheritance_cache; + + struct _zend_property_info **properties_info_table; + + zend_function *constructor; + zend_function *destructor; + zend_function *clone; + zend_function *__get; + zend_function *__set; + zend_function *__unset; + zend_function *__isset; + zend_function *__call; + zend_function *__callstatic; + zend_function *__tostring; + zend_function *__debugInfo; + zend_function *__serialize; + zend_function *__unserialize; + + const zend_object_handlers *default_object_handlers; + + /* allocated only if class implements Iterator or IteratorAggregate interface */ + zend_class_iterator_funcs *iterator_funcs_ptr; + /* allocated only if class implements ArrayAccess interface */ + zend_class_arrayaccess_funcs *arrayaccess_funcs_ptr; + + /* handlers */ + union { + zend_object* (*create_object)(zend_class_entry *class_type); + int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */ + }; + zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref); + zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method); + + /* serializer callbacks */ + int (*serialize)(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data); + int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data); + + uint32_t num_interfaces; + uint32_t num_traits; + + /* class_entry or string(s) depending on ZEND_ACC_LINKED */ + union { + zend_class_entry **interfaces; + zend_class_name *interface_names; + }; + + zend_class_name *trait_names; + zend_trait_alias **trait_aliases; + zend_trait_precedence **trait_precedences; + HashTable *attributes; + + uint32_t enum_backing_type; + HashTable *backed_enum_table; + + union { + struct { + zend_string *filename; + uint32_t line_start; + uint32_t line_end; + zend_string *doc_comment; + } user; + struct { + const struct _zend_function_entry *builtin_functions; + struct _zend_module_entry *module; + } internal; + } info; +}; + +typedef struct _zend_utility_functions { + void (*error_function)(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message); + size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2); + size_t (*write_function)(const char *str, size_t str_length); + FILE *(*fopen_function)(zend_string *filename, zend_string **opened_path); + void (*message_handler)(zend_long message, const void *data); + zval *(*get_configuration_directive)(zend_string *name); + void (*ticks_function)(int ticks); + void (*on_timeout)(int seconds); + zend_result (*stream_open_function)(zend_file_handle *handle); + void (*printf_to_smart_string_function)(smart_string *buf, const char *format, va_list ap); + void (*printf_to_smart_str_function)(smart_str *buf, const char *format, va_list ap); + char *(*getenv_function)(const char *name, size_t name_len); + zend_string *(*resolve_path_function)(zend_string *filename); +} zend_utility_functions; + +typedef struct _zend_utility_values { + bool html_errors; +} zend_utility_values; + +typedef size_t (*zend_write_func_t)(const char *str, size_t str_length); + +#define zend_bailout() _zend_bailout(__FILE__, __LINE__) + +#define zend_try \ + { \ + JMP_BUF *__orig_bailout = EG(bailout); \ + JMP_BUF __bailout; \ + \ + EG(bailout) = &__bailout; \ + if (SETJMP(__bailout)==0) { +#define zend_catch \ + } else { \ + EG(bailout) = __orig_bailout; +#define zend_end_try() \ + } \ + EG(bailout) = __orig_bailout; \ + } +#define zend_first_try EG(bailout)=NULL; zend_try + +BEGIN_EXTERN_C() +void zend_startup(zend_utility_functions *utility_functions); +void zend_shutdown(void); +void zend_register_standard_ini_entries(void); +zend_result zend_post_startup(void); +void zend_set_utility_values(zend_utility_values *utility_values); + +ZEND_API ZEND_COLD ZEND_NORETURN void _zend_bailout(const char *filename, uint32_t lineno); +ZEND_API size_t zend_get_page_size(void); + +ZEND_API size_t zend_vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap); +ZEND_API size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4); +ZEND_API zend_string *zend_vstrpprintf(size_t max_len, const char *format, va_list ap); +ZEND_API zend_string *zend_strpprintf(size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); + +/* Same as zend_spprintf and zend_strpprintf, without checking of format validity. + * For use with custom printf specifiers such as %H. */ +ZEND_API size_t zend_spprintf_unchecked(char **message, size_t max_len, const char *format, ...); +ZEND_API zend_string *zend_strpprintf_unchecked(size_t max_len, const char *format, ...); + +ZEND_API const char *get_zend_version(void); +ZEND_API bool zend_make_printable_zval(zval *expr, zval *expr_copy); +ZEND_API size_t zend_print_zval(zval *expr, int indent); +ZEND_API void zend_print_zval_r(zval *expr, int indent); +ZEND_API zend_string *zend_print_zval_r_to_str(zval *expr, int indent); +ZEND_API void zend_print_flat_zval_r(zval *expr); +void zend_print_flat_zval_r_to_buf(smart_str *str, zval *expr); + +static zend_always_inline size_t zend_print_variable(zval *var) { + return zend_print_zval(var, 0); +} + +ZEND_API ZEND_COLD void zend_output_debug_string(bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); + +ZEND_API void zend_activate(void); +ZEND_API void zend_deactivate(void); +ZEND_API void zend_call_destructors(void); +ZEND_API void zend_activate_modules(void); +ZEND_API void zend_deactivate_modules(void); +ZEND_API void zend_post_deactivate_modules(void); + +ZEND_API void free_estring(char **str_p); + +END_EXTERN_C() + +/* output support */ +#define ZEND_WRITE(str, str_len) zend_write((str), (str_len)) +#define ZEND_WRITE_EX(str, str_len) write_func((str), (str_len)) +#define ZEND_PUTS(str) zend_write((str), strlen((str))) +#define ZEND_PUTS_EX(str) write_func((str), strlen((str))) +#define ZEND_PUTC(c) zend_write(&(c), 1) + +BEGIN_EXTERN_C() +extern ZEND_API size_t (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2); +extern ZEND_API zend_write_func_t zend_write; +extern ZEND_API FILE *(*zend_fopen)(zend_string *filename, zend_string **opened_path); +extern ZEND_API void (*zend_ticks_function)(int ticks); +extern ZEND_API void (*zend_interrupt_function)(zend_execute_data *execute_data); +extern ZEND_API void (*zend_error_cb)(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message); +extern ZEND_API void (*zend_on_timeout)(int seconds); +extern ZEND_API zend_result (*zend_stream_open_function)(zend_file_handle *handle); +extern void (*zend_printf_to_smart_string)(smart_string *buf, const char *format, va_list ap); +extern void (*zend_printf_to_smart_str)(smart_str *buf, const char *format, va_list ap); +extern ZEND_API char *(*zend_getenv)(const char *name, size_t name_len); +extern ZEND_API zend_string *(*zend_resolve_path)(zend_string *filename); + +/* These two callbacks are especially for opcache */ +extern ZEND_API zend_result (*zend_post_startup_cb)(void); +extern ZEND_API void (*zend_post_shutdown_cb)(void); + +ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); +ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); +/* For custom format specifiers like H */ +ZEND_API ZEND_COLD void zend_error_unchecked(int type, const char *format, ...); +/* If filename is NULL the default filename is used. */ +ZEND_API ZEND_COLD void zend_error_at(int type, zend_string *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5); +ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(int type, zend_string *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5); +ZEND_API ZEND_COLD void zend_error_zstr(int type, zend_string *message); +ZEND_API ZEND_COLD void zend_error_zstr_at(int type, zend_string *filename, uint32_t lineno, zend_string *message); + +ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); +ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); +ZEND_API ZEND_COLD void zend_argument_count_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); +ZEND_API ZEND_COLD void zend_value_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); +/* type should be one of the BP_VAR_* constants, only special messages happen for isset/empty and unset */ +ZEND_API ZEND_COLD void zend_illegal_container_offset(const zend_string *container, const zval *offset, int type); + +ZEND_COLD void zenderror(const char *error); + +/* For internal C errors */ +ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn(int type, int errn, const char *message); + +/* The following #define is used for code duality in PHP for Engine 1 & 2 */ +#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def +extern ZEND_API zend_class_entry *zend_standard_class_def; +extern ZEND_API zend_utility_values zend_uv; + +/* If DTrace is available and enabled */ +extern ZEND_API bool zend_dtrace_enabled; +END_EXTERN_C() + +#define ZEND_UV(name) (zend_uv.name) + +BEGIN_EXTERN_C() +ZEND_API void zend_message_dispatcher(zend_long message, const void *data); + +ZEND_API zval *zend_get_configuration_directive(zend_string *name); +END_EXTERN_C() + +/* Messages for applications of Zend */ +#define ZMSG_FAILED_INCLUDE_FOPEN 1L +#define ZMSG_FAILED_REQUIRE_FOPEN 2L +#define ZMSG_FAILED_HIGHLIGHT_FOPEN 3L +#define ZMSG_MEMORY_LEAK_DETECTED 4L +#define ZMSG_MEMORY_LEAK_REPEATED 5L +#define ZMSG_LOG_SCRIPT_NAME 6L +#define ZMSG_MEMORY_LEAKS_GRAND_TOTAL 7L + +typedef enum { + EH_NORMAL = 0, + EH_THROW +} zend_error_handling_t; + +typedef struct { + zend_error_handling_t handling; + zend_class_entry *exception; +} zend_error_handling; + +BEGIN_EXTERN_C() +ZEND_API void zend_save_error_handling(zend_error_handling *current); +ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current); +ZEND_API void zend_restore_error_handling(zend_error_handling *saved); +ZEND_API void zend_begin_record_errors(void); +ZEND_API void zend_emit_recorded_errors(void); +ZEND_API void zend_free_recorded_errors(void); +END_EXTERN_C() + +#define DEBUG_BACKTRACE_PROVIDE_OBJECT (1<<0) +#define DEBUG_BACKTRACE_IGNORE_ARGS (1<<1) + +#include "zend_object_handlers.h" +#include "zend_operators.h" + +#endif /* ZEND_H */ diff --git a/include/php/Zend/zend_API.h b/include/php/Zend/zend_API.h new file mode 100644 index 0000000..acdc5b0 --- /dev/null +++ b/include/php/Zend/zend_API.h @@ -0,0 +1,2534 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Andrei Zmievski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_API_H +#define ZEND_API_H + +#include "zend_modules.h" +#include "zend_list.h" +#include "zend_operators.h" +#include "zend_variables.h" +#include "zend_execute.h" +#include "zend_type_info.h" + + +BEGIN_EXTERN_C() + +typedef struct _zend_function_entry { + const char *fname; + zif_handler handler; + const struct _zend_internal_arg_info *arg_info; + uint32_t num_args; + uint32_t flags; +} zend_function_entry; + +typedef struct _zend_fcall_info { + size_t size; + zval function_name; + zval *retval; + zval *params; + zend_object *object; + uint32_t param_count; + /* This hashtable can also contain positional arguments (with integer keys), + * which will be appended to the normal params[]. This makes it easier to + * integrate APIs like call_user_func_array(). The usual restriction that + * there may not be position arguments after named arguments applies. */ + HashTable *named_params; +} zend_fcall_info; + +typedef struct _zend_fcall_info_cache { + zend_function *function_handler; + zend_class_entry *calling_scope; + zend_class_entry *called_scope; + zend_object *object; /* Instance of object for method calls */ + zend_object *closure; /* Closure reference, only if the callable *is* the object */ +} zend_fcall_info_cache; + +#define ZEND_NS_NAME(ns, name) ns "\\" name + +/* ZEND_FN/ZEND_MN are inlined below to prevent pre-scan macro expansion, + * which causes issues if the function name is also a macro name. */ +#define ZEND_FN(name) zif_##name +#define ZEND_MN(name) zim_##name + +#define ZEND_NAMED_FUNCTION(name) void ZEND_FASTCALL name(INTERNAL_FUNCTION_PARAMETERS) +#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(zif_##name) +#define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(zim_##classname##_##name) + +#define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags }, + +#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags }, + +/* Same as ZEND_NAMED_FE */ +#define ZEND_RAW_NAMED_FE(zend_name, name, arg_info) ZEND_RAW_FENTRY(#zend_name, name, arg_info, 0) + +#define ZEND_NAMED_FE(zend_name, name, arg_info) ZEND_RAW_FENTRY(#zend_name, name, arg_info, 0) +#define ZEND_FE(name, arg_info) ZEND_RAW_FENTRY(#name, zif_##name, arg_info, 0) +#define ZEND_DEP_FE(name, arg_info) ZEND_RAW_FENTRY(#name, zif_##name, arg_info, ZEND_ACC_DEPRECATED) +#define ZEND_FALIAS(name, alias, arg_info) ZEND_RAW_FENTRY(#name, zif_##alias, arg_info, 0) +#define ZEND_DEP_FALIAS(name, alias, arg_info) ZEND_RAW_FENTRY(#name, zif_##alias, arg_info, ZEND_ACC_DEPRECATED) +#define ZEND_NAMED_ME(zend_name, name, arg_info, flags) ZEND_FENTRY(zend_name, name, arg_info, flags) +#define ZEND_ME(classname, name, arg_info, flags) ZEND_RAW_FENTRY(#name, zim_##classname##_##name, arg_info, flags) +#define ZEND_DEP_ME(classname, name, arg_info, flags) ZEND_RAW_FENTRY(#name, zim_##classname##_##name, arg_info, flags | ZEND_ACC_DEPRECATED) +#define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_RAW_FENTRY(#name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) +#define ZEND_ABSTRACT_ME_WITH_FLAGS(classname, name, arg_info, flags) ZEND_RAW_FENTRY(#name, NULL, arg_info, flags) +#define ZEND_MALIAS(classname, name, alias, arg_info, flags) ZEND_RAW_FENTRY(#name, zim_##classname##_##alias, arg_info, flags) +#define ZEND_ME_MAPPING(name, func_name, arg_info, flags) ZEND_RAW_FENTRY(#name, zif_##func_name, arg_info, flags) + +#define ZEND_NS_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, #zend_name), name, arg_info, flags) + +#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags) +/** + * Note that if you are asserting that a function is compile-time evaluable, you are asserting that + * + * 1. The function will always have the same result for the same arguments + * 2. The function does not depend on global state such as ini settings or locale (e.g. mb_strtolower), number_format(), etc. + * 3. The function does not have side effects. It is okay if they throw + * or warn on invalid arguments, as we detect this and will discard the evaluation result. + * 4. The function will not take an unreasonable amount of time or memory to compute on code that may be seen in practice. + * (e.g. str_repeat is special cased to check the length instead of using this) + */ +#define ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(name, arg_info) ZEND_RAW_FENTRY(#name, zif_##name, arg_info, ZEND_ACC_COMPILE_TIME_EVAL) + +/* Same as ZEND_NS_NAMED_FE */ +#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0) + +#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0) +#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #name, zif_##name, arg_info, 0) +#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #name, zif_##name, arg_info, ZEND_ACC_DEPRECATED) +#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_RAW_FENTRY(ns, #name, zif_##alias, arg_info, 0) +#define ZEND_NS_DEP_FALIAS(ns, name, alias, arg_info) ZEND_NS_RAW_FENTRY(ns, #name, zif_##alias, arg_info, ZEND_ACC_DEPRECATED) + +#define ZEND_FE_END { NULL, NULL, NULL, 0, 0 } + +#define _ZEND_ARG_INFO_FLAGS(pass_by_ref, is_variadic, is_tentative) \ + (((pass_by_ref) << _ZEND_SEND_MODE_SHIFT) | ((is_variadic) ? _ZEND_IS_VARIADIC_BIT : 0) | ((is_tentative) ? _ZEND_IS_TENTATIVE_BIT : 0)) + +/* Arginfo structures without type information */ +#define ZEND_ARG_INFO(pass_by_ref, name) \ + { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, +#define ZEND_ARG_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, default_value) \ + { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, +#define ZEND_ARG_VARIADIC_INFO(pass_by_ref, name) \ + { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 1, 0)), NULL }, + +/* Arginfo structures with simple type information */ +#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) \ + { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, +#define ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, type_hint, allow_null, default_value) \ + { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, +#define ZEND_ARG_VARIADIC_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) \ + { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 1, 0)), NULL }, + +/* Arginfo structures with complex type information */ +#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ + { #name, ZEND_TYPE_INIT_MASK(type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, +#define ZEND_ARG_OBJ_TYPE_MASK(pass_by_ref, name, class_name, type_mask, default_value) \ + { #name, ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, +#define ZEND_ARG_VARIADIC_OBJ_TYPE_MASK(pass_by_ref, name, class_name, type_mask) \ + { #name, ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 1, 0)), NULL }, + +/* Arginfo structures with object type information */ +#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, class_name, allow_null) \ + { #name, ZEND_TYPE_INIT_CLASS_CONST(#class_name, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, +#define ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, class_name, allow_null, default_value) \ + { #name, ZEND_TYPE_INIT_CLASS_CONST(#class_name, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, +#define ZEND_ARG_VARIADIC_OBJ_INFO(pass_by_ref, name, class_name, allow_null) \ + { #name, ZEND_TYPE_INIT_CLASS_CONST(#class_name, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 1, 0)), NULL }, + +/* Legacy arginfo structures */ +#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) \ + { #name, ZEND_TYPE_INIT_CODE(IS_ARRAY, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, +#define ZEND_ARG_CALLABLE_INFO(pass_by_ref, name, allow_null) \ + { #name, ZEND_TYPE_INIT_CODE(IS_CALLABLE, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, + +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, return_reference, required_num_args, class_name, allow_null, is_tentative_return_type) \ + static const zend_internal_arg_info name[] = { \ + { (const char*)(uintptr_t)(required_num_args), \ + ZEND_TYPE_INIT_CLASS_CONST(#class_name, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL }, + +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, return_reference, required_num_args, class_name, allow_null, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, return_reference, required_num_args, class_name, allow_null, 1) + +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO(name, class_name, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, 0, -1, class_name, allow_null, 0) + +#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX2(name, return_reference, required_num_args, type, is_tentative_return_type) \ + static const zend_internal_arg_info name[] = { \ + { (const char*)(uintptr_t)(required_num_args), ZEND_TYPE_INIT_MASK(type | _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL }, + +#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX2(name, return_reference, required_num_args, type, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX2(name, return_reference, required_num_args, type, 1) + +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX2(name, return_reference, required_num_args, class_name, type, is_tentative_return_type) \ + static const zend_internal_arg_info name[] = { \ + { (const char*)(uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type | _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL }, + +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(name, return_reference, required_num_args, class_name, type) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX2(name, return_reference, required_num_args, class_name, type, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(name, return_reference, required_num_args, class_name, type) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX2(name, return_reference, required_num_args, class_name, type, 1) + +#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, return_reference, required_num_args, type, allow_null, is_tentative_return_type) \ + static const zend_internal_arg_info name[] = { \ + { (const char*)(uintptr_t)(required_num_args), ZEND_TYPE_INIT_CODE(type, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL }, + +#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, return_reference, required_num_args, type, allow_null, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, return_reference, required_num_args, type, allow_null, 1) + +#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(name, type, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, 0, -1, type, allow_null, 0) + +#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) \ + static const zend_internal_arg_info name[] = { \ + { (const char*)(uintptr_t)(required_num_args), ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(return_reference, 0, 0)), NULL }, +#define ZEND_BEGIN_ARG_INFO(name, _unused) \ + ZEND_BEGIN_ARG_INFO_EX(name, {}, ZEND_RETURN_VALUE, -1) +#define ZEND_END_ARG_INFO() }; + +/* Name macros */ +#define ZEND_MODULE_STARTUP_N(module) zm_startup_##module +#define ZEND_MODULE_SHUTDOWN_N(module) zm_shutdown_##module +#define ZEND_MODULE_ACTIVATE_N(module) zm_activate_##module +#define ZEND_MODULE_DEACTIVATE_N(module) zm_deactivate_##module +#define ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module) zm_post_zend_deactivate_##module +#define ZEND_MODULE_INFO_N(module) zm_info_##module +#define ZEND_MODULE_GLOBALS_CTOR_N(module) zm_globals_ctor_##module +#define ZEND_MODULE_GLOBALS_DTOR_N(module) zm_globals_dtor_##module + +/* Declaration macros */ +#define ZEND_MODULE_STARTUP_D(module) zend_result ZEND_MODULE_STARTUP_N(module)(INIT_FUNC_ARGS) +#define ZEND_MODULE_SHUTDOWN_D(module) zend_result ZEND_MODULE_SHUTDOWN_N(module)(SHUTDOWN_FUNC_ARGS) +#define ZEND_MODULE_ACTIVATE_D(module) zend_result ZEND_MODULE_ACTIVATE_N(module)(INIT_FUNC_ARGS) +#define ZEND_MODULE_DEACTIVATE_D(module) zend_result ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS) +#define ZEND_MODULE_POST_ZEND_DEACTIVATE_D(module) zend_result ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module)(void) +#define ZEND_MODULE_INFO_D(module) ZEND_COLD void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS) +#define ZEND_MODULE_GLOBALS_CTOR_D(module) void ZEND_MODULE_GLOBALS_CTOR_N(module)(zend_##module##_globals *module##_globals) +#define ZEND_MODULE_GLOBALS_DTOR_D(module) void ZEND_MODULE_GLOBALS_DTOR_N(module)(zend_##module##_globals *module##_globals) + +#define ZEND_GET_MODULE(name) \ + BEGIN_EXTERN_C()\ + ZEND_DLEXPORT zend_module_entry *get_module(void) { return &name##_module_entry; }\ + END_EXTERN_C() + +#define ZEND_BEGIN_MODULE_GLOBALS(module_name) \ + typedef struct _zend_##module_name##_globals { +#define ZEND_END_MODULE_GLOBALS(module_name) \ + } zend_##module_name##_globals; + +#ifdef ZTS + +#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \ + ts_rsrc_id module_name##_globals_id; +#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \ + extern ts_rsrc_id module_name##_globals_id; +#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \ + ts_allocate_id(&module_name##_globals_id, sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor); +#define ZEND_MODULE_GLOBALS_ACCESSOR(module_name, v) ZEND_TSRMG(module_name##_globals_id, zend_##module_name##_globals *, v) +#ifdef ZEND_ENABLE_STATIC_TSRMLS_CACHE +#define ZEND_MODULE_GLOBALS_BULK(module_name) TSRMG_BULK_STATIC(module_name##_globals_id, zend_##module_name##_globals *) +#else +#define ZEND_MODULE_GLOBALS_BULK(module_name) TSRMG_BULK(module_name##_globals_id, zend_##module_name##_globals *) +#endif + +#else + +#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \ + zend_##module_name##_globals module_name##_globals; +#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \ + extern zend_##module_name##_globals module_name##_globals; +#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \ + globals_ctor(&module_name##_globals); +#define ZEND_MODULE_GLOBALS_ACCESSOR(module_name, v) (module_name##_globals.v) +#define ZEND_MODULE_GLOBALS_BULK(module_name) (&module_name##_globals) + +#endif + +#define INIT_CLASS_ENTRY(class_container, class_name, functions) \ + INIT_CLASS_ENTRY_EX(class_container, class_name, strlen(class_name), functions) + +#define INIT_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions) \ + { \ + memset(&class_container, 0, sizeof(zend_class_entry)); \ + class_container.name = zend_string_init_interned(class_name, class_name_len, 1); \ + class_container.default_object_handlers = &std_object_handlers; \ + class_container.info.internal.builtin_functions = functions; \ + } + +#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions) \ + { \ + class_container.default_object_handlers = &std_object_handlers; \ + class_container.constructor = NULL; \ + class_container.destructor = NULL; \ + class_container.clone = NULL; \ + class_container.serialize = NULL; \ + class_container.unserialize = NULL; \ + class_container.create_object = NULL; \ + class_container.get_static_method = NULL; \ + class_container.__call = NULL; \ + class_container.__callstatic = NULL; \ + class_container.__tostring = NULL; \ + class_container.__get = NULL; \ + class_container.__set = NULL; \ + class_container.__unset = NULL; \ + class_container.__isset = NULL; \ + class_container.__debugInfo = NULL; \ + class_container.__serialize = NULL; \ + class_container.__unserialize = NULL; \ + class_container.parent = NULL; \ + class_container.num_interfaces = 0; \ + class_container.trait_names = NULL; \ + class_container.num_traits = 0; \ + class_container.trait_aliases = NULL; \ + class_container.trait_precedences = NULL; \ + class_container.interfaces = NULL; \ + class_container.get_iterator = NULL; \ + class_container.iterator_funcs_ptr = NULL; \ + class_container.arrayaccess_funcs_ptr = NULL; \ + class_container.info.internal.module = NULL; \ + class_container.info.internal.builtin_functions = functions; \ + } + + +#define INIT_NS_CLASS_ENTRY(class_container, ns, class_name, functions) \ + INIT_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, class_name), functions) + +#define CE_STATIC_MEMBERS(ce) \ + ((zval*)ZEND_MAP_PTR_GET((ce)->static_members_table)) + +#define CE_CONSTANTS_TABLE(ce) \ + zend_class_constants_table(ce) + +#define CE_DEFAULT_PROPERTIES_TABLE(ce) \ + zend_class_default_properties_table(ce) + +#define CE_BACKED_ENUM_TABLE(ce) \ + zend_class_backed_enum_table(ce) + +#define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0) +#define ZEND_FCC_INITIALIZED(fcc) ((fcc).function_handler != NULL) + +ZEND_API int zend_next_free_module(void); + +BEGIN_EXTERN_C() +ZEND_API zend_result zend_get_parameters_array_ex(uint32_t param_count, zval *argument_array); + +/* internal function to efficiently copy parameters when executing __call() */ +ZEND_API zend_result zend_copy_parameters_array(uint32_t param_count, zval *argument_array); + +#define zend_get_parameters_array(ht, param_count, argument_array) \ + zend_get_parameters_array_ex(param_count, argument_array) +#define zend_parse_parameters_none() \ + (EXPECTED(ZEND_NUM_ARGS() == 0) ? SUCCESS : (zend_wrong_parameters_none_error(), FAILURE)) +#define zend_parse_parameters_none_throw() \ + zend_parse_parameters_none() + +/* Parameter parsing API -- andrei */ + +#define ZEND_PARSE_PARAMS_THROW 0 /* No longer used, zpp always uses exceptions */ +#define ZEND_PARSE_PARAMS_QUIET (1<<1) +ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec, ...); +ZEND_API zend_result zend_parse_parameters_ex(int flags, uint32_t num_args, const char *type_spec, ...); +/* NOTE: This must have at least one value in __VA_ARGS__ for the expression to be valid */ +#define zend_parse_parameters_throw(num_args, ...) \ + zend_parse_parameters(num_args, __VA_ARGS__) +ZEND_API const char *zend_zval_type_name(const zval *arg); +ZEND_API const char *zend_zval_value_name(const zval *arg); +ZEND_API zend_string *zend_zval_get_legacy_type(const zval *arg); + +ZEND_API zend_result zend_parse_method_parameters(uint32_t num_args, zval *this_ptr, const char *type_spec, ...); +ZEND_API zend_result zend_parse_method_parameters_ex(int flags, uint32_t num_args, zval *this_ptr, const char *type_spec, ...); + +ZEND_API zend_result zend_parse_parameter(int flags, uint32_t arg_num, zval *arg, const char *spec, ...); + +/* End of parameter parsing API -- andrei */ + +ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type); +ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table); +ZEND_API zend_result zend_startup_module(zend_module_entry *module_entry); +ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry); +ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module); +ZEND_API zend_result zend_startup_module_ex(zend_module_entry *module); +ZEND_API void zend_startup_modules(void); +ZEND_API void zend_collect_module_handlers(void); +ZEND_API void zend_destroy_modules(void); +ZEND_API void zend_check_magic_method_implementation( + const zend_class_entry *ce, const zend_function *fptr, zend_string *lcname, int error_type); +ZEND_API void zend_add_magic_method(zend_class_entry *ce, zend_function *fptr, zend_string *lcname); + +ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry); +ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce); +ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry); +ZEND_API void zend_class_implements(zend_class_entry *class_entry, int num_interfaces, ...); + +ZEND_API zend_result zend_register_class_alias_ex(const char *name, size_t name_len, zend_class_entry *ce, bool persistent); + +static zend_always_inline zend_result zend_register_class_alias(const char *name, zend_class_entry *ce) { + return zend_register_class_alias_ex(name, strlen(name), ce, 1); +} +#define zend_register_ns_class_alias(ns, name, ce) \ + zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce, 1) + +ZEND_API void zend_disable_functions(const char *function_list); +ZEND_API zend_result zend_disable_class(const char *class_name, size_t class_name_length); + +ZEND_API ZEND_COLD void zend_wrong_param_count(void); +ZEND_API ZEND_COLD void zend_wrong_property_read(zval *object, zval *property); + +#define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0) +#define IS_CALLABLE_SUPPRESS_DEPRECATIONS (1<<1) + +ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc); +ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *object); +ZEND_API zend_string *zend_get_callable_name(zval *callable); +ZEND_API bool zend_is_callable_at_frame( + zval *callable, zend_object *object, zend_execute_data *frame, + uint32_t check_flags, zend_fcall_info_cache *fcc, char **error); +ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error); +ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name); +ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name); +ZEND_API const char *zend_get_module_version(const char *module_name); +ZEND_API zend_result zend_get_module_started(const char *module_name); + +ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment, zend_type type); + +ZEND_API void zend_declare_property_ex(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment); +ZEND_API void zend_declare_property(zend_class_entry *ce, const char *name, size_t name_length, zval *property, int access_type); +ZEND_API void zend_declare_property_null(zend_class_entry *ce, const char *name, size_t name_length, int access_type); +ZEND_API void zend_declare_property_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type); +ZEND_API void zend_declare_property_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type); +ZEND_API void zend_declare_property_double(zend_class_entry *ce, const char *name, size_t name_length, double value, int access_type); +ZEND_API void zend_declare_property_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value, int access_type); +ZEND_API void zend_declare_property_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_len, int access_type); + +ZEND_API zend_class_constant *zend_declare_typed_class_constant(zend_class_entry *ce, zend_string *name, zval *value, int access_type, zend_string *doc_comment, zend_type type); +ZEND_API zend_class_constant *zend_declare_class_constant_ex(zend_class_entry *ce, zend_string *name, zval *value, int access_type, zend_string *doc_comment); +ZEND_API void zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value); +ZEND_API void zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length); +ZEND_API void zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value); +ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, bool value); +ZEND_API void zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value); +ZEND_API void zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length); +ZEND_API void zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value); + +ZEND_API zend_result zend_update_class_constant(zend_class_constant *c, const zend_string *name, zend_class_entry *scope); +ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type); +ZEND_API HashTable *zend_separate_class_constants_table(zend_class_entry *class_type); + +static zend_always_inline HashTable *zend_class_constants_table(zend_class_entry *ce) { + if ((ce->ce_flags & ZEND_ACC_HAS_AST_CONSTANTS) && ZEND_MAP_PTR(ce->mutable_data)) { + zend_class_mutable_data *mutable_data = + (zend_class_mutable_data*)ZEND_MAP_PTR_GET_IMM(ce->mutable_data); + if (mutable_data && mutable_data->constants_table) { + return mutable_data->constants_table; + } else { + return zend_separate_class_constants_table(ce); + } + } else { + return &ce->constants_table; + } +} + +static zend_always_inline zval *zend_class_default_properties_table(zend_class_entry *ce) { + if ((ce->ce_flags & ZEND_ACC_HAS_AST_PROPERTIES) && ZEND_MAP_PTR(ce->mutable_data)) { + zend_class_mutable_data *mutable_data = + (zend_class_mutable_data*)ZEND_MAP_PTR_GET_IMM(ce->mutable_data); + return mutable_data->default_properties_table; + } else { + return ce->default_properties_table; + } +} + +static zend_always_inline void zend_class_set_backed_enum_table(zend_class_entry *ce, HashTable *backed_enum_table) +{ + if (ZEND_MAP_PTR(ce->mutable_data) && ce->type == ZEND_USER_CLASS) { + zend_class_mutable_data *mutable_data = (zend_class_mutable_data*)ZEND_MAP_PTR_GET_IMM(ce->mutable_data); + mutable_data->backed_enum_table = backed_enum_table; + } else { + ce->backed_enum_table = backed_enum_table; + } +} + +static zend_always_inline HashTable *zend_class_backed_enum_table(zend_class_entry *ce) +{ + if (ZEND_MAP_PTR(ce->mutable_data) && ce->type == ZEND_USER_CLASS) { + zend_class_mutable_data *mutable_data = (zend_class_mutable_data*)ZEND_MAP_PTR_GET_IMM(ce->mutable_data); + return mutable_data->backed_enum_table; + } else { + return ce->backed_enum_table; + } +} + +ZEND_API void zend_update_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zval *value); +ZEND_API void zend_update_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zval *value); +ZEND_API void zend_update_property_null(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length); +ZEND_API void zend_update_property_bool(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value); +ZEND_API void zend_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value); +ZEND_API void zend_update_property_double(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, double value); +ZEND_API void zend_update_property_str(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_string *value); +ZEND_API void zend_update_property_string(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value); +ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value, size_t value_length); +ZEND_API void zend_unset_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length); + +ZEND_API zend_result zend_update_static_property_ex(zend_class_entry *scope, zend_string *name, zval *value); +ZEND_API zend_result zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value); +ZEND_API zend_result zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length); +ZEND_API zend_result zend_update_static_property_bool(zend_class_entry *scope, const char *name, size_t name_length, zend_long value); +ZEND_API zend_result zend_update_static_property_long(zend_class_entry *scope, const char *name, size_t name_length, zend_long value); +ZEND_API zend_result zend_update_static_property_double(zend_class_entry *scope, const char *name, size_t name_length, double value); +ZEND_API zend_result zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value); +ZEND_API zend_result zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_length); + +ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv); +ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv); + +ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, bool silent); +ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, bool silent); + +ZEND_API const char *zend_get_type_by_const(int type); + +#define ZEND_THIS (&EX(This)) + +#define getThis() ((Z_TYPE_P(ZEND_THIS) == IS_OBJECT) ? ZEND_THIS : NULL) +#define ZEND_IS_METHOD_CALL() (EX(func)->common.scope != NULL) + +#define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT() +#define ZEND_NUM_ARGS() EX_NUM_ARGS() +#define ZEND_WRONG_PARAM_COUNT() { zend_wrong_param_count(); return; } + +#ifndef ZEND_WIN32 +#define DLEXPORT +#endif + +#define array_init(arg) ZVAL_ARR((arg), zend_new_array(0)) +#define array_init_size(arg, size) ZVAL_ARR((arg), zend_new_array(size)) +ZEND_API void object_init(zval *arg); +ZEND_API zend_result object_init_ex(zval *arg, zend_class_entry *ce); +ZEND_API zend_result object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties); +ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type); +ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties); +ZEND_API void object_properties_load(zend_object *object, HashTable *properties); + +ZEND_API void zend_merge_properties(zval *obj, HashTable *properties); + +ZEND_API void add_assoc_long_ex(zval *arg, const char *key, size_t key_len, zend_long n); +ZEND_API void add_assoc_null_ex(zval *arg, const char *key, size_t key_len); +ZEND_API void add_assoc_bool_ex(zval *arg, const char *key, size_t key_len, bool b); +ZEND_API void add_assoc_resource_ex(zval *arg, const char *key, size_t key_len, zend_resource *r); +ZEND_API void add_assoc_double_ex(zval *arg, const char *key, size_t key_len, double d); +ZEND_API void add_assoc_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str); +ZEND_API void add_assoc_string_ex(zval *arg, const char *key, size_t key_len, const char *str); +ZEND_API void add_assoc_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length); +ZEND_API void add_assoc_array_ex(zval *arg, const char *key, size_t key_len, zend_array *arr); +ZEND_API void add_assoc_object_ex(zval *arg, const char *key, size_t key_len, zend_object *obj); +ZEND_API void add_assoc_reference_ex(zval *arg, const char *key, size_t key_len, zend_reference *ref); +ZEND_API void add_assoc_zval_ex(zval *arg, const char *key, size_t key_len, zval *value); + +static zend_always_inline void add_assoc_long(zval *arg, const char *key, zend_long n) { + add_assoc_long_ex(arg, key, strlen(key), n); +} +static zend_always_inline void add_assoc_null(zval *arg, const char *key) { + add_assoc_null_ex(arg, key, strlen(key)); +} +static zend_always_inline void add_assoc_bool(zval *arg, const char *key, bool b) { + add_assoc_bool_ex(arg, key, strlen(key), b); +} +static zend_always_inline void add_assoc_resource(zval *arg, const char *key, zend_resource *r) { + add_assoc_resource_ex(arg, key, strlen(key), r); +} +static zend_always_inline void add_assoc_double(zval *arg, const char *key, double d) { + add_assoc_double_ex(arg, key, strlen(key), d); +} +static zend_always_inline void add_assoc_str(zval *arg, const char *key, zend_string *str) { + add_assoc_str_ex(arg, key, strlen(key), str); +} +static zend_always_inline void add_assoc_string(zval *arg, const char *key, const char *str) { + add_assoc_string_ex(arg, key, strlen(key), str); +} +static zend_always_inline void add_assoc_stringl(zval *arg, const char *key, const char *str, size_t length) { + add_assoc_stringl_ex(arg, key, strlen(key), str, length); +} +static zend_always_inline void add_assoc_array(zval *arg, const char *key, zend_array *arr) { + add_assoc_array_ex(arg, key, strlen(key), arr); +} +static zend_always_inline void add_assoc_object(zval *arg, const char *key, zend_object *obj) { + add_assoc_object_ex(arg, key, strlen(key), obj); +} +static zend_always_inline void add_assoc_reference(zval *arg, const char *key, zend_reference *ref) { + add_assoc_reference_ex(arg, key, strlen(key), ref); +} +static zend_always_inline void add_assoc_zval(zval *arg, const char *key, zval *value) { + add_assoc_zval_ex(arg, key, strlen(key), value); +} + +ZEND_API void add_index_long(zval *arg, zend_ulong index, zend_long n); +ZEND_API void add_index_null(zval *arg, zend_ulong index); +ZEND_API void add_index_bool(zval *arg, zend_ulong index, bool b); +ZEND_API void add_index_resource(zval *arg, zend_ulong index, zend_resource *r); +ZEND_API void add_index_double(zval *arg, zend_ulong index, double d); +ZEND_API void add_index_str(zval *arg, zend_ulong index, zend_string *str); +ZEND_API void add_index_string(zval *arg, zend_ulong index, const char *str); +ZEND_API void add_index_stringl(zval *arg, zend_ulong index, const char *str, size_t length); +ZEND_API void add_index_array(zval *arg, zend_ulong index, zend_array *arr); +ZEND_API void add_index_object(zval *arg, zend_ulong index, zend_object *obj); +ZEND_API void add_index_reference(zval *arg, zend_ulong index, zend_reference *ref); + +static zend_always_inline zend_result add_index_zval(zval *arg, zend_ulong index, zval *value) +{ + return zend_hash_index_update(Z_ARRVAL_P(arg), index, value) ? SUCCESS : FAILURE; +} + +ZEND_API zend_result add_next_index_long(zval *arg, zend_long n); +ZEND_API zend_result add_next_index_null(zval *arg); +ZEND_API zend_result add_next_index_bool(zval *arg, bool b); +ZEND_API zend_result add_next_index_resource(zval *arg, zend_resource *r); +ZEND_API zend_result add_next_index_double(zval *arg, double d); +ZEND_API zend_result add_next_index_str(zval *arg, zend_string *str); +ZEND_API zend_result add_next_index_string(zval *arg, const char *str); +ZEND_API zend_result add_next_index_stringl(zval *arg, const char *str, size_t length); +ZEND_API zend_result add_next_index_array(zval *arg, zend_array *arr); +ZEND_API zend_result add_next_index_object(zval *arg, zend_object *obj); +ZEND_API zend_result add_next_index_reference(zval *arg, zend_reference *ref); + +static zend_always_inline zend_result add_next_index_zval(zval *arg, zval *value) +{ + return zend_hash_next_index_insert(Z_ARRVAL_P(arg), value) ? SUCCESS : FAILURE; +} + +ZEND_API zend_result array_set_zval_key(HashTable *ht, zval *key, zval *value); + +ZEND_API void add_property_long_ex(zval *arg, const char *key, size_t key_len, zend_long l); +ZEND_API void add_property_null_ex(zval *arg, const char *key, size_t key_len); +ZEND_API void add_property_bool_ex(zval *arg, const char *key, size_t key_len, zend_long b); +ZEND_API void add_property_resource_ex(zval *arg, const char *key, size_t key_len, zend_resource *r); +ZEND_API void add_property_double_ex(zval *arg, const char *key, size_t key_len, double d); +ZEND_API void add_property_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str); +ZEND_API void add_property_string_ex(zval *arg, const char *key, size_t key_len, const char *str); +ZEND_API void add_property_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length); +ZEND_API void add_property_array_ex(zval *arg, const char *key, size_t key_len, zend_array *arr); +ZEND_API void add_property_object_ex(zval *arg, const char *key, size_t key_len, zend_object *obj); +ZEND_API void add_property_reference_ex(zval *arg, const char *key, size_t key_len, zend_reference *ref); +ZEND_API void add_property_zval_ex(zval *arg, const char *key, size_t key_len, zval *value); + +static zend_always_inline void add_property_long(zval *arg, const char *key, zend_long n) { + add_property_long_ex(arg, key, strlen(key), n); +} +static zend_always_inline void add_property_null(zval *arg, const char *key) { + add_property_null_ex(arg, key, strlen(key)); +} +static zend_always_inline void add_property_bool(zval *arg, const char *key, bool b) { + add_property_bool_ex(arg, key, strlen(key), b); +} +static zend_always_inline void add_property_resource(zval *arg, const char *key, zend_resource *r) { + add_property_resource_ex(arg, key, strlen(key), r); +} +static zend_always_inline void add_property_double(zval *arg, const char *key, double d) { + add_property_double_ex(arg, key, strlen(key), d); +} +static zend_always_inline void add_property_str(zval *arg, const char *key, zend_string *str) { + add_property_str_ex(arg, key, strlen(key), str); +} +static zend_always_inline void add_property_string(zval *arg, const char *key, const char *str) { + add_property_string_ex(arg, key, strlen(key), str); +} +static zend_always_inline void add_property_stringl(zval *arg, const char *key, const char *str, size_t length) { + add_property_stringl_ex(arg, key, strlen(key), str, length); +} +static zend_always_inline void add_property_array(zval *arg, const char *key, zend_array *arr) { + add_property_array_ex(arg, key, strlen(key), arr); +} +static zend_always_inline void add_property_object(zval *arg, const char *key, zend_object *obj) { + add_property_object_ex(arg, key, strlen(key), obj); +} +static zend_always_inline void add_property_reference(zval *arg, const char *key, zend_reference *ref) { + add_property_reference_ex(arg, key, strlen(key), ref); +} +static zend_always_inline void add_property_zval(zval *arg, const char *key, zval *value) { + add_property_zval_ex(arg, key, strlen(key), value); +} + +ZEND_API zend_result _call_user_function_impl(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], HashTable *named_params); + +#define call_user_function(function_table, object, function_name, retval_ptr, param_count, params) \ + _call_user_function_impl(object, function_name, retval_ptr, param_count, params, NULL) + +#define call_user_function_named(function_table, object, function_name, retval_ptr, param_count, params, named_params) \ + _call_user_function_impl(object, function_name, retval_ptr, param_count, params, named_params) + +ZEND_API extern const zend_fcall_info empty_fcall_info; +ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache; + +/** Build zend_call_info/cache from a zval* + * + * Caller is responsible to provide a return value (fci->retval), otherwise the we will crash. + * In order to pass parameters the following members need to be set: + * fci->param_count = 0; + * fci->params = NULL; + * The callable_name argument may be NULL. + */ +ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error); + +/** Clear arguments connected with zend_fcall_info *fci + * If free_mem is not zero then the params array gets free'd as well + */ +ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, bool free_mem); + +/** Save current arguments from zend_fcall_info *fci + * params array will be set to NULL + */ +ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, uint32_t *param_count, zval **params); + +/** Free arguments connected with zend_fcall_info *fci and set back saved ones. + */ +ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_count, zval *params); + +/** Set or clear the arguments in the zend_call_info struct taking care of + * refcount. If args is NULL and arguments are set then those are cleared. + */ +ZEND_API zend_result zend_fcall_info_args(zend_fcall_info *fci, zval *args); +ZEND_API zend_result zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args); + +/** Set arguments in the zend_fcall_info struct taking care of refcount. + * If argc is 0 the arguments which are set will be cleared, else pass + * a variable amount of zval** arguments. + */ +ZEND_API void zend_fcall_info_argp(zend_fcall_info *fci, uint32_t argc, zval *argv); + +/** Set arguments in the zend_fcall_info struct taking care of refcount. + * If argc is 0 the arguments which are set will be cleared, else pass + * a variable amount of zval** arguments. + */ +ZEND_API void zend_fcall_info_argv(zend_fcall_info *fci, uint32_t argc, va_list *argv); + +/** Set arguments in the zend_fcall_info struct taking care of refcount. + * If argc is 0 the arguments which are set will be cleared, else pass + * a variable amount of zval** arguments. + */ +ZEND_API void zend_fcall_info_argn(zend_fcall_info *fci, uint32_t argc, ...); + +/** Call a function using information created by zend_fcall_info_init()/args(). + * If args is given then those replace the argument info in fci is temporarily. + */ +ZEND_API zend_result zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *retval, zval *args); + +/* Zend FCC API to store and handle PHP userland functions */ +static zend_always_inline bool zend_fcc_equals(const zend_fcall_info_cache* a, const zend_fcall_info_cache* b) +{ + if (UNEXPECTED((a->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) && + (b->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE))) { + return a->object == b->object + && a->calling_scope == b->calling_scope + && a->closure == b->closure + && zend_string_equals(a->function_handler->common.function_name, b->function_handler->common.function_name) + ; + } + return a->function_handler == b->function_handler + && a->object == b->object + && a->calling_scope == b->calling_scope + && a->closure == b->closure + ; +} + +static zend_always_inline void zend_fcc_addref(zend_fcall_info_cache *fcc) +{ + ZEND_ASSERT(ZEND_FCC_INITIALIZED(*fcc) && "FCC Not initialized, possibly refetch trampoline freed by ZPP?"); + /* If the cached trampoline is set, free it */ + if (UNEXPECTED(fcc->function_handler == &EG(trampoline))) { + zend_function *copy = (zend_function*)emalloc(sizeof(zend_function)); + + memcpy(copy, fcc->function_handler, sizeof(zend_function)); + fcc->function_handler->common.function_name = NULL; + fcc->function_handler = copy; + } + if (fcc->object) { + GC_ADDREF(fcc->object); + } + if (fcc->closure) { + GC_ADDREF(fcc->closure); + } +} + +static zend_always_inline void zend_fcc_dup(/* restrict */ zend_fcall_info_cache *dest, const zend_fcall_info_cache *src) +{ + memcpy(dest, src, sizeof(zend_fcall_info_cache)); + zend_fcc_addref(dest); +} + +static zend_always_inline void zend_fcc_dtor(zend_fcall_info_cache *fcc) +{ + ZEND_ASSERT(fcc->function_handler); + if (fcc->object) { + OBJ_RELEASE(fcc->object); + } + /* Need to free potential trampoline (__call/__callStatic) copied function handler before releasing the closure */ + zend_release_fcall_info_cache(fcc); + if (fcc->closure) { + OBJ_RELEASE(fcc->closure); + } + memcpy(fcc, &empty_fcall_info_cache, sizeof(zend_fcall_info_cache)); +} + +ZEND_API void zend_get_callable_zval_from_fcc(const zend_fcall_info_cache *fcc, zval *callable); + +/* Moved out of zend_gc.h because zend_fcall_info_cache is an unknown type in that header */ +static zend_always_inline void zend_get_gc_buffer_add_fcc(zend_get_gc_buffer *gc_buffer, zend_fcall_info_cache *fcc) +{ + ZEND_ASSERT(ZEND_FCC_INITIALIZED(*fcc)); + if (fcc->object) { + zend_get_gc_buffer_add_obj(gc_buffer, fcc->object); + } + if (fcc->closure) { + zend_get_gc_buffer_add_obj(gc_buffer, fcc->closure); + } +} + +/* Can only return FAILURE if EG(active) is false during late engine shutdown. + * If the call or call setup throws, EG(exception) will be set and the retval + * will be UNDEF. Otherwise, the retval will be a non-UNDEF value. */ +ZEND_API zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache); + +/* Call the FCI/FCC pair while setting the call return value to the passed zval*. */ +static zend_always_inline zend_result zend_call_function_with_return_value( + zend_fcall_info *fci, zend_fcall_info_cache *fci_cache, zval *retval) +{ + ZEND_ASSERT(retval && "Use zend_call_function() directly if not providing a retval"); + fci->retval = retval; + return zend_call_function(fci, fci_cache); +} + +/* Call the provided zend_function with the given params. + * If retval_ptr is NULL, the return value is discarded. + * If object is NULL, this must be a free function or static call. + * called_scope must be provided for instance and static method calls. */ +ZEND_API void zend_call_known_function( + zend_function *fn, zend_object *object, zend_class_entry *called_scope, zval *retval_ptr, + uint32_t param_count, zval *params, HashTable *named_params); + +static zend_always_inline void zend_call_known_fcc( + zend_fcall_info_cache *fcc, zval *retval_ptr, uint32_t param_count, zval *params, HashTable *named_params) +{ + zend_function *func = fcc->function_handler; + /* Need to copy trampolines as they get released after they are called */ + if (UNEXPECTED(func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + func = (zend_function*) emalloc(sizeof(zend_function)); + memcpy(func, fcc->function_handler, sizeof(zend_function)); + zend_string_addref(func->op_array.function_name); + } + zend_call_known_function(func, fcc->object, fcc->called_scope, retval_ptr, param_count, params, named_params); +} + +/* Call the provided zend_function instance method on an object. */ +static zend_always_inline void zend_call_known_instance_method( + zend_function *fn, zend_object *object, zval *retval_ptr, + uint32_t param_count, zval *params) +{ + zend_call_known_function(fn, object, object->ce, retval_ptr, param_count, params, NULL); +} + +static zend_always_inline void zend_call_known_instance_method_with_0_params( + zend_function *fn, zend_object *object, zval *retval_ptr) +{ + zend_call_known_instance_method(fn, object, retval_ptr, 0, NULL); +} + +static zend_always_inline void zend_call_known_instance_method_with_1_params( + zend_function *fn, zend_object *object, zval *retval_ptr, zval *param) +{ + zend_call_known_instance_method(fn, object, retval_ptr, 1, param); +} + +ZEND_API void zend_call_known_instance_method_with_2_params( + zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2); + +/* Call method if it exists. Return FAILURE if method does not exist or call failed. + * If FAILURE is returned, retval will be UNDEF. As such, destroying retval unconditionally + * is legal. */ +ZEND_API zend_result zend_call_method_if_exists( + zend_object *object, zend_string *method_name, zval *retval, + uint32_t param_count, zval *params); + +ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...); + +ZEND_API zend_result zend_delete_global_variable(zend_string *name); + +ZEND_API zend_array *zend_rebuild_symbol_table(void); +ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data); +ZEND_API void zend_detach_symbol_table(zend_execute_data *execute_data); +ZEND_API zend_result zend_set_local_var(zend_string *name, zval *value, bool force); +ZEND_API zend_result zend_set_local_var_str(const char *name, size_t len, zval *value, bool force); + +static zend_always_inline zend_result zend_forbid_dynamic_call(void) +{ + zend_execute_data *ex = EG(current_execute_data); + ZEND_ASSERT(ex != NULL && ex->func != NULL); + + if (ZEND_CALL_INFO(ex) & ZEND_CALL_DYNAMIC) { + zend_string *function_or_method_name = get_active_function_or_method_name(); + zend_throw_error(NULL, "Cannot call %.*s() dynamically", + (int) ZSTR_LEN(function_or_method_name), ZSTR_VAL(function_or_method_name)); + zend_string_release(function_or_method_name); + return FAILURE; + } + + return SUCCESS; +} + +ZEND_API ZEND_COLD const char *zend_get_object_type_case(const zend_class_entry *ce, bool upper_case); + +static zend_always_inline const char *zend_get_object_type(const zend_class_entry *ce) +{ + return zend_get_object_type_case(ce, false); +} + +static zend_always_inline const char *zend_get_object_type_uc(const zend_class_entry *ce) +{ + return zend_get_object_type_case(ce, true); +} + +ZEND_API bool zend_is_iterable(const zval *iterable); + +ZEND_API bool zend_is_countable(const zval *countable); + +ZEND_API zend_result zend_get_default_from_internal_arg_info( + zval *default_value_zval, zend_internal_arg_info *arg_info); + +END_EXTERN_C() + +#if ZEND_DEBUG +#define CHECK_ZVAL_STRING(str) \ + ZEND_ASSERT(ZSTR_VAL(str)[ZSTR_LEN(str)] == '\0' && "String is not null-terminated"); +#else +#define CHECK_ZVAL_STRING(z) +#endif + +static zend_always_inline bool zend_str_has_nul_byte(const zend_string *str) +{ + return ZSTR_LEN(str) != strlen(ZSTR_VAL(str)); +} +static zend_always_inline bool zend_char_has_nul_byte(const char *s, size_t known_length) +{ + return known_length != strlen(s); +} + +/* Compatibility with PHP 8.1 and below */ +#define CHECK_ZVAL_NULL_PATH(p) zend_str_has_nul_byte(Z_STR_P(p)) +#define CHECK_NULL_PATH(p, l) zend_char_has_nul_byte(p, l) + +#define ZVAL_STRINGL(z, s, l) do { \ + ZVAL_NEW_STR(z, zend_string_init(s, l, 0)); \ + } while (0) + +#define ZVAL_STRING(z, s) do { \ + const char *_s = (s); \ + ZVAL_STRINGL(z, _s, strlen(_s)); \ + } while (0) + +#define ZVAL_EMPTY_STRING(z) do { \ + ZVAL_INTERNED_STR(z, ZSTR_EMPTY_ALLOC()); \ + } while (0) + +#define ZVAL_PSTRINGL(z, s, l) do { \ + ZVAL_NEW_STR(z, zend_string_init(s, l, 1)); \ + } while (0) + +#define ZVAL_PSTRING(z, s) do { \ + const char *_s = (s); \ + ZVAL_PSTRINGL(z, _s, strlen(_s)); \ + } while (0) + +#define ZVAL_EMPTY_PSTRING(z) do { \ + ZVAL_PSTRINGL(z, "", 0); \ + } while (0) + +#define ZVAL_CHAR(z, c) do { \ + char _c = (c); \ + ZVAL_INTERNED_STR(z, ZSTR_CHAR((zend_uchar) _c)); \ + } while (0) + +#define ZVAL_STRINGL_FAST(z, s, l) do { \ + ZVAL_STR(z, zend_string_init_fast(s, l)); \ + } while (0) + +#define ZVAL_STRING_FAST(z, s) do { \ + const char *_s = (s); \ + ZVAL_STRINGL_FAST(z, _s, strlen(_s)); \ + } while (0) + +#define ZVAL_ZVAL(z, zv, copy, dtor) do { \ + zval *__z = (z); \ + zval *__zv = (zv); \ + if (EXPECTED(!Z_ISREF_P(__zv))) { \ + if (copy && !dtor) { \ + ZVAL_COPY(__z, __zv); \ + } else { \ + ZVAL_COPY_VALUE(__z, __zv); \ + } \ + } else { \ + ZVAL_COPY(__z, Z_REFVAL_P(__zv)); \ + if (dtor || !copy) { \ + zval_ptr_dtor(__zv); \ + } \ + } \ + } while (0) + +#define RETVAL_BOOL(b) ZVAL_BOOL(return_value, b) +#define RETVAL_NULL() ZVAL_NULL(return_value) +#define RETVAL_LONG(l) ZVAL_LONG(return_value, l) +#define RETVAL_DOUBLE(d) ZVAL_DOUBLE(return_value, d) +#define RETVAL_STR(s) ZVAL_STR(return_value, s) +#define RETVAL_INTERNED_STR(s) ZVAL_INTERNED_STR(return_value, s) +#define RETVAL_NEW_STR(s) ZVAL_NEW_STR(return_value, s) +#define RETVAL_STR_COPY(s) ZVAL_STR_COPY(return_value, s) +#define RETVAL_STRING(s) ZVAL_STRING(return_value, s) +#define RETVAL_STRINGL(s, l) ZVAL_STRINGL(return_value, s, l) +#define RETVAL_STRING_FAST(s) ZVAL_STRING_FAST(return_value, s) +#define RETVAL_STRINGL_FAST(s, l) ZVAL_STRINGL_FAST(return_value, s, l) +#define RETVAL_EMPTY_STRING() ZVAL_EMPTY_STRING(return_value) +#define RETVAL_CHAR(c) ZVAL_CHAR(return_value, c) +#define RETVAL_RES(r) ZVAL_RES(return_value, r) +#define RETVAL_ARR(r) ZVAL_ARR(return_value, r) +#define RETVAL_EMPTY_ARRAY() ZVAL_EMPTY_ARRAY(return_value) +#define RETVAL_OBJ(r) ZVAL_OBJ(return_value, r) +#define RETVAL_OBJ_COPY(r) ZVAL_OBJ_COPY(return_value, r) +#define RETVAL_COPY(zv) ZVAL_COPY(return_value, zv) +#define RETVAL_COPY_VALUE(zv) ZVAL_COPY_VALUE(return_value, zv) +#define RETVAL_COPY_DEREF(zv) ZVAL_COPY_DEREF(return_value, zv) +#define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor) +#define RETVAL_FALSE ZVAL_FALSE(return_value) +#define RETVAL_TRUE ZVAL_TRUE(return_value) + +#define RETURN_BOOL(b) do { RETVAL_BOOL(b); return; } while (0) +#define RETURN_NULL() do { RETVAL_NULL(); return;} while (0) +#define RETURN_LONG(l) do { RETVAL_LONG(l); return; } while (0) +#define RETURN_DOUBLE(d) do { RETVAL_DOUBLE(d); return; } while (0) +#define RETURN_STR(s) do { RETVAL_STR(s); return; } while (0) +#define RETURN_INTERNED_STR(s) do { RETVAL_INTERNED_STR(s); return; } while (0) +#define RETURN_NEW_STR(s) do { RETVAL_NEW_STR(s); return; } while (0) +#define RETURN_STR_COPY(s) do { RETVAL_STR_COPY(s); return; } while (0) +#define RETURN_STRING(s) do { RETVAL_STRING(s); return; } while (0) +#define RETURN_STRINGL(s, l) do { RETVAL_STRINGL(s, l); return; } while (0) +#define RETURN_STRING_FAST(s) do { RETVAL_STRING_FAST(s); return; } while (0) +#define RETURN_STRINGL_FAST(s, l) do { RETVAL_STRINGL_FAST(s, l); return; } while (0) +#define RETURN_EMPTY_STRING() do { RETVAL_EMPTY_STRING(); return; } while (0) +#define RETURN_CHAR(c) do { RETVAL_CHAR(c); return; } while (0) +#define RETURN_RES(r) do { RETVAL_RES(r); return; } while (0) +#define RETURN_ARR(r) do { RETVAL_ARR(r); return; } while (0) +#define RETURN_EMPTY_ARRAY() do { RETVAL_EMPTY_ARRAY(); return; } while (0) +#define RETURN_OBJ(r) do { RETVAL_OBJ(r); return; } while (0) +#define RETURN_OBJ_COPY(r) do { RETVAL_OBJ_COPY(r); return; } while (0) +#define RETURN_COPY(zv) do { RETVAL_COPY(zv); return; } while (0) +#define RETURN_COPY_VALUE(zv) do { RETVAL_COPY_VALUE(zv); return; } while (0) +#define RETURN_COPY_DEREF(zv) do { RETVAL_COPY_DEREF(zv); return; } while (0) +#define RETURN_ZVAL(zv, copy, dtor) do { RETVAL_ZVAL(zv, copy, dtor); return; } while (0) +#define RETURN_FALSE do { RETVAL_FALSE; return; } while (0) +#define RETURN_TRUE do { RETVAL_TRUE; return; } while (0) +#define RETURN_THROWS() do { ZEND_ASSERT(EG(exception)); (void) return_value; return; } while (0) + +#define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties(Z_OBJ_P(p)) : NULL))) +#define ZVAL_IS_NULL(z) (Z_TYPE_P(z) == IS_NULL) + +/* For compatibility */ +#define ZEND_MINIT ZEND_MODULE_STARTUP_N +#define ZEND_MSHUTDOWN ZEND_MODULE_SHUTDOWN_N +#define ZEND_RINIT ZEND_MODULE_ACTIVATE_N +#define ZEND_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N +#define ZEND_MINFO ZEND_MODULE_INFO_N +#define ZEND_GINIT(module) ((void (*)(void*))(ZEND_MODULE_GLOBALS_CTOR_N(module))) +#define ZEND_GSHUTDOWN(module) ((void (*)(void*))(ZEND_MODULE_GLOBALS_DTOR_N(module))) + +#define ZEND_MINIT_FUNCTION ZEND_MODULE_STARTUP_D +#define ZEND_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D +#define ZEND_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D +#define ZEND_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D +#define ZEND_MINFO_FUNCTION ZEND_MODULE_INFO_D +#define ZEND_GINIT_FUNCTION ZEND_MODULE_GLOBALS_CTOR_D +#define ZEND_GSHUTDOWN_FUNCTION ZEND_MODULE_GLOBALS_DTOR_D + +/* May modify arg in-place. Will free arg in failure case (and take ownership in success case). + * Prefer using the ZEND_TRY_ASSIGN_* macros over these APIs. */ +ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *zv, bool strict); +ZEND_API zend_result zend_try_assign_typed_ref(zend_reference *ref, zval *zv); + +ZEND_API zend_result zend_try_assign_typed_ref_null(zend_reference *ref); +ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, bool val); +ZEND_API zend_result zend_try_assign_typed_ref_long(zend_reference *ref, zend_long lval); +ZEND_API zend_result zend_try_assign_typed_ref_double(zend_reference *ref, double dval); +ZEND_API zend_result zend_try_assign_typed_ref_empty_string(zend_reference *ref); +ZEND_API zend_result zend_try_assign_typed_ref_str(zend_reference *ref, zend_string *str); +ZEND_API zend_result zend_try_assign_typed_ref_string(zend_reference *ref, const char *string); +ZEND_API zend_result zend_try_assign_typed_ref_stringl(zend_reference *ref, const char *string, size_t len); +ZEND_API zend_result zend_try_assign_typed_ref_arr(zend_reference *ref, zend_array *arr); +ZEND_API zend_result zend_try_assign_typed_ref_res(zend_reference *ref, zend_resource *res); +ZEND_API zend_result zend_try_assign_typed_ref_zval(zend_reference *ref, zval *zv); +ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, bool strict); + +#define _ZEND_TRY_ASSIGN_NULL(zv, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_null(ref); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_NULL(_zv); \ +} while (0) + +#define ZEND_TRY_ASSIGN_NULL(zv) \ + _ZEND_TRY_ASSIGN_NULL(zv, 0) + +#define ZEND_TRY_ASSIGN_REF_NULL(zv) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_NULL(zv, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_FALSE(zv, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_bool(ref, 0); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_FALSE(_zv); \ +} while (0) + +#define ZEND_TRY_ASSIGN_FALSE(zv) \ + _ZEND_TRY_ASSIGN_FALSE(zv, 0) + +#define ZEND_TRY_ASSIGN_REF_FALSE(zv) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_FALSE(zv, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_TRUE(zv, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_bool(ref, 1); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_TRUE(_zv); \ +} while (0) + +#define ZEND_TRY_ASSIGN_TRUE(zv) \ + _ZEND_TRY_ASSIGN_TRUE(zv, 0) + +#define ZEND_TRY_ASSIGN_REF_TRUE(zv) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_TRUE(zv, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_BOOL(zv, bval, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_bool(ref, 1); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_BOOL(_zv, bval); \ +} while (0) + +#define ZEND_TRY_ASSIGN_BOOL(zv, bval) \ + _ZEND_TRY_ASSIGN_BOOL(zv, bval, 0) + +#define ZEND_TRY_ASSIGN_REF_BOOL(zv, bval) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_BOOL(zv, bval, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_LONG(zv, lval, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_long(ref, lval); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_LONG(_zv, lval); \ +} while (0) + +#define ZEND_TRY_ASSIGN_LONG(zv, lval) \ + _ZEND_TRY_ASSIGN_LONG(zv, lval, 0) + +#define ZEND_TRY_ASSIGN_REF_LONG(zv, lval) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_LONG(zv, lval, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_DOUBLE(zv, dval, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_double(ref, dval); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_DOUBLE(_zv, dval); \ +} while (0) + +#define ZEND_TRY_ASSIGN_DOUBLE(zv, dval) \ + _ZEND_TRY_ASSIGN_DOUBLE(zv, dval, 0) + +#define ZEND_TRY_ASSIGN_REF_DOUBLE(zv, dval) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_DOUBLE(zv, dval, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_EMPTY_STRING(zv, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_empty_string(ref); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_EMPTY_STRING(_zv); \ +} while (0) + +#define ZEND_TRY_ASSIGN_EMPTY_STRING(zv) \ + _ZEND_TRY_ASSIGN_EMPTY_STRING(zv, 0) + +#define ZEND_TRY_ASSIGN_REF_EMPTY_STRING(zv) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_EMPTY_STRING(zv, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_STR(zv, str, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_str(ref, str); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_STR(_zv, str); \ +} while (0) + +#define ZEND_TRY_ASSIGN_STR(zv, str) \ + _ZEND_TRY_ASSIGN_STR(zv, str, 0) + +#define ZEND_TRY_ASSIGN_REF_STR(zv, str) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_STR(zv, str, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_NEW_STR(zv, str, is_str) do { \ + zval *_zv = zv; \ + if (is_str || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_str(ref, str); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_NEW_STR(_zv, str); \ +} while (0) + +#define ZEND_TRY_ASSIGN_NEW_STR(zv, str) \ + _ZEND_TRY_ASSIGN_NEW_STR(zv, str, 0) + +#define ZEND_TRY_ASSIGN_REF_NEW_STR(zv, str) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_NEW_STR(zv, str, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_STRING(zv, string, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_string(ref, string); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_STRING(_zv, string); \ +} while (0) + +#define ZEND_TRY_ASSIGN_STRING(zv, string) \ + _ZEND_TRY_ASSIGN_STRING(zv, string, 0) + +#define ZEND_TRY_ASSIGN_REF_STRING(zv, string) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_STRING(zv, string, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_STRINGL(zv, string, len, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_stringl(ref, string, len); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_STRINGL(_zv, string, len); \ +} while (0) + +#define ZEND_TRY_ASSIGN_STRINGL(zv, string, len) \ + _ZEND_TRY_ASSIGN_STRINGL(zv, string, len, 0) + +#define ZEND_TRY_ASSIGN_REF_STRINGL(zv, string, len) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_STRINGL(zv, string, len, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_ARR(zv, arr, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_arr(ref, arr); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_ARR(_zv, arr); \ +} while (0) + +#define ZEND_TRY_ASSIGN_ARR(zv, arr) \ + _ZEND_TRY_ASSIGN_ARR(zv, arr, 0) + +#define ZEND_TRY_ASSIGN_REF_ARR(zv, arr) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_ARR(zv, arr, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_RES(zv, res, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_res(ref, res); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_RES(_zv, res); \ +} while (0) + +#define ZEND_TRY_ASSIGN_RES(zv, res) \ + _ZEND_TRY_ASSIGN_RES(zv, res, 0) + +#define ZEND_TRY_ASSIGN_REF_RES(zv, res) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_RES(zv, res, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_TMP(zv, other_zv, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref(ref, other_zv); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_COPY_VALUE(_zv, other_zv); \ +} while (0) + +#define ZEND_TRY_ASSIGN_TMP(zv, other_zv) \ + _ZEND_TRY_ASSIGN_TMP(zv, other_zv, 0) + +#define ZEND_TRY_ASSIGN_REF_TMP(zv, other_zv) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_TMP(zv, other_zv, 1); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_VALUE(zv, other_zv, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_zval(ref, other_zv); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_COPY_VALUE(_zv, other_zv); \ +} while (0) + +#define ZEND_TRY_ASSIGN_VALUE(zv, other_zv) \ + _ZEND_TRY_ASSIGN_VALUE(zv, other_zv, 0) + +#define ZEND_TRY_ASSIGN_REF_VALUE(zv, other_zv) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_VALUE(zv, other_zv, 1); \ +} while (0) + +#define ZEND_TRY_ASSIGN_COPY(zv, other_zv) do { \ + Z_TRY_ADDREF_P(other_zv); \ + ZEND_TRY_ASSIGN_VALUE(zv, other_zv); \ +} while (0) + +#define ZEND_TRY_ASSIGN_REF_COPY(zv, other_zv) do { \ + Z_TRY_ADDREF_P(other_zv); \ + ZEND_TRY_ASSIGN_REF_VALUE(zv, other_zv); \ +} while (0) + +#define _ZEND_TRY_ASSIGN_VALUE_EX(zv, other_zv, strict, is_ref) do { \ + zval *_zv = zv; \ + if (is_ref || UNEXPECTED(Z_ISREF_P(_zv))) { \ + zend_reference *ref = Z_REF_P(_zv); \ + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \ + zend_try_assign_typed_ref_zval_ex(ref, other_zv, strict); \ + break; \ + } \ + _zv = &ref->val; \ + } \ + zval_ptr_dtor(_zv); \ + ZVAL_COPY_VALUE(_zv, other_zv); \ +} while (0) + +#define ZEND_TRY_ASSIGN_VALUE_EX(zv, other_zv, strict) \ + _ZEND_TRY_ASSIGN_VALUE_EX(zv, other_zv, strict, 0) + +#define ZEND_TRY_ASSIGN_REF_VALUE_EX(zv, other_zv, strict) do { \ + ZEND_ASSERT(Z_ISREF_P(zv)); \ + _ZEND_TRY_ASSIGN_VALUE_EX(zv, other_zv, strict, 1); \ +} while (0) + +#define ZEND_TRY_ASSIGN_COPY_EX(zv, other_zv, strict) do { \ + Z_TRY_ADDREF_P(other_zv); \ + ZEND_TRY_ASSIGN_VALUE_EX(zv, other_zv, strict); \ +} while (0) + +#define ZEND_TRY_ASSIGN_REF_COPY_EX(zv, other_zv, strict) do { \ + Z_TRY_ADDREF_P(other_zv); \ + ZEND_TRY_ASSIGN_REF_VALUE_EX(zv, other_zv, strict); \ +} while (0) + +/* Initializes a reference to an empty array and returns dereferenced zval, + * or NULL if the initialization failed. */ +static zend_always_inline zval *zend_try_array_init_size(zval *zv, uint32_t size) +{ + zend_array *arr = zend_new_array(size); + + if (EXPECTED(Z_ISREF_P(zv))) { + zend_reference *ref = Z_REF_P(zv); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + if (zend_try_assign_typed_ref_arr(ref, arr) == FAILURE) { + return NULL; + } + return &ref->val; + } + zv = &ref->val; + } + zval_ptr_dtor(zv); + ZVAL_ARR(zv, arr); + return zv; +} + +static zend_always_inline zval *zend_try_array_init(zval *zv) +{ + return zend_try_array_init_size(zv, 0); +} + +/* Fast parameter parsing API */ + +/* Fast ZPP is always enabled now; this define is left in for compatibility + * with any existing conditional compilation blocks. + */ +#define FAST_ZPP 1 + +#define Z_EXPECTED_TYPES(_) \ + _(Z_EXPECTED_LONG, "of type int") \ + _(Z_EXPECTED_LONG_OR_NULL, "of type ?int") \ + _(Z_EXPECTED_BOOL, "of type bool") \ + _(Z_EXPECTED_BOOL_OR_NULL, "of type ?bool") \ + _(Z_EXPECTED_STRING, "of type string") \ + _(Z_EXPECTED_STRING_OR_NULL, "of type ?string") \ + _(Z_EXPECTED_ARRAY, "of type array") \ + _(Z_EXPECTED_ARRAY_OR_NULL, "of type ?array") \ + _(Z_EXPECTED_ARRAY_OR_LONG, "of type array|int") \ + _(Z_EXPECTED_ARRAY_OR_LONG_OR_NULL, "of type array|int|null") \ + _(Z_EXPECTED_ITERABLE, "of type Traversable|array") \ + _(Z_EXPECTED_ITERABLE_OR_NULL, "of type Traversable|array|null") \ + _(Z_EXPECTED_FUNC, "a valid callback") \ + _(Z_EXPECTED_FUNC_OR_NULL, "a valid callback or null") \ + _(Z_EXPECTED_RESOURCE, "of type resource") \ + _(Z_EXPECTED_RESOURCE_OR_NULL, "of type resource or null") \ + _(Z_EXPECTED_PATH, "of type string") \ + _(Z_EXPECTED_PATH_OR_NULL, "of type ?string") \ + _(Z_EXPECTED_OBJECT, "of type object") \ + _(Z_EXPECTED_OBJECT_OR_NULL, "of type ?object") \ + _(Z_EXPECTED_DOUBLE, "of type float") \ + _(Z_EXPECTED_DOUBLE_OR_NULL, "of type ?float") \ + _(Z_EXPECTED_NUMBER, "of type int|float") \ + _(Z_EXPECTED_NUMBER_OR_NULL, "of type int|float|null") \ + _(Z_EXPECTED_NUMBER_OR_STRING, "of type string|int|float") \ + _(Z_EXPECTED_NUMBER_OR_STRING_OR_NULL, "of type string|int|float|null") \ + _(Z_EXPECTED_ARRAY_OR_STRING, "of type array|string") \ + _(Z_EXPECTED_ARRAY_OR_STRING_OR_NULL, "of type array|string|null") \ + _(Z_EXPECTED_STRING_OR_LONG, "of type string|int") \ + _(Z_EXPECTED_STRING_OR_LONG_OR_NULL, "of type string|int|null") \ + _(Z_EXPECTED_OBJECT_OR_CLASS_NAME, "an object or a valid class name") \ + _(Z_EXPECTED_OBJECT_OR_CLASS_NAME_OR_NULL, "an object, a valid class name, or null") \ + _(Z_EXPECTED_OBJECT_OR_STRING, "of type object|string") \ + _(Z_EXPECTED_OBJECT_OR_STRING_OR_NULL, "of type object|string|null") \ + +#define Z_EXPECTED_TYPE + +#define Z_EXPECTED_TYPE_ENUM(id, str) id, +#define Z_EXPECTED_TYPE_STR(id, str) str, + +typedef enum _zend_expected_type { + Z_EXPECTED_TYPES(Z_EXPECTED_TYPE_ENUM) + Z_EXPECTED_LAST +} zend_expected_type; + +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_none_error(void); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(uint32_t min_num_args, uint32_t max_num_args); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code, uint32_t num, char *name, zend_expected_type expected_type, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(uint32_t num, zend_expected_type expected_type, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(uint32_t num, const char *name, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(uint32_t num, const char *name, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_error(uint32_t num, const char *name, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_or_null_error(uint32_t num, const char *name, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, zval *arg); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(uint32_t num, char *error); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_or_null_error(uint32_t num, char *error); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entry *error_ce, uint32_t arg_num, const char *format, va_list va); +ZEND_API ZEND_COLD void zend_argument_error(zend_class_entry *error_ce, uint32_t arg_num, const char *format, ...); +ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format, ...); +ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format, ...); + +#define ZPP_ERROR_OK 0 +#define ZPP_ERROR_FAILURE 1 +#define ZPP_ERROR_WRONG_CALLBACK 2 +#define ZPP_ERROR_WRONG_CLASS 3 +#define ZPP_ERROR_WRONG_CLASS_OR_NULL 4 +#define ZPP_ERROR_WRONG_CLASS_OR_STRING 5 +#define ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL 6 +#define ZPP_ERROR_WRONG_CLASS_OR_LONG 7 +#define ZPP_ERROR_WRONG_CLASS_OR_LONG_OR_NULL 8 +#define ZPP_ERROR_WRONG_ARG 9 +#define ZPP_ERROR_WRONG_COUNT 10 +#define ZPP_ERROR_UNEXPECTED_EXTRA_NAMED 11 +#define ZPP_ERROR_WRONG_CALLBACK_OR_NULL 12 + +#define ZEND_PARSE_PARAMETERS_START_EX(flags, min_num_args, max_num_args) do { \ + const int _flags = (flags); \ + uint32_t _min_num_args = (min_num_args); \ + uint32_t _max_num_args = (uint32_t) (max_num_args); \ + uint32_t _num_args = EX_NUM_ARGS(); \ + uint32_t _i = 0; \ + zval *_real_arg, *_arg = NULL; \ + zend_expected_type _expected_type = Z_EXPECTED_LONG; \ + char *_error = NULL; \ + bool _dummy = 0; \ + bool _optional = 0; \ + int _error_code = ZPP_ERROR_OK; \ + ((void)_i); \ + ((void)_real_arg); \ + ((void)_arg); \ + ((void)_expected_type); \ + ((void)_error); \ + ((void)_optional); \ + ((void)_dummy); \ + \ + do { \ + if (UNEXPECTED(_num_args < _min_num_args) || \ + UNEXPECTED(_num_args > _max_num_args)) { \ + if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \ + zend_wrong_parameters_count_error(_min_num_args, _max_num_args); \ + } \ + _error_code = ZPP_ERROR_FAILURE; \ + break; \ + } \ + _real_arg = ZEND_CALL_ARG(execute_data, 0); + +#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args) \ + ZEND_PARSE_PARAMETERS_START_EX(0, min_num_args, max_num_args) + +#define ZEND_PARSE_PARAMETERS_NONE() do { \ + if (UNEXPECTED(ZEND_NUM_ARGS() != 0)) { \ + zend_wrong_parameters_none_error(); \ + return; \ + } \ + } while (0) + +#define ZEND_PARSE_PARAMETERS_END_EX(failure) \ + ZEND_ASSERT(_i == _max_num_args || _max_num_args == (uint32_t) -1); \ + } while (0); \ + if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \ + if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \ + zend_wrong_parameter_error(_error_code, _i, _error, _expected_type, _arg); \ + } \ + failure; \ + } \ + } while (0) + +#define ZEND_PARSE_PARAMETERS_END() \ + ZEND_PARSE_PARAMETERS_END_EX(return) + +#define Z_PARAM_PROLOGUE(deref, separate) \ + ++_i; \ + ZEND_ASSERT(_i <= _min_num_args || _optional==1); \ + ZEND_ASSERT(_i > _min_num_args || _optional==0); \ + if (_optional) { \ + if (UNEXPECTED(_i >_num_args)) break; \ + } \ + _real_arg++; \ + _arg = _real_arg; \ + if (deref) { \ + if (EXPECTED(Z_ISREF_P(_arg))) { \ + _arg = Z_REFVAL_P(_arg); \ + } \ + } \ + if (separate) { \ + SEPARATE_ZVAL_NOREF(_arg); \ + } + +/* get the zval* for a previously parsed argument */ +#define Z_PARAM_GET_PREV_ZVAL(dest) \ + zend_parse_arg_zval_deref(_arg, &dest, 0); + +/* old "|" */ +#define Z_PARAM_OPTIONAL \ + _optional = 1; + +/* old "a" */ +#define Z_PARAM_ARRAY_EX2(dest, check_null, deref, separate) \ + Z_PARAM_PROLOGUE(deref, separate); \ + if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 0))) { \ + _expected_type = check_null ? Z_EXPECTED_ARRAY_OR_NULL : Z_EXPECTED_ARRAY; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_ARRAY_EX(dest, check_null, separate) \ + Z_PARAM_ARRAY_EX2(dest, check_null, separate, separate) + +#define Z_PARAM_ARRAY(dest) \ + Z_PARAM_ARRAY_EX(dest, 0, 0) + +#define Z_PARAM_ARRAY_OR_NULL(dest) \ + Z_PARAM_ARRAY_EX(dest, 1, 0) + +/* old "A" */ +#define Z_PARAM_ARRAY_OR_OBJECT_EX2(dest, check_null, deref, separate) \ + Z_PARAM_PROLOGUE(deref, separate); \ + if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 1))) { \ + _expected_type = check_null ? Z_EXPECTED_ARRAY_OR_NULL : Z_EXPECTED_ARRAY; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_ARRAY_OR_OBJECT_EX(dest, check_null, separate) \ + Z_PARAM_ARRAY_OR_OBJECT_EX2(dest, check_null, separate, separate) + +#define Z_PARAM_ARRAY_OR_OBJECT(dest) \ + Z_PARAM_ARRAY_OR_OBJECT_EX(dest, 0, 0) + +#define Z_PARAM_ITERABLE_EX(dest, check_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_iterable(_arg, &dest, check_null))) { \ + _expected_type = check_null ? Z_EXPECTED_ITERABLE_OR_NULL : Z_EXPECTED_ITERABLE; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_ITERABLE(dest) \ + Z_PARAM_ITERABLE_EX(dest, 0) + +#define Z_PARAM_ITERABLE_OR_NULL(dest) \ + Z_PARAM_ITERABLE_EX(dest, 1) + +/* old "b" */ +#define Z_PARAM_BOOL_EX(dest, is_null, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_bool(_arg, &dest, &is_null, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_BOOL_OR_NULL : Z_EXPECTED_BOOL; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_BOOL(dest) \ + Z_PARAM_BOOL_EX(dest, _dummy, 0, 0) + +#define Z_PARAM_BOOL_OR_NULL(dest, is_null) \ + Z_PARAM_BOOL_EX(dest, is_null, 1, 0) + +/* old "C" */ +#define Z_PARAM_CLASS_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_class(_arg, &dest, _i, check_null))) { \ + _error_code = ZPP_ERROR_FAILURE; \ + break; \ + } + +#define Z_PARAM_CLASS(dest) \ + Z_PARAM_CLASS_EX(dest, 0, 0) + +#define Z_PARAM_CLASS_OR_NULL(dest) \ + Z_PARAM_CLASS_EX(dest, 1, 0) + +#define Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, allow_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_obj_or_class_name(_arg, &dest, allow_null))) { \ + _expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_CLASS_NAME_OR_NULL : Z_EXPECTED_OBJECT_OR_CLASS_NAME; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_OBJ_OR_CLASS_NAME(dest) \ + Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, 0); + +#define Z_PARAM_OBJ_OR_CLASS_NAME_OR_NULL(dest) \ + Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, 1); + +#define Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, allow_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, NULL, &destination_string, allow_null, _i))) { \ + _expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_STRING_OR_NULL : Z_EXPECTED_OBJECT_OR_STRING; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_OBJ_OR_STR(destination_object, destination_string) \ + Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, 0); + +#define Z_PARAM_OBJ_OR_STR_OR_NULL(destination_object, destination_string) \ + Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, 1); + +#define Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, allow_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, base_ce, &destination_string, allow_null, _i))) { \ + if (base_ce) { \ + _error = ZSTR_VAL((base_ce)->name); \ + _error_code = allow_null ? ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL : ZPP_ERROR_WRONG_CLASS_OR_STRING; \ + break; \ + } else { \ + _expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_STRING_OR_NULL : Z_EXPECTED_OBJECT_OR_STRING; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } \ + } + +#define Z_PARAM_OBJ_OF_CLASS_OR_STR(destination_object, base_ce, destination_string) \ + Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, 0); + +#define Z_PARAM_OBJ_OF_CLASS_OR_STR_OR_NULL(destination_object, base_ce, destination_string) \ + Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, 1); + +/* old "d" */ +#define Z_PARAM_DOUBLE_EX(dest, is_null, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_double(_arg, &dest, &is_null, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_DOUBLE_OR_NULL : Z_EXPECTED_DOUBLE; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_DOUBLE(dest) \ + Z_PARAM_DOUBLE_EX(dest, _dummy, 0, 0) + +#define Z_PARAM_DOUBLE_OR_NULL(dest, is_null) \ + Z_PARAM_DOUBLE_EX(dest, is_null, 1, 0) + +/* old "f" */ +#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_func(_arg, &dest_fci, &dest_fcc, check_null, &_error))) { \ + if (!_error) { \ + _expected_type = check_null ? Z_EXPECTED_FUNC_OR_NULL : Z_EXPECTED_FUNC; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + } else { \ + _error_code = check_null ? ZPP_ERROR_WRONG_CALLBACK_OR_NULL : ZPP_ERROR_WRONG_CALLBACK; \ + } \ + break; \ + } \ + +#define Z_PARAM_FUNC(dest_fci, dest_fcc) \ + Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 0, 0) + +#define Z_PARAM_FUNC_OR_NULL(dest_fci, dest_fcc) \ + Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0) + +#define Z_PARAM_FUNC_OR_NULL_WITH_ZVAL(dest_fci, dest_fcc, dest_zp) \ + Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0) \ + Z_PARAM_GET_PREV_ZVAL(dest_zp) + +/* old "h" */ +#define Z_PARAM_ARRAY_HT_EX2(dest, check_null, deref, separate) \ + Z_PARAM_PROLOGUE(deref, separate); \ + if (UNEXPECTED(!zend_parse_arg_array_ht(_arg, &dest, check_null, 0, separate))) { \ + _expected_type = check_null ? Z_EXPECTED_ARRAY_OR_NULL : Z_EXPECTED_ARRAY; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_ARRAY_HT_EX(dest, check_null, separate) \ + Z_PARAM_ARRAY_HT_EX2(dest, check_null, separate, separate) + +#define Z_PARAM_ARRAY_HT(dest) \ + Z_PARAM_ARRAY_HT_EX(dest, 0, 0) + +#define Z_PARAM_ARRAY_HT_OR_NULL(dest) \ + Z_PARAM_ARRAY_HT_EX(dest, 1, 0) + +#define Z_PARAM_ARRAY_HT_OR_LONG_EX(dest_ht, dest_long, is_null, allow_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_array_ht_or_long(_arg, &dest_ht, &dest_long, &is_null, allow_null, _i))) { \ + _expected_type = allow_null ? Z_EXPECTED_ARRAY_OR_LONG_OR_NULL : Z_EXPECTED_ARRAY_OR_LONG; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_ARRAY_HT_OR_LONG(dest_ht, dest_long) \ + Z_PARAM_ARRAY_HT_OR_LONG_EX(dest_ht, dest_long, _dummy, 0) + +#define Z_PARAM_ARRAY_HT_OR_LONG_OR_NULL(dest_ht, dest_long, is_null) \ + Z_PARAM_ARRAY_HT_OR_LONG_EX(dest_ht, dest_long, is_null, 1) + +/* old "H" */ +#define Z_PARAM_ARRAY_OR_OBJECT_HT_EX2(dest, check_null, deref, separate) \ + Z_PARAM_PROLOGUE(deref, separate); \ + if (UNEXPECTED(!zend_parse_arg_array_ht(_arg, &dest, check_null, 1, separate))) { \ + _expected_type = check_null ? Z_EXPECTED_ARRAY_OR_NULL : Z_EXPECTED_ARRAY; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_ARRAY_OR_OBJECT_HT_EX(dest, check_null, separate) \ + Z_PARAM_ARRAY_OR_OBJECT_HT_EX2(dest, check_null, separate, separate) + +#define Z_PARAM_ARRAY_OR_OBJECT_HT(dest) \ + Z_PARAM_ARRAY_OR_OBJECT_HT_EX(dest, 0, 0) + +/* old "l" */ +#define Z_PARAM_LONG_EX(dest, is_null, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_LONG_OR_NULL : Z_EXPECTED_LONG; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_LONG(dest) \ + Z_PARAM_LONG_EX(dest, _dummy, 0, 0) + +#define Z_PARAM_LONG_OR_NULL(dest, is_null) \ + Z_PARAM_LONG_EX(dest, is_null, 1, 0) + +/* old "n" */ +#define Z_PARAM_NUMBER_EX(dest, check_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_number(_arg, &dest, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_NUMBER_OR_NULL : Z_EXPECTED_NUMBER; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_NUMBER_OR_NULL(dest) \ + Z_PARAM_NUMBER_EX(dest, 1) + +#define Z_PARAM_NUMBER(dest) \ + Z_PARAM_NUMBER_EX(dest, 0) + +#define Z_PARAM_NUMBER_OR_STR_EX(dest, check_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_number_or_str(_arg, &dest, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_NUMBER_OR_STRING_OR_NULL : Z_EXPECTED_NUMBER_OR_STRING; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_NUMBER_OR_STR(dest) \ + Z_PARAM_NUMBER_OR_STR_EX(dest, false) + +#define Z_PARAM_NUMBER_OR_STR_OR_NULL(dest) \ + Z_PARAM_NUMBER_OR_STR_EX(dest, true) + +/* old "o" */ +#define Z_PARAM_OBJECT_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_object(_arg, &dest, NULL, check_null))) { \ + _expected_type = check_null ? Z_EXPECTED_OBJECT_OR_NULL : Z_EXPECTED_OBJECT; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_OBJECT(dest) \ + Z_PARAM_OBJECT_EX(dest, 0, 0) + +#define Z_PARAM_OBJECT_OR_NULL(dest) \ + Z_PARAM_OBJECT_EX(dest, 1, 0) + +/* The same as Z_PARAM_OBJECT_EX except that dest is a zend_object rather than a zval */ +#define Z_PARAM_OBJ_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_obj(_arg, &dest, NULL, check_null))) { \ + _expected_type = check_null ? Z_EXPECTED_OBJECT_OR_NULL : Z_EXPECTED_OBJECT; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_OBJ(dest) \ + Z_PARAM_OBJ_EX(dest, 0, 0) + +#define Z_PARAM_OBJ_OR_NULL(dest) \ + Z_PARAM_OBJ_EX(dest, 1, 0) + +/* old "O" */ +#define Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_object(_arg, &dest, _ce, check_null))) { \ + if (_ce) { \ + _error = ZSTR_VAL((_ce)->name); \ + _error_code = check_null ? ZPP_ERROR_WRONG_CLASS_OR_NULL : ZPP_ERROR_WRONG_CLASS; \ + break; \ + } else { \ + _expected_type = check_null ? Z_EXPECTED_OBJECT_OR_NULL : Z_EXPECTED_OBJECT; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } \ + } + +#define Z_PARAM_OBJECT_OF_CLASS(dest, _ce) \ + Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, 0, 0) + +#define Z_PARAM_OBJECT_OF_CLASS_OR_NULL(dest, _ce) \ + Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, 1, 0) + +/* The same as Z_PARAM_OBJECT_OF_CLASS_EX except that dest is a zend_object rather than a zval */ +#define Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_obj(_arg, &dest, _ce, check_null))) { \ + if (_ce) { \ + _error = ZSTR_VAL((_ce)->name); \ + _error_code = check_null ? ZPP_ERROR_WRONG_CLASS_OR_NULL : ZPP_ERROR_WRONG_CLASS; \ + break; \ + } else { \ + _expected_type = check_null ? Z_EXPECTED_OBJECT_OR_NULL : Z_EXPECTED_OBJECT; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } \ + } + +#define Z_PARAM_OBJ_OF_CLASS(dest, _ce) \ + Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, 0, 0) + +#define Z_PARAM_OBJ_OF_CLASS_OR_NULL(dest, _ce) \ + Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, 1, 0) + +#define Z_PARAM_OBJ_OF_CLASS_OR_LONG_EX(dest_obj, _ce, dest_long, is_null, allow_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_obj_or_long(_arg, &dest_obj, _ce, &dest_long, &is_null, allow_null, _i))) { \ + _error = ZSTR_VAL((_ce)->name); \ + _error_code = allow_null ? ZPP_ERROR_WRONG_CLASS_OR_LONG_OR_NULL : ZPP_ERROR_WRONG_CLASS_OR_LONG; \ + break; \ + } + +#define Z_PARAM_OBJ_OF_CLASS_OR_LONG(dest_obj, _ce, dest_long) \ + Z_PARAM_OBJ_OF_CLASS_OR_LONG_EX(dest_obj, _ce, dest_long, _dummy, 0) + +#define Z_PARAM_OBJ_OF_CLASS_OR_LONG_OR_NULL(dest_obj, _ce, dest_long, is_null) \ + Z_PARAM_OBJ_OF_CLASS_OR_LONG_EX(dest_obj, _ce, dest_long, is_null, 1) + +/* old "p" */ +#define Z_PARAM_PATH_EX(dest, dest_len, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_path(_arg, &dest, &dest_len, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_PATH_OR_NULL : Z_EXPECTED_PATH; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_PATH(dest, dest_len) \ + Z_PARAM_PATH_EX(dest, dest_len, 0, 0) + +#define Z_PARAM_PATH_OR_NULL(dest, dest_len) \ + Z_PARAM_PATH_EX(dest, dest_len, 1, 0) + +/* old "P" */ +#define Z_PARAM_PATH_STR_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_path_str(_arg, &dest, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_PATH_OR_NULL : Z_EXPECTED_PATH; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_PATH_STR(dest) \ + Z_PARAM_PATH_STR_EX(dest, 0, 0) + +#define Z_PARAM_PATH_STR_OR_NULL(dest) \ + Z_PARAM_PATH_STR_EX(dest, 1, 0) + +/* old "r" */ +#define Z_PARAM_RESOURCE_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_resource(_arg, &dest, check_null))) { \ + _expected_type = check_null ? Z_EXPECTED_RESOURCE_OR_NULL : Z_EXPECTED_RESOURCE; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_RESOURCE(dest) \ + Z_PARAM_RESOURCE_EX(dest, 0, 0) + +#define Z_PARAM_RESOURCE_OR_NULL(dest) \ + Z_PARAM_RESOURCE_EX(dest, 1, 0) + +/* old "s" */ +#define Z_PARAM_STRING_EX(dest, dest_len, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_string(_arg, &dest, &dest_len, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_STRING_OR_NULL : Z_EXPECTED_STRING; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_STRING(dest, dest_len) \ + Z_PARAM_STRING_EX(dest, dest_len, 0, 0) + +#define Z_PARAM_STRING_OR_NULL(dest, dest_len) \ + Z_PARAM_STRING_EX(dest, dest_len, 1, 0) + +/* old "S" */ +#define Z_PARAM_STR_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \ + _expected_type = check_null ? Z_EXPECTED_STRING_OR_NULL : Z_EXPECTED_STRING; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_STR(dest) \ + Z_PARAM_STR_EX(dest, 0, 0) + +#define Z_PARAM_STR_OR_NULL(dest) \ + Z_PARAM_STR_EX(dest, 1, 0) + +/* old "z" */ +#define Z_PARAM_ZVAL_EX2(dest, check_null, deref, separate) \ + Z_PARAM_PROLOGUE(deref, separate); \ + zend_parse_arg_zval_deref(_arg, &dest, check_null); + +#define Z_PARAM_ZVAL_EX(dest, check_null, separate) \ + Z_PARAM_ZVAL_EX2(dest, check_null, separate, separate) + +#define Z_PARAM_ZVAL(dest) \ + Z_PARAM_ZVAL_EX(dest, 0, 0) + +#define Z_PARAM_ZVAL_OR_NULL(dest) \ + Z_PARAM_ZVAL_EX(dest, 1, 0) + +/* old "+" and "*" */ +#define Z_PARAM_VARIADIC_EX(spec, dest, dest_num, post_varargs) do { \ + uint32_t _num_varargs = _num_args - _i - (post_varargs); \ + if (EXPECTED(_num_varargs > 0)) { \ + dest = _real_arg + 1; \ + dest_num = _num_varargs; \ + _i += _num_varargs; \ + _real_arg += _num_varargs; \ + } else { \ + dest = NULL; \ + dest_num = 0; \ + } \ + if (UNEXPECTED(ZEND_CALL_INFO(execute_data) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { \ + _error_code = ZPP_ERROR_UNEXPECTED_EXTRA_NAMED; \ + break; \ + } \ + } while (0); + +#define Z_PARAM_VARIADIC(spec, dest, dest_num) \ + Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0) + +#define Z_PARAM_VARIADIC_WITH_NAMED(dest, dest_num, dest_named) do { \ + uint32_t _num_varargs = _num_args - _i; \ + if (EXPECTED(_num_varargs > 0)) { \ + dest = _real_arg + 1; \ + dest_num = _num_varargs; \ + } else { \ + dest = NULL; \ + dest_num = 0; \ + } \ + if (ZEND_CALL_INFO(execute_data) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { \ + dest_named = execute_data->extra_named_params; \ + } else { \ + dest_named = NULL; \ + } \ + } while (0); + +#define Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, allow_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_array_ht_or_str(_arg, &dest_ht, &dest_str, allow_null, _i))) { \ + _expected_type = allow_null ? Z_EXPECTED_ARRAY_OR_STRING_OR_NULL : Z_EXPECTED_ARRAY_OR_STRING; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_ARRAY_HT_OR_STR(dest_ht, dest_str) \ + Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, 0); + +#define Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(dest_ht, dest_str) \ + Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, 1); + +#define Z_PARAM_STR_OR_LONG_EX(dest_str, dest_long, is_null, allow_null) \ + Z_PARAM_PROLOGUE(0, 0); \ + if (UNEXPECTED(!zend_parse_arg_str_or_long(_arg, &dest_str, &dest_long, &is_null, allow_null, _i))) { \ + _expected_type = allow_null ? Z_EXPECTED_STRING_OR_LONG_OR_NULL : Z_EXPECTED_STRING_OR_LONG; \ + _error_code = ZPP_ERROR_WRONG_ARG; \ + break; \ + } + +#define Z_PARAM_STR_OR_LONG(dest_str, dest_long) \ + Z_PARAM_STR_OR_LONG_EX(dest_str, dest_long, _dummy, 0); + +#define Z_PARAM_STR_OR_LONG_OR_NULL(dest_str, dest_long, is_null) \ + Z_PARAM_STR_OR_LONG_EX(dest_str, dest_long, is_null, 1); + +/* End of new parameter parsing API */ + +/* Inlined implementations shared by new and old parameter parsing APIs */ + +ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, uint32_t num, bool check_null); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(const zval *arg, bool *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(const zval *arg, bool *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(const zval *arg, zend_long *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, zend_long *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(const zval *arg, double *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(const zval *arg, double *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_or_str_slow(zval *arg, zval **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long, uint32_t arg_num); + +static zend_always_inline bool zend_parse_arg_bool(const zval *arg, bool *dest, bool *is_null, bool check_null, uint32_t arg_num) +{ + if (check_null) { + *is_null = 0; + } + if (EXPECTED(Z_TYPE_P(arg) == IS_TRUE)) { + *dest = 1; + } else if (EXPECTED(Z_TYPE_P(arg) == IS_FALSE)) { + *dest = 0; + } else if (check_null && Z_TYPE_P(arg) == IS_NULL) { + *is_null = 1; + *dest = 0; + } else { + return zend_parse_arg_bool_slow(arg, dest, arg_num); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null, uint32_t arg_num) +{ + if (check_null) { + *is_null = 0; + } + if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) { + *dest = Z_LVAL_P(arg); + } else if (check_null && Z_TYPE_P(arg) == IS_NULL) { + *is_null = 1; + *dest = 0; + } else { + return zend_parse_arg_long_slow(arg, dest, arg_num); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_double(const zval *arg, double *dest, bool *is_null, bool check_null, uint32_t arg_num) +{ + if (check_null) { + *is_null = 0; + } + if (EXPECTED(Z_TYPE_P(arg) == IS_DOUBLE)) { + *dest = Z_DVAL_P(arg); + } else if (check_null && Z_TYPE_P(arg) == IS_NULL) { + *is_null = 1; + *dest = 0.0; + } else { + return zend_parse_arg_double_slow(arg, dest, arg_num); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_number(zval *arg, zval **dest, bool check_null, uint32_t arg_num) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_LONG || Z_TYPE_P(arg) == IS_DOUBLE)) { + *dest = arg; + } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest = NULL; + } else { + return zend_parse_arg_number_slow(arg, dest, arg_num); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_number_or_str(zval *arg, zval **dest, bool check_null, uint32_t arg_num) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_LONG || Z_TYPE_P(arg) == IS_DOUBLE || Z_TYPE_P(arg) == IS_STRING)) { + *dest = arg; + } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest = NULL; + } else { + return zend_parse_arg_number_or_str_slow(arg, dest, arg_num); + } + return true; +} + +static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) { + *dest = Z_STR_P(arg); + } else if (check_null && Z_TYPE_P(arg) == IS_NULL) { + *dest = NULL; + } else { + return zend_parse_arg_str_slow(arg, dest, arg_num); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_string(zval *arg, char **dest, size_t *dest_len, bool check_null, uint32_t arg_num) +{ + zend_string *str; + + if (!zend_parse_arg_str(arg, &str, check_null, arg_num)) { + return 0; + } + if (check_null && UNEXPECTED(!str)) { + *dest = NULL; + *dest_len = 0; + } else { + *dest = ZSTR_VAL(str); + *dest_len = ZSTR_LEN(str); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_path_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num) +{ + if (!zend_parse_arg_str(arg, dest, check_null, arg_num) || + (*dest && UNEXPECTED(CHECK_NULL_PATH(ZSTR_VAL(*dest), ZSTR_LEN(*dest))))) { + return 0; + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_path(zval *arg, char **dest, size_t *dest_len, bool check_null, uint32_t arg_num) +{ + zend_string *str; + + if (!zend_parse_arg_path_str(arg, &str, check_null, arg_num)) { + return 0; + } + if (check_null && UNEXPECTED(!str)) { + *dest = NULL; + *dest_len = 0; + } else { + *dest = ZSTR_VAL(str); + *dest_len = ZSTR_LEN(str); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_iterable(zval *arg, zval **dest, bool check_null) +{ + if (EXPECTED(zend_is_iterable(arg))) { + *dest = arg; + return 1; + } + + if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest = NULL; + return 1; + } + + return 0; +} + +static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool check_null, bool or_object) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY) || + (or_object && EXPECTED(Z_TYPE_P(arg) == IS_OBJECT))) { + *dest = arg; + } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest = NULL; + } else { + return 0; + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_array_ht(const zval *arg, HashTable **dest, bool check_null, bool or_object, bool separate) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY)) { + *dest = Z_ARRVAL_P(arg); + } else if (or_object && EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) { + zend_object *zobj = Z_OBJ_P(arg); + if (separate + && zobj->properties + && UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + *dest = zobj->handlers->get_properties(zobj); + } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest = NULL; + } else { + return 0; + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_array_ht_or_long( + zval *arg, HashTable **dest_ht, zend_long *dest_long, bool *is_null, bool allow_null, uint32_t arg_num +) { + if (allow_null) { + *is_null = 0; + } + + if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY)) { + *dest_ht = Z_ARRVAL_P(arg); + } else if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) { + *dest_ht = NULL; + *dest_long = Z_LVAL_P(arg); + } else if (allow_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest_ht = NULL; + *is_null = 1; + } else { + *dest_ht = NULL; + return zend_parse_arg_long_slow(arg, dest_long, arg_num); + } + + return 1; +} + +static zend_always_inline bool zend_parse_arg_object(zval *arg, zval **dest, zend_class_entry *ce, bool check_null) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT) && + (!ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), ce) != 0))) { + *dest = arg; + } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest = NULL; + } else { + return 0; + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_obj(const zval *arg, zend_object **dest, zend_class_entry *ce, bool check_null) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT) && + (!ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), ce) != 0))) { + *dest = Z_OBJ_P(arg); + } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest = NULL; + } else { + return 0; + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_obj_or_long( + zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, bool *is_null, bool allow_null, uint32_t arg_num +) { + if (allow_null) { + *is_null = 0; + } + + if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT) && EXPECTED(instanceof_function(Z_OBJCE_P(arg), ce) != 0)) { + *dest_obj = Z_OBJ_P(arg); + } else if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) { + *dest_obj = NULL; + *dest_long = Z_LVAL_P(arg); + } else if (allow_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest_obj = NULL; + *is_null = 1; + } else { + *dest_obj = NULL; + return zend_parse_arg_long_slow(arg, dest_long, arg_num); + } + + return 1; +} + +static zend_always_inline bool zend_parse_arg_resource(zval *arg, zval **dest, bool check_null) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_RESOURCE)) { + *dest = arg; + } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest = NULL; + } else { + return 0; + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_func(zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error) +{ + if (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + dest_fci->size = 0; + dest_fcc->function_handler = NULL; + *error = NULL; + } else if (UNEXPECTED(zend_fcall_info_init(arg, 0, dest_fci, dest_fcc, NULL, error) != SUCCESS)) { + return 0; + } + /* Release call trampolines: The function may not get called, in which case + * the trampoline will leak. Force it to be refetched during + * zend_call_function instead. */ + zend_release_fcall_info_cache(dest_fcc); + return 1; +} + +static zend_always_inline void zend_parse_arg_zval(zval *arg, zval **dest, bool check_null) +{ + *dest = (check_null && + (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) || + (UNEXPECTED(Z_ISREF_P(arg)) && + UNEXPECTED(Z_TYPE_P(Z_REFVAL_P(arg)) == IS_NULL)))) ? NULL : arg; +} + +static zend_always_inline void zend_parse_arg_zval_deref(zval *arg, zval **dest, bool check_null) +{ + *dest = (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) ? NULL : arg; +} + +static zend_always_inline bool zend_parse_arg_array_ht_or_str( + zval *arg, HashTable **dest_ht, zend_string **dest_str, bool allow_null, uint32_t arg_num) +{ + if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) { + *dest_ht = NULL; + *dest_str = Z_STR_P(arg); + } else if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY)) { + *dest_ht = Z_ARRVAL_P(arg); + *dest_str = NULL; + } else if (allow_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest_ht = NULL; + *dest_str = NULL; + } else { + *dest_ht = NULL; + return zend_parse_arg_str_slow(arg, dest_str, arg_num); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string **dest_str, zend_long *dest_long, + bool *is_null, bool allow_null, uint32_t arg_num) +{ + if (allow_null) { + *is_null = 0; + } + if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) { + *dest_str = Z_STR_P(arg); + } else if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) { + *dest_str = NULL; + *dest_long = Z_LVAL_P(arg); + } else if (allow_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *dest_str = NULL; + *is_null = 1; + } else { + return zend_parse_arg_str_or_long_slow(arg, dest_str, dest_long, arg_num); + } + return 1; +} + +static zend_always_inline bool zend_parse_arg_obj_or_class_name( + zval *arg, zend_class_entry **destination, bool allow_null +) { + if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) { + *destination = zend_lookup_class(Z_STR_P(arg)); + + return *destination != NULL; + } else if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) { + *destination = Z_OBJ_P(arg)->ce; + } else if (allow_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { + *destination = NULL; + } else { + return 0; + } + + return 1; +} + +static zend_always_inline bool zend_parse_arg_obj_or_str( + zval *arg, zend_object **destination_object, zend_class_entry *base_ce, zend_string **destination_string, bool allow_null, uint32_t arg_num +) { + if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) { + if (!base_ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), base_ce))) { + *destination_object = Z_OBJ_P(arg); + *destination_string = NULL; + return 1; + } + } + + *destination_object = NULL; + return zend_parse_arg_str(arg, destination_string, allow_null, arg_num); +} + +END_EXTERN_C() + +#endif /* ZEND_API_H */ diff --git a/include/php/Zend/zend_alloc.h b/include/php/Zend/zend_alloc.h new file mode 100644 index 0000000..578d4c7 --- /dev/null +++ b/include/php/Zend/zend_alloc.h @@ -0,0 +1,404 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_ALLOC_H +#define ZEND_ALLOC_H + +#include + +#include "../TSRM/TSRM.h" +#include "zend.h" + +#ifndef ZEND_MM_ALIGNMENT +# error "ZEND_MM_ALIGNMENT was not defined during configure" +#endif + +#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT - 1) + +#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK) + +#define ZEND_MM_ALIGNED_SIZE_EX(size, alignment) \ + (((size) + ((alignment) - 1)) & ~((alignment) - 1)) + +typedef struct _zend_leak_info { + void *addr; + size_t size; + const char *filename; + const char *orig_filename; + uint32_t lineno; + uint32_t orig_lineno; +} zend_leak_info; + +#if ZEND_DEBUG +typedef struct _zend_mm_debug_info { + size_t size; + const char *filename; + const char *orig_filename; + uint32_t lineno; + uint32_t orig_lineno; +} zend_mm_debug_info; + +# define ZEND_MM_OVERHEAD ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_debug_info)) +#else +# define ZEND_MM_OVERHEAD 0 +#endif + +BEGIN_EXTERN_C() + +ZEND_API ZEND_ATTRIBUTE_MALLOC char* ZEND_FASTCALL zend_strndup(const char *s, size_t length); + +ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_ALLOC_SIZE(1); +ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); +ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _safe_malloc(size_t nmemb, size_t size, size_t offset); +ZEND_API void ZEND_FASTCALL _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); +ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_ALLOC_SIZE2(1,2); +ZEND_API void* ZEND_FASTCALL _erealloc(void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_ALLOC_SIZE(2); +ZEND_API void* ZEND_FASTCALL _erealloc2(void *ptr, size_t size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_ALLOC_SIZE(2); +ZEND_API void* ZEND_FASTCALL _safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); +ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset); +ZEND_API ZEND_ATTRIBUTE_MALLOC char* ZEND_FASTCALL _estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); +ZEND_API ZEND_ATTRIBUTE_MALLOC char* ZEND_FASTCALL _estrndup(const char *s, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); +ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); + +#include "zend_alloc_sizes.h" + +/* _emalloc() & _efree() specialization */ +#if !ZEND_DEBUG && defined(HAVE_BUILTIN_CONSTANT_P) + +# define _ZEND_BIN_ALLOCATOR_DEF(_num, _size, _elements, _pages, x, y) \ + ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _emalloc_ ## _size(void); + +ZEND_MM_BINS_INFO(_ZEND_BIN_ALLOCATOR_DEF, x, y) + +ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _emalloc_large(size_t size) ZEND_ATTRIBUTE_ALLOC_SIZE(1); +ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _emalloc_huge(size_t size) ZEND_ATTRIBUTE_ALLOC_SIZE(1); + +# define _ZEND_BIN_ALLOCATOR_SELECTOR_START(_num, _size, _elements, _pages, size, y) \ + ((size <= _size) ? _emalloc_ ## _size() : +# define _ZEND_BIN_ALLOCATOR_SELECTOR_END(_num, _size, _elements, _pages, size, y) \ + ) + +# define ZEND_ALLOCATOR(size) \ + ZEND_MM_BINS_INFO(_ZEND_BIN_ALLOCATOR_SELECTOR_START, size, y) \ + ((size <= ZEND_MM_MAX_LARGE_SIZE) ? _emalloc_large(size) : _emalloc_huge(size)) \ + ZEND_MM_BINS_INFO(_ZEND_BIN_ALLOCATOR_SELECTOR_END, size, y) + +# define _emalloc(size) \ + (__builtin_constant_p(size) ? \ + ZEND_ALLOCATOR(size) \ + : \ + _emalloc(size) \ + ) + +# define _ZEND_BIN_DEALLOCATOR_DEF(_num, _size, _elements, _pages, x, y) \ + ZEND_API void ZEND_FASTCALL _efree_ ## _size(void *); + +ZEND_MM_BINS_INFO(_ZEND_BIN_DEALLOCATOR_DEF, x, y) + +ZEND_API void ZEND_FASTCALL _efree_large(void *, size_t size); +ZEND_API void ZEND_FASTCALL _efree_huge(void *, size_t size); + +# define _ZEND_BIN_DEALLOCATOR_SELECTOR_START(_num, _size, _elements, _pages, ptr, size) \ + if (size <= _size) { _efree_ ## _size(ptr); } else + +# define ZEND_DEALLOCATOR(ptr, size) \ + ZEND_MM_BINS_INFO(_ZEND_BIN_DEALLOCATOR_SELECTOR_START, ptr, size) \ + if (size <= ZEND_MM_MAX_LARGE_SIZE) { _efree_large(ptr, size); } \ + else { _efree_huge(ptr, size); } + +# define efree_size(ptr, size) do { \ + if (__builtin_constant_p(size)) { \ + ZEND_DEALLOCATOR(ptr, size) \ + } else { \ + _efree(ptr); \ + } \ + } while (0) +# define efree_size_rel(ptr, size) \ + efree_size(ptr, size) + +#else + +# define efree_size(ptr, size) \ + efree(ptr) +# define efree_size_rel(ptr, size) \ + efree_rel(ptr) + +#define _emalloc_large _emalloc +#define _emalloc_huge _emalloc +#define _efree_large _efree +#define _efree_huge _efree + +#endif + +/* Standard wrapper macros */ +#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define emalloc_large(size) _emalloc_large((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define emalloc_huge(size) _emalloc_huge((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define efree_large(ptr) _efree_large((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define efree_huge(ptr) _efree_huge((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define erealloc(ptr, size) _erealloc((ptr), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define erealloc2(ptr, size, copy_size) _erealloc2((ptr), (size), (copy_size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define safe_erealloc(ptr, nmemb, size, offset) _safe_erealloc((ptr), (nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define erealloc2_recoverable(ptr, size, copy_size) _erealloc2((ptr), (size), (copy_size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define zend_mem_block_size(ptr) _zend_mem_block_size((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) + +/* Relay wrapper macros */ +#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define safe_emalloc_rel(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define erealloc_rel(ptr, size) _erealloc((ptr), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define erealloc2_rel(ptr, size, copy_size) _erealloc2((ptr), (size), (copy_size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define erealloc2_recoverable_rel(ptr, size, copy_size) _erealloc2((ptr), (size), (copy_size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define safe_erealloc_rel(ptr, nmemb, size, offset) _safe_erealloc((ptr), (nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define zend_mem_block_size_rel(ptr) _zend_mem_block_size((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) + +ZEND_API ZEND_ATTRIBUTE_MALLOC void * __zend_malloc(size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE(1); +ZEND_API ZEND_ATTRIBUTE_MALLOC void * __zend_calloc(size_t nmemb, size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE2(1,2); +ZEND_API void * __zend_realloc(void *p, size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE(2); +ZEND_API ZEND_ATTRIBUTE_MALLOC char * __zend_strdup(const char *s); + +/* Selective persistent/non persistent allocation macros */ +#define pemalloc(size, persistent) ((persistent)?__zend_malloc(size):emalloc(size)) +#define safe_pemalloc(nmemb, size, offset, persistent) ((persistent)?_safe_malloc(nmemb, size, offset):safe_emalloc(nmemb, size, offset)) +#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr)) +#define pefree_size(ptr, size, persistent) do { \ + if (persistent) { \ + free(ptr); \ + } else { \ + efree_size(ptr, size);\ + } \ + } while (0) + +#define pecalloc(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc((nmemb), (size))) +#define perealloc(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc((ptr), (size))) +#define perealloc2(ptr, size, copy_size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc2((ptr), (size), (copy_size))) +#define safe_perealloc(ptr, nmemb, size, offset, persistent) ((persistent)?_safe_realloc((ptr), (nmemb), (size), (offset)):safe_erealloc((ptr), (nmemb), (size), (offset))) +#define perealloc_recoverable(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable((ptr), (size))) +#define perealloc2_recoverable(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc2_recoverable((ptr), (size), (copy_size))) +#define pestrdup(s, persistent) ((persistent)?__zend_strdup(s):estrdup(s)) +#define pestrndup(s, length, persistent) ((persistent)?zend_strndup((s),(length)):estrndup((s),(length))) + +#define pemalloc_rel(size, persistent) ((persistent)?__zend_malloc(size):emalloc_rel(size)) +#define pefree_rel(ptr, persistent) ((persistent)?free(ptr):efree_rel(ptr)) +#define pecalloc_rel(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc_rel((nmemb), (size))) +#define perealloc_rel(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc_rel((ptr), (size))) +#define perealloc2_rel(ptr, size, copy_size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc2_rel((ptr), (size), (copy_size))) +#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size))) +#define perealloc2_recoverable_rel(ptr, size, copy_size, persistent) ((persistent)?realloc((ptr), (size)):erealloc2_recoverable_rel((ptr), (size), (copy_size))) +#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s)) + +ZEND_API zend_result zend_set_memory_limit(size_t memory_limit); +ZEND_API bool zend_alloc_in_memory_limit_error_reporting(void); + +ZEND_API void start_memory_manager(void); +ZEND_API void shutdown_memory_manager(bool silent, bool full_shutdown); +ZEND_API bool is_zend_mm(void); +ZEND_API bool is_zend_ptr(const void *ptr); + +ZEND_API size_t zend_memory_usage(bool real_usage); +ZEND_API size_t zend_memory_peak_usage(bool real_usage); +ZEND_API void zend_memory_reset_peak_usage(void); + +/* fast cache for HashTables */ +#define ALLOC_HASHTABLE(ht) \ + (ht) = (HashTable *) emalloc(sizeof(HashTable)) + +#define FREE_HASHTABLE(ht) \ + efree_size(ht, sizeof(HashTable)) + +#define ALLOC_HASHTABLE_REL(ht) \ + (ht) = (HashTable *) emalloc_rel(sizeof(HashTable)) + +#define FREE_HASHTABLE_REL(ht) \ + efree_size_rel(ht, sizeof(HashTable)) + +/* Heap functions */ +typedef struct _zend_mm_heap zend_mm_heap; + +ZEND_API zend_mm_heap *zend_mm_startup(void); +ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, bool full_shutdown, bool silent); +ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_ALLOC_SIZE(2); +ZEND_API void ZEND_FASTCALL _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); +ZEND_API void* ZEND_FASTCALL _zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); +ZEND_API void* ZEND_FASTCALL _zend_mm_realloc2(zend_mm_heap *heap, void *p, size_t size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); +ZEND_API size_t ZEND_FASTCALL _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); + +#define zend_mm_alloc(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define zend_mm_free(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define zend_mm_realloc(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define zend_mm_realloc2(heap, p, size, copy_size) _zend_mm_realloc2((heap), (p), (size), (copy_size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define zend_mm_block_size(heap, p) _zend_mm_block_size((heap), (p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) + +#define zend_mm_alloc_rel(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define zend_mm_free_rel(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define zend_mm_realloc_rel(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define zend_mm_realloc2_rel(heap, p, size, copy_size) _zend_mm_realloc2((heap), (p), (size), (copy_size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) +#define zend_mm_block_size_rel(heap, p) _zend_mm_block_size((heap), (p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) + +ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap); +ZEND_API zend_mm_heap *zend_mm_get_heap(void); + +ZEND_API size_t zend_mm_gc(zend_mm_heap *heap); + +#define ZEND_MM_CUSTOM_HEAP_NONE 0 +#define ZEND_MM_CUSTOM_HEAP_STD 1 +#define ZEND_MM_CUSTOM_HEAP_DEBUG 2 + +ZEND_API bool zend_mm_is_custom_heap(zend_mm_heap *new_heap); +ZEND_API void zend_mm_set_custom_handlers(zend_mm_heap *heap, + void* (*_malloc)(size_t), + void (*_free)(void*), + void* (*_realloc)(void*, size_t)); +ZEND_API void zend_mm_get_custom_handlers(zend_mm_heap *heap, + void* (**_malloc)(size_t), + void (**_free)(void*), + void* (**_realloc)(void*, size_t)); + +#if ZEND_DEBUG +ZEND_API void zend_mm_set_custom_debug_handlers(zend_mm_heap *heap, + void* (*_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), + void (*_free)(void* ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), + void* (*_realloc)(void*, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)); +#endif + +typedef struct _zend_mm_storage zend_mm_storage; + +typedef void* (*zend_mm_chunk_alloc_t)(zend_mm_storage *storage, size_t size, size_t alignment); +typedef void (*zend_mm_chunk_free_t)(zend_mm_storage *storage, void *chunk, size_t size); +typedef bool (*zend_mm_chunk_truncate_t)(zend_mm_storage *storage, void *chunk, size_t old_size, size_t new_size); +typedef bool (*zend_mm_chunk_extend_t)(zend_mm_storage *storage, void *chunk, size_t old_size, size_t new_size); + +typedef struct _zend_mm_handlers { + zend_mm_chunk_alloc_t chunk_alloc; + zend_mm_chunk_free_t chunk_free; + zend_mm_chunk_truncate_t chunk_truncate; + zend_mm_chunk_extend_t chunk_extend; +} zend_mm_handlers; + +struct _zend_mm_storage { + const zend_mm_handlers handlers; + void *data; +}; + +ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap); +ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void *data, size_t data_size); + +/* + +// The following example shows how to use zend_mm_heap API with custom storage + +static zend_mm_heap *apc_heap = NULL; +static HashTable *apc_ht = NULL; + +typedef struct _apc_data { + void *mem; + uint32_t free_pages; +} apc_data; + +static void *apc_chunk_alloc(zend_mm_storage *storage, size_t size, size_t alignment) +{ + apc_data *data = (apc_data*)(storage->data); + size_t real_size = ((size + (ZEND_MM_CHUNK_SIZE-1)) & ~(ZEND_MM_CHUNK_SIZE-1)); + uint32_t count = real_size / ZEND_MM_CHUNK_SIZE; + uint32_t first, last, i; + + ZEND_ASSERT(alignment == ZEND_MM_CHUNK_SIZE); + + for (first = 0; first < 32; first++) { + if (!(data->free_pages & (1 << first))) { + last = first; + do { + if (last - first == count - 1) { + for (i = first; i <= last; i++) { + data->free_pages |= (1 << i); + } + return (void *)(((char*)(data->mem)) + ZEND_MM_CHUNK_SIZE * (1 << first)); + } + last++; + } while (last < 32 && !(data->free_pages & (1 << last))); + first = last; + } + } + return NULL; +} + +static void apc_chunk_free(zend_mm_storage *storage, void *chunk, size_t size) +{ + apc_data *data = (apc_data*)(storage->data); + uint32_t i; + + ZEND_ASSERT(((uintptr_t)chunk & (ZEND_MM_CHUNK_SIZE - 1)) == 0); + + i = ((uintptr_t)chunk - (uintptr_t)(data->mem)) / ZEND_MM_CHUNK_SIZE; + while (1) { + data->free_pages &= ~(1 << i); + if (size <= ZEND_MM_CHUNK_SIZE) { + break; + } + size -= ZEND_MM_CHUNK_SIZE; + } +} + +static void apc_init_heap(void) +{ + zend_mm_handlers apc_handlers = { + apc_chunk_alloc, + apc_chunk_free, + NULL, + NULL, + }; + apc_data tmp_data; + zend_mm_heap *old_heap; + + // Preallocate properly aligned SHM chunks (64MB) + tmp_data.mem = shm_memalign(ZEND_MM_CHUNK_SIZE, ZEND_MM_CHUNK_SIZE * 32); + + // Initialize temporary storage data + tmp_data.free_pages = 0; + + // Create heap + apc_heap = zend_mm_startup_ex(&apc_handlers, &tmp_data, sizeof(tmp_data)); + + // Allocate some data in the heap + old_heap = zend_mm_set_heap(apc_heap); + ALLOC_HASHTABLE(apc_ht); + zend_hash_init(apc_ht, 64, NULL, ZVAL_PTR_DTOR, 0); + zend_mm_set_heap(old_heap); +} + +*/ + +#ifdef ZTS +size_t zend_mm_globals_size(void); +#endif + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_alloc_sizes.h b/include/php/Zend/zend_alloc_sizes.h new file mode 100644 index 0000000..502b982 --- /dev/null +++ b/include/php/Zend/zend_alloc_sizes.h @@ -0,0 +1,64 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_ALLOC_SIZES_H +#define ZEND_ALLOC_SIZES_H + +#define ZEND_MM_CHUNK_SIZE ((size_t) (2 * 1024 * 1024)) /* 2 MB */ +#define ZEND_MM_PAGE_SIZE (4 * 1024) /* 4 KB */ +#define ZEND_MM_PAGES (ZEND_MM_CHUNK_SIZE / ZEND_MM_PAGE_SIZE) /* 512 */ +#define ZEND_MM_FIRST_PAGE (1) + +#define ZEND_MM_MIN_SMALL_SIZE 8 +#define ZEND_MM_MAX_SMALL_SIZE 3072 +#define ZEND_MM_MAX_LARGE_SIZE (ZEND_MM_CHUNK_SIZE - (ZEND_MM_PAGE_SIZE * ZEND_MM_FIRST_PAGE)) + +/* num, size, count, pages */ +#define ZEND_MM_BINS_INFO(_, x, y) \ + _( 0, 8, 512, 1, x, y) \ + _( 1, 16, 256, 1, x, y) \ + _( 2, 24, 170, 1, x, y) \ + _( 3, 32, 128, 1, x, y) \ + _( 4, 40, 102, 1, x, y) \ + _( 5, 48, 85, 1, x, y) \ + _( 6, 56, 73, 1, x, y) \ + _( 7, 64, 64, 1, x, y) \ + _( 8, 80, 51, 1, x, y) \ + _( 9, 96, 42, 1, x, y) \ + _(10, 112, 36, 1, x, y) \ + _(11, 128, 32, 1, x, y) \ + _(12, 160, 25, 1, x, y) \ + _(13, 192, 21, 1, x, y) \ + _(14, 224, 18, 1, x, y) \ + _(15, 256, 16, 1, x, y) \ + _(16, 320, 64, 5, x, y) \ + _(17, 384, 32, 3, x, y) \ + _(18, 448, 9, 1, x, y) \ + _(19, 512, 8, 1, x, y) \ + _(20, 640, 32, 5, x, y) \ + _(21, 768, 16, 3, x, y) \ + _(22, 896, 9, 2, x, y) \ + _(23, 1024, 8, 2, x, y) \ + _(24, 1280, 16, 5, x, y) \ + _(25, 1536, 8, 3, x, y) \ + _(26, 1792, 16, 7, x, y) \ + _(27, 2048, 8, 4, x, y) \ + _(28, 2560, 8, 5, x, y) \ + _(29, 3072, 4, 3, x, y) + +#endif /* ZEND_ALLOC_SIZES_H */ diff --git a/include/php/Zend/zend_arena.h b/include/php/Zend/zend_arena.h new file mode 100644 index 0000000..a44082e --- /dev/null +++ b/include/php/Zend/zend_arena.h @@ -0,0 +1,224 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef _ZEND_ARENA_H_ +#define _ZEND_ARENA_H_ + +#include "zend.h" + +#ifndef ZEND_TRACK_ARENA_ALLOC + +typedef struct _zend_arena zend_arena; + +struct _zend_arena { + char *ptr; + char *end; + zend_arena *prev; +}; + +static zend_always_inline zend_arena* zend_arena_create(size_t size) +{ + zend_arena *arena = (zend_arena*)emalloc(size); + + arena->ptr = (char*) arena + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena)); + arena->end = (char*) arena + size; + arena->prev = NULL; + return arena; +} + +static zend_always_inline void zend_arena_destroy(zend_arena *arena) +{ + do { + zend_arena *prev = arena->prev; + efree(arena); + arena = prev; + } while (arena); +} + +static zend_always_inline void* zend_arena_alloc(zend_arena **arena_ptr, size_t size) +{ + zend_arena *arena = *arena_ptr; + char *ptr = arena->ptr; + + size = ZEND_MM_ALIGNED_SIZE(size); + + if (EXPECTED(size <= (size_t)(arena->end - ptr))) { + arena->ptr = ptr + size; + } else { + size_t arena_size = + UNEXPECTED((size + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena))) > (size_t)(arena->end - (char*) arena)) ? + (size + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena))) : + (size_t)(arena->end - (char*) arena); + zend_arena *new_arena = (zend_arena*)emalloc(arena_size); + + ptr = (char*) new_arena + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena)); + new_arena->ptr = (char*) new_arena + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena)) + size; + new_arena->end = (char*) new_arena + arena_size; + new_arena->prev = arena; + *arena_ptr = new_arena; + } + + return (void*) ptr; +} + +static zend_always_inline void* zend_arena_calloc(zend_arena **arena_ptr, size_t count, size_t unit_size) +{ + bool overflow; + size_t size; + void *ret; + + size = zend_safe_address(unit_size, count, 0, &overflow); + if (UNEXPECTED(overflow)) { + zend_error(E_ERROR, "Possible integer overflow in zend_arena_calloc() (%zu * %zu)", unit_size, count); + } + ret = zend_arena_alloc(arena_ptr, size); + memset(ret, 0, size); + return ret; +} + +static zend_always_inline void* zend_arena_checkpoint(zend_arena *arena) +{ + return arena->ptr; +} + +static zend_always_inline void zend_arena_release(zend_arena **arena_ptr, void *checkpoint) +{ + zend_arena *arena = *arena_ptr; + + while (UNEXPECTED((char*)checkpoint > arena->end) || + UNEXPECTED((char*)checkpoint <= (char*)arena)) { + zend_arena *prev = arena->prev; + efree(arena); + *arena_ptr = arena = prev; + } + ZEND_ASSERT((char*)checkpoint > (char*)arena && (char*)checkpoint <= arena->end); + arena->ptr = (char*)checkpoint; +} + +static zend_always_inline bool zend_arena_contains(zend_arena *arena, void *ptr) +{ + while (arena) { + if ((char*)ptr > (char*)arena && (char*)ptr <= arena->ptr) { + return 1; + } + arena = arena->prev; + } + return 0; +} + +#else + +/* Use normal allocations and keep track of them for mass-freeing. + * This is intended for use with asan/valgrind. */ + +typedef struct _zend_arena zend_arena; + +struct _zend_arena { + void **ptr; + void **end; + struct _zend_arena *prev; + void *ptrs[0]; +}; + +#define ZEND_TRACKED_ARENA_SIZE 1000 + +static zend_always_inline zend_arena *zend_arena_create(size_t _size) +{ + zend_arena *arena = (zend_arena*) emalloc( + sizeof(zend_arena) + sizeof(void *) * ZEND_TRACKED_ARENA_SIZE); + arena->ptr = &arena->ptrs[0]; + arena->end = &arena->ptrs[ZEND_TRACKED_ARENA_SIZE]; + arena->prev = NULL; + return arena; +} + +static zend_always_inline void zend_arena_destroy(zend_arena *arena) +{ + do { + zend_arena *prev = arena->prev; + void **ptr; + for (ptr = arena->ptrs; ptr < arena->ptr; ptr++) { + efree(*ptr); + } + efree(arena); + arena = prev; + } while (arena); +} + +static zend_always_inline void *zend_arena_alloc(zend_arena **arena_ptr, size_t size) +{ + zend_arena *arena = *arena_ptr; + if (arena->ptr == arena->end) { + *arena_ptr = zend_arena_create(0); + (*arena_ptr)->prev = arena; + arena = *arena_ptr; + } + + return *arena->ptr++ = emalloc(size); +} + +static zend_always_inline void* zend_arena_calloc(zend_arena **arena_ptr, size_t count, size_t unit_size) +{ + bool overflow; + size_t size; + void *ret; + + size = zend_safe_address(unit_size, count, 0, &overflow); + if (UNEXPECTED(overflow)) { + zend_error(E_ERROR, "Possible integer overflow in zend_arena_calloc() (%zu * %zu)", unit_size, count); + } + ret = zend_arena_alloc(arena_ptr, size); + memset(ret, 0, size); + return ret; +} + +static zend_always_inline void* zend_arena_checkpoint(zend_arena *arena) +{ + return arena->ptr; +} + +static zend_always_inline void zend_arena_release(zend_arena **arena_ptr, void *checkpoint) +{ + while (1) { + zend_arena *arena = *arena_ptr; + zend_arena *prev = arena->prev; + while (1) { + if (arena->ptr == (void **) checkpoint) { + return; + } + if (arena->ptr == arena->ptrs) { + break; + } + arena->ptr--; + efree(*arena->ptr); + } + efree(arena); + *arena_ptr = prev; + ZEND_ASSERT(*arena_ptr); + } +} + +static zend_always_inline bool zend_arena_contains(zend_arena *arena, void *ptr) +{ + /* TODO: Dummy */ + return 1; +} + +#endif + +#endif /* _ZEND_ARENA_H_ */ diff --git a/include/php/Zend/zend_ast.h b/include/php/Zend/zend_ast.h new file mode 100644 index 0000000..4c1a87e --- /dev/null +++ b/include/php/Zend/zend_ast.h @@ -0,0 +1,385 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Bob Weinand | + | Dmitry Stogov | + | Nikita Popov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_AST_H +#define ZEND_AST_H + +#include "zend.h" + +#ifndef ZEND_AST_SPEC +# define ZEND_AST_SPEC 1 +#endif + +#define ZEND_AST_SPECIAL_SHIFT 6 +#define ZEND_AST_IS_LIST_SHIFT 7 +#define ZEND_AST_NUM_CHILDREN_SHIFT 8 + +enum _zend_ast_kind { + /* special nodes */ + ZEND_AST_ZVAL = 1 << ZEND_AST_SPECIAL_SHIFT, + ZEND_AST_CONSTANT, + ZEND_AST_ZNODE, + + /* declaration nodes */ + ZEND_AST_FUNC_DECL, + ZEND_AST_CLOSURE, + ZEND_AST_METHOD, + ZEND_AST_CLASS, + ZEND_AST_ARROW_FUNC, + + /* list nodes */ + ZEND_AST_ARG_LIST = 1 << ZEND_AST_IS_LIST_SHIFT, + ZEND_AST_ARRAY, + ZEND_AST_ENCAPS_LIST, + ZEND_AST_EXPR_LIST, + ZEND_AST_STMT_LIST, + ZEND_AST_IF, + ZEND_AST_SWITCH_LIST, + ZEND_AST_CATCH_LIST, + ZEND_AST_PARAM_LIST, + ZEND_AST_CLOSURE_USES, + ZEND_AST_PROP_DECL, + ZEND_AST_CONST_DECL, + ZEND_AST_CLASS_CONST_DECL, + ZEND_AST_NAME_LIST, + ZEND_AST_TRAIT_ADAPTATIONS, + ZEND_AST_USE, + ZEND_AST_TYPE_UNION, + ZEND_AST_TYPE_INTERSECTION, + ZEND_AST_ATTRIBUTE_LIST, + ZEND_AST_ATTRIBUTE_GROUP, + ZEND_AST_MATCH_ARM_LIST, + ZEND_AST_MODIFIER_LIST, + + /* 0 child nodes */ + ZEND_AST_MAGIC_CONST = 0 << ZEND_AST_NUM_CHILDREN_SHIFT, + ZEND_AST_TYPE, + ZEND_AST_CONSTANT_CLASS, + ZEND_AST_CALLABLE_CONVERT, + + /* 1 child node */ + ZEND_AST_VAR = 1 << ZEND_AST_NUM_CHILDREN_SHIFT, + ZEND_AST_CONST, + ZEND_AST_UNPACK, + ZEND_AST_UNARY_PLUS, + ZEND_AST_UNARY_MINUS, + ZEND_AST_CAST, + ZEND_AST_EMPTY, + ZEND_AST_ISSET, + ZEND_AST_SILENCE, + ZEND_AST_SHELL_EXEC, + ZEND_AST_CLONE, + ZEND_AST_EXIT, + ZEND_AST_PRINT, + ZEND_AST_INCLUDE_OR_EVAL, + ZEND_AST_UNARY_OP, + ZEND_AST_PRE_INC, + ZEND_AST_PRE_DEC, + ZEND_AST_POST_INC, + ZEND_AST_POST_DEC, + ZEND_AST_YIELD_FROM, + ZEND_AST_CLASS_NAME, + + ZEND_AST_GLOBAL, + ZEND_AST_UNSET, + ZEND_AST_RETURN, + ZEND_AST_LABEL, + ZEND_AST_REF, + ZEND_AST_HALT_COMPILER, + ZEND_AST_ECHO, + ZEND_AST_THROW, + ZEND_AST_GOTO, + ZEND_AST_BREAK, + ZEND_AST_CONTINUE, + + /* 2 child nodes */ + ZEND_AST_DIM = 2 << ZEND_AST_NUM_CHILDREN_SHIFT, + ZEND_AST_PROP, + ZEND_AST_NULLSAFE_PROP, + ZEND_AST_STATIC_PROP, + ZEND_AST_CALL, + ZEND_AST_CLASS_CONST, + ZEND_AST_ASSIGN, + ZEND_AST_ASSIGN_REF, + ZEND_AST_ASSIGN_OP, + ZEND_AST_BINARY_OP, + ZEND_AST_GREATER, + ZEND_AST_GREATER_EQUAL, + ZEND_AST_AND, + ZEND_AST_OR, + ZEND_AST_ARRAY_ELEM, + ZEND_AST_NEW, + ZEND_AST_INSTANCEOF, + ZEND_AST_YIELD, + ZEND_AST_COALESCE, + ZEND_AST_ASSIGN_COALESCE, + + ZEND_AST_STATIC, + ZEND_AST_WHILE, + ZEND_AST_DO_WHILE, + ZEND_AST_IF_ELEM, + ZEND_AST_SWITCH, + ZEND_AST_SWITCH_CASE, + ZEND_AST_DECLARE, + ZEND_AST_USE_TRAIT, + ZEND_AST_TRAIT_PRECEDENCE, + ZEND_AST_METHOD_REFERENCE, + ZEND_AST_NAMESPACE, + ZEND_AST_USE_ELEM, + ZEND_AST_TRAIT_ALIAS, + ZEND_AST_GROUP_USE, + ZEND_AST_ATTRIBUTE, + ZEND_AST_MATCH, + ZEND_AST_MATCH_ARM, + ZEND_AST_NAMED_ARG, + + /* 3 child nodes */ + ZEND_AST_METHOD_CALL = 3 << ZEND_AST_NUM_CHILDREN_SHIFT, + ZEND_AST_NULLSAFE_METHOD_CALL, + ZEND_AST_STATIC_CALL, + ZEND_AST_CONDITIONAL, + + ZEND_AST_TRY, + ZEND_AST_CATCH, + ZEND_AST_PROP_GROUP, + ZEND_AST_PROP_ELEM, + ZEND_AST_CONST_ELEM, + ZEND_AST_CLASS_CONST_GROUP, + + // Pseudo node for initializing enums + ZEND_AST_CONST_ENUM_INIT, + + /* 4 child nodes */ + ZEND_AST_FOR = 4 << ZEND_AST_NUM_CHILDREN_SHIFT, + ZEND_AST_FOREACH, + ZEND_AST_ENUM_CASE, + + /* 5 child nodes */ + ZEND_AST_PARAM = 5 << ZEND_AST_NUM_CHILDREN_SHIFT, +}; + +typedef uint16_t zend_ast_kind; +typedef uint16_t zend_ast_attr; + +struct _zend_ast { + zend_ast_kind kind; /* Type of the node (ZEND_AST_* enum constant) */ + zend_ast_attr attr; /* Additional attribute, use depending on node type */ + uint32_t lineno; /* Line number */ + zend_ast *child[1]; /* Array of children (using struct hack) */ +}; + +/* Same as zend_ast, but with children count, which is updated dynamically */ +typedef struct _zend_ast_list { + zend_ast_kind kind; + zend_ast_attr attr; + uint32_t lineno; + uint32_t children; + zend_ast *child[1]; +} zend_ast_list; + +/* Lineno is stored in val.u2.lineno */ +typedef struct _zend_ast_zval { + zend_ast_kind kind; + zend_ast_attr attr; + zval val; +} zend_ast_zval; + +/* Separate structure for function and class declaration, as they need extra information. */ +typedef struct _zend_ast_decl { + zend_ast_kind kind; + zend_ast_attr attr; /* Unused - for structure compatibility */ + uint32_t start_lineno; + uint32_t end_lineno; + uint32_t flags; + zend_string *doc_comment; + zend_string *name; + zend_ast *child[5]; +} zend_ast_decl; + +typedef void (*zend_ast_process_t)(zend_ast *ast); +extern ZEND_API zend_ast_process_t zend_ast_process; + +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_zval_with_lineno(zval *zv, uint32_t lineno); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_zval(zval *zv); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_zval_from_str(zend_string *str); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_zval_from_long(zend_long lval); + +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_constant(zend_string *name, zend_ast_attr attr); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_class_const_or_name(zend_ast *class_name, zend_ast *name); + +#if ZEND_AST_SPEC +# define ZEND_AST_SPEC_CALL(name, ...) \ + ZEND_EXPAND_VA(ZEND_AST_SPEC_CALL_(name, __VA_ARGS__, _5, _4, _3, _2, _1, _0)(__VA_ARGS__)) +# define ZEND_AST_SPEC_CALL_(name, _, _5, _4, _3, _2, _1, suffix, ...) \ + name ## suffix +# define ZEND_AST_SPEC_CALL_EX(name, ...) \ + ZEND_EXPAND_VA(ZEND_AST_SPEC_CALL_EX_(name, __VA_ARGS__, _5, _4, _3, _2, _1, _0)(__VA_ARGS__)) +# define ZEND_AST_SPEC_CALL_EX_(name, _, _6, _5, _4, _3, _2, _1, suffix, ...) \ + name ## suffix + +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_0(zend_ast_kind kind); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_1(zend_ast_kind kind, zend_ast *child); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_2(zend_ast_kind kind, zend_ast *child1, zend_ast *child2); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_3(zend_ast_kind kind, zend_ast *child1, zend_ast *child2, zend_ast *child3); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_4(zend_ast_kind kind, zend_ast *child1, zend_ast *child2, zend_ast *child3, zend_ast *child4); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_5(zend_ast_kind kind, zend_ast *child1, zend_ast *child2, zend_ast *child3, zend_ast *child4, zend_ast *child5); + +static zend_always_inline zend_ast * zend_ast_create_ex_0(zend_ast_kind kind, zend_ast_attr attr) { + zend_ast *ast = zend_ast_create_0(kind); + ast->attr = attr; + return ast; +} +static zend_always_inline zend_ast * zend_ast_create_ex_1(zend_ast_kind kind, zend_ast_attr attr, zend_ast *child) { + zend_ast *ast = zend_ast_create_1(kind, child); + ast->attr = attr; + return ast; +} +static zend_always_inline zend_ast * zend_ast_create_ex_2(zend_ast_kind kind, zend_ast_attr attr, zend_ast *child1, zend_ast *child2) { + zend_ast *ast = zend_ast_create_2(kind, child1, child2); + ast->attr = attr; + return ast; +} +static zend_always_inline zend_ast * zend_ast_create_ex_3(zend_ast_kind kind, zend_ast_attr attr, zend_ast *child1, zend_ast *child2, zend_ast *child3) { + zend_ast *ast = zend_ast_create_3(kind, child1, child2, child3); + ast->attr = attr; + return ast; +} +static zend_always_inline zend_ast * zend_ast_create_ex_4(zend_ast_kind kind, zend_ast_attr attr, zend_ast *child1, zend_ast *child2, zend_ast *child3, zend_ast *child4) { + zend_ast *ast = zend_ast_create_4(kind, child1, child2, child3, child4); + ast->attr = attr; + return ast; +} +static zend_always_inline zend_ast * zend_ast_create_ex_5(zend_ast_kind kind, zend_ast_attr attr, zend_ast *child1, zend_ast *child2, zend_ast *child3, zend_ast *child4, zend_ast *child5) { + zend_ast *ast = zend_ast_create_5(kind, child1, child2, child3, child4, child5); + ast->attr = attr; + return ast; +} + +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_list_0(zend_ast_kind kind); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_list_1(zend_ast_kind kind, zend_ast *child); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_list_2(zend_ast_kind kind, zend_ast *child1, zend_ast *child2); + +# define zend_ast_create(...) \ + ZEND_AST_SPEC_CALL(zend_ast_create, __VA_ARGS__) +# define zend_ast_create_ex(...) \ + ZEND_AST_SPEC_CALL_EX(zend_ast_create_ex, __VA_ARGS__) +# define zend_ast_create_list(init_children, ...) \ + ZEND_AST_SPEC_CALL(zend_ast_create_list, __VA_ARGS__) + +#else +ZEND_API zend_ast *zend_ast_create(zend_ast_kind kind, ...); +ZEND_API zend_ast *zend_ast_create_ex(zend_ast_kind kind, zend_ast_attr attr, ...); +ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind kind, ...); +#endif + +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_list_add(zend_ast *list, zend_ast *op); + +ZEND_API zend_ast *zend_ast_create_decl( + zend_ast_kind kind, uint32_t flags, uint32_t start_lineno, zend_string *doc_comment, + zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2, zend_ast *child3, zend_ast *child4 +); + +typedef struct { + bool had_side_effects; +} zend_ast_evaluate_ctx; + +ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope); +ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_ex(zval *result, zend_ast *ast, zend_class_entry *scope, bool *short_circuited_ptr, zend_ast_evaluate_ctx *ctx); +ZEND_API zend_string *zend_ast_export(const char *prefix, zend_ast *ast, const char *suffix); + +ZEND_API zend_ast_ref * ZEND_FASTCALL zend_ast_copy(zend_ast *ast); +ZEND_API void ZEND_FASTCALL zend_ast_destroy(zend_ast *ast); +ZEND_API void ZEND_FASTCALL zend_ast_ref_destroy(zend_ast_ref *ast); + +typedef void (*zend_ast_apply_func)(zend_ast **ast_ptr, void *context); +ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn, void *context); + +static zend_always_inline size_t zend_ast_size(uint32_t children) { + return XtOffsetOf(zend_ast, child) + (sizeof(zend_ast *) * children); +} + +static zend_always_inline bool zend_ast_is_special(zend_ast *ast) { + return (ast->kind >> ZEND_AST_SPECIAL_SHIFT) & 1; +} + +static zend_always_inline bool zend_ast_is_list(zend_ast *ast) { + return (ast->kind >> ZEND_AST_IS_LIST_SHIFT) & 1; +} +static zend_always_inline zend_ast_list *zend_ast_get_list(zend_ast *ast) { + ZEND_ASSERT(zend_ast_is_list(ast)); + return (zend_ast_list *) ast; +} + +static zend_always_inline zval *zend_ast_get_zval(zend_ast *ast) { + ZEND_ASSERT(ast->kind == ZEND_AST_ZVAL); + return &((zend_ast_zval *) ast)->val; +} +static zend_always_inline zend_string *zend_ast_get_str(zend_ast *ast) { + zval *zv = zend_ast_get_zval(ast); + ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING); + return Z_STR_P(zv); +} + +static zend_always_inline zend_string *zend_ast_get_constant_name(zend_ast *ast) { + ZEND_ASSERT(ast->kind == ZEND_AST_CONSTANT); + ZEND_ASSERT(Z_TYPE(((zend_ast_zval *) ast)->val) == IS_STRING); + return Z_STR(((zend_ast_zval *) ast)->val); +} + +static zend_always_inline uint32_t zend_ast_get_num_children(zend_ast *ast) { + ZEND_ASSERT(!zend_ast_is_list(ast)); + return ast->kind >> ZEND_AST_NUM_CHILDREN_SHIFT; +} +static zend_always_inline uint32_t zend_ast_get_lineno(zend_ast *ast) { + if (ast->kind == ZEND_AST_ZVAL) { + zval *zv = zend_ast_get_zval(ast); + return Z_LINENO_P(zv); + } else if (ast->kind == ZEND_AST_CONSTANT) { + zval *zv = &((zend_ast_zval *) ast)->val; + return Z_LINENO_P(zv); + } else { + return ast->lineno; + } +} + +static zend_always_inline zend_ast *zend_ast_create_binary_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) { + return zend_ast_create_ex(ZEND_AST_BINARY_OP, opcode, op0, op1); +} + +zend_ast *zend_ast_create_concat_op(zend_ast *op0, zend_ast *op1); + +static zend_always_inline zend_ast *zend_ast_create_assign_op(uint32_t opcode, zend_ast *op0, zend_ast *op1) { + return zend_ast_create_ex(ZEND_AST_ASSIGN_OP, opcode, op0, op1); +} +static zend_always_inline zend_ast *zend_ast_create_cast(uint32_t type, zend_ast *op0) { + return zend_ast_create_ex(ZEND_AST_CAST, type, op0); +} +static zend_always_inline zend_ast *zend_ast_list_rtrim(zend_ast *ast) { + zend_ast_list *list = zend_ast_get_list(ast); + if (list->children && list->child[list->children - 1] == NULL) { + list->children--; + } + return ast; +} + +zend_ast * ZEND_FASTCALL zend_ast_with_attributes(zend_ast *ast, zend_ast *attr); + +#endif diff --git a/include/php/Zend/zend_atomic.h b/include/php/Zend/zend_atomic.h new file mode 100644 index 0000000..8aab3f1 --- /dev/null +++ b/include/php/Zend/zend_atomic.h @@ -0,0 +1,179 @@ +/* + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Levi Morrison | + +----------------------------------------------------------------------+ + */ + +#ifndef ZEND_ATOMIC_H +#define ZEND_ATOMIC_H + +#include "zend_portability.h" + +#include + +#define ZEND_GCC_PREREQ(x, y) \ + ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || (__GNUC__ > (x))) + +/* Builtins are used to avoid library linkage */ +#if __has_feature(c_atomic) && defined(__clang__) +#define HAVE_C11_ATOMICS 1 +#elif ZEND_GCC_PREREQ(4, 7) +#define HAVE_GNUC_ATOMICS 1 +#elif defined(__GNUC__) +#define HAVE_SYNC_ATOMICS 1 +#elif !defined(ZEND_WIN32) +#define HAVE_NO_ATOMICS 1 +#endif + +#undef ZEND_GCC_PREREQ + +/* Treat zend_atomic_* types as opaque. They have definitions only for size + * and alignment purposes. + */ + +#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) +typedef struct zend_atomic_bool_s { + volatile char value; +} zend_atomic_bool; +#elif defined(HAVE_C11_ATOMICS) +typedef struct zend_atomic_bool_s { + _Atomic(bool) value; +} zend_atomic_bool; +#else +typedef struct zend_atomic_bool_s { + volatile bool value; +} zend_atomic_bool; +#endif + +BEGIN_EXTERN_C() + +#ifdef ZEND_WIN32 + +#ifndef InterlockedExchange8 +#define InterlockedExchange8 _InterlockedExchange8 +#endif +#ifndef InterlockedOr8 +#define InterlockedOr8 _InterlockedOr8 +#endif + +#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired)) + +static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { + return InterlockedExchange8(&obj->value, desired); +} + +/* On this platform it is non-const due to Iterlocked API*/ +static zend_always_inline bool zend_atomic_bool_load_ex(zend_atomic_bool *obj) { + /* Or'ing with false won't change the value. */ + return InterlockedOr8(&obj->value, false); +} + +static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { + (void)InterlockedExchange8(&obj->value, desired); +} + +#elif defined(HAVE_C11_ATOMICS) + +#define ZEND_ATOMIC_BOOL_INIT(obj, desired) __c11_atomic_init(&(obj)->value, (desired)) + +static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { + return __c11_atomic_exchange(&obj->value, desired, __ATOMIC_SEQ_CST); +} + +static zend_always_inline bool zend_atomic_bool_load_ex(const zend_atomic_bool *obj) { + return __c11_atomic_load(&obj->value, __ATOMIC_SEQ_CST); +} + +static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { + __c11_atomic_store(&obj->value, desired, __ATOMIC_SEQ_CST); +} + +#elif defined(HAVE_GNUC_ATOMICS) + +#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired)) + +static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { + bool prev = false; + __atomic_exchange(&obj->value, &desired, &prev, __ATOMIC_SEQ_CST); + return prev; +} + +static zend_always_inline bool zend_atomic_bool_load_ex(const zend_atomic_bool *obj) { + bool prev = false; + __atomic_load(&obj->value, &prev, __ATOMIC_SEQ_CST); + return prev; +} + +static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { + __atomic_store(&obj->value, &desired, __ATOMIC_SEQ_CST); +} + +#elif defined(HAVE_SYNC_ATOMICS) + +#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired)) + +static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { + bool prev = __sync_lock_test_and_set(&obj->value, desired); + + /* __sync_lock_test_and_set only does an acquire barrier, so sync + * immediately after. + */ + __sync_synchronize(); + return prev; +} + +static zend_always_inline bool zend_atomic_bool_load_ex(zend_atomic_bool *obj) { + /* Or'ing false won't change the value */ + return __sync_fetch_and_or(&obj->value, false); +} + +static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { + __sync_synchronize(); + obj->value = desired; + __sync_synchronize(); +} + +#elif defined(HAVE_NO_ATOMICS) + +#warning No atomics support detected. Please open an issue with platform details. + +#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired)) + +static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj, bool desired) { + obj->value = desired; +} + +static zend_always_inline bool zend_atomic_bool_load_ex(const zend_atomic_bool *obj) { + return obj->value; +} + +static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) { + bool prev = obj->value; + obj->value = desired; + return prev; +} + +#endif + +ZEND_API void zend_atomic_bool_init(zend_atomic_bool *obj, bool desired); +ZEND_API bool zend_atomic_bool_exchange(zend_atomic_bool *obj, bool desired); +ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj, bool desired); + +#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) +/* On these platforms it is non-const due to underlying APIs. */ +ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj); +#else +ZEND_API bool zend_atomic_bool_load(const zend_atomic_bool *obj); +#endif + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_attributes.h b/include/php/Zend/zend_attributes.h new file mode 100644 index 0000000..f8635aa --- /dev/null +++ b/include/php/Zend/zend_attributes.h @@ -0,0 +1,124 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Benjamin Eberlei | + | Martin Schröder | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_ATTRIBUTES_H +#define ZEND_ATTRIBUTES_H + +#define ZEND_ATTRIBUTE_TARGET_CLASS (1<<0) +#define ZEND_ATTRIBUTE_TARGET_FUNCTION (1<<1) +#define ZEND_ATTRIBUTE_TARGET_METHOD (1<<2) +#define ZEND_ATTRIBUTE_TARGET_PROPERTY (1<<3) +#define ZEND_ATTRIBUTE_TARGET_CLASS_CONST (1<<4) +#define ZEND_ATTRIBUTE_TARGET_PARAMETER (1<<5) +#define ZEND_ATTRIBUTE_TARGET_ALL ((1<<6) - 1) +#define ZEND_ATTRIBUTE_IS_REPEATABLE (1<<6) +#define ZEND_ATTRIBUTE_FLAGS ((1<<7) - 1) + +/* Flags for zend_attribute.flags */ +#define ZEND_ATTRIBUTE_PERSISTENT (1<<0) +#define ZEND_ATTRIBUTE_STRICT_TYPES (1<<1) + +#define ZEND_ATTRIBUTE_SIZE(argc) \ + (sizeof(zend_attribute) + sizeof(zend_attribute_arg) * (argc) - sizeof(zend_attribute_arg)) + +BEGIN_EXTERN_C() + +extern ZEND_API zend_class_entry *zend_ce_attribute; +extern ZEND_API zend_class_entry *zend_ce_allow_dynamic_properties; +extern ZEND_API zend_class_entry *zend_ce_sensitive_parameter; +extern ZEND_API zend_class_entry *zend_ce_sensitive_parameter_value; +extern ZEND_API zend_class_entry *zend_ce_override; + +typedef struct { + zend_string *name; + zval value; +} zend_attribute_arg; + +typedef struct _zend_attribute { + zend_string *name; + zend_string *lcname; + uint32_t flags; + uint32_t lineno; + /* Parameter offsets start at 1, everything else uses 0. */ + uint32_t offset; + uint32_t argc; + zend_attribute_arg args[1]; +} zend_attribute; + +typedef struct _zend_internal_attribute { + zend_class_entry *ce; + uint32_t flags; + void (*validator)(zend_attribute *attr, uint32_t target, zend_class_entry *scope); +} zend_internal_attribute; + +ZEND_API zend_attribute *zend_get_attribute(HashTable *attributes, zend_string *lcname); +ZEND_API zend_attribute *zend_get_attribute_str(HashTable *attributes, const char *str, size_t len); + +ZEND_API zend_attribute *zend_get_parameter_attribute(HashTable *attributes, zend_string *lcname, uint32_t offset); +ZEND_API zend_attribute *zend_get_parameter_attribute_str(HashTable *attributes, const char *str, size_t len, uint32_t offset); + +ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_class_entry *scope); + +ZEND_API zend_string *zend_get_attribute_target_names(uint32_t targets); +ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr); + +ZEND_API zend_internal_attribute *zend_mark_internal_attribute(zend_class_entry *ce); +ZEND_API zend_internal_attribute *zend_internal_attribute_register(zend_class_entry *ce, uint32_t flags); +ZEND_API zend_internal_attribute *zend_internal_attribute_get(zend_string *lcname); + +ZEND_API zend_attribute *zend_add_attribute( + HashTable **attributes, zend_string *name, uint32_t argc, + uint32_t flags, uint32_t offset, uint32_t lineno); + +END_EXTERN_C() + +static zend_always_inline zend_attribute *zend_add_class_attribute(zend_class_entry *ce, zend_string *name, uint32_t argc) +{ + uint32_t flags = ce->type != ZEND_USER_CLASS ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&ce->attributes, name, argc, flags, 0, 0); +} + +static zend_always_inline zend_attribute *zend_add_function_attribute(zend_function *func, zend_string *name, uint32_t argc) +{ + uint32_t flags = func->common.type != ZEND_USER_FUNCTION ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&func->common.attributes, name, argc, flags, 0, 0); +} + +static zend_always_inline zend_attribute *zend_add_parameter_attribute(zend_function *func, uint32_t offset, zend_string *name, uint32_t argc) +{ + uint32_t flags = func->common.type != ZEND_USER_FUNCTION ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&func->common.attributes, name, argc, flags, offset + 1, 0); +} + +static zend_always_inline zend_attribute *zend_add_property_attribute(zend_class_entry *ce, zend_property_info *info, zend_string *name, uint32_t argc) +{ + uint32_t flags = ce->type != ZEND_USER_CLASS ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&info->attributes, name, argc, flags, 0, 0); +} + +static zend_always_inline zend_attribute *zend_add_class_constant_attribute(zend_class_entry *ce, zend_class_constant *c, zend_string *name, uint32_t argc) +{ + uint32_t flags = ce->type != ZEND_USER_CLASS ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&c->attributes, name, argc, flags, 0, 0); +} + +void zend_register_attribute_ce(void); +void zend_attributes_shutdown(void); + +#endif diff --git a/include/php/Zend/zend_attributes_arginfo.h b/include/php/Zend/zend_attributes_arginfo.h new file mode 100644 index 0000000..3f0b857 --- /dev/null +++ b/include/php/Zend/zend_attributes_arginfo.h @@ -0,0 +1,234 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 32f0458c20f04099e353a8300ffb19e40bc38f69 */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Attribute___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "Attribute::TARGET_ALL") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReturnTypeWillChange___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_AllowDynamicProperties___construct arginfo_class_ReturnTypeWillChange___construct + +#define arginfo_class_SensitiveParameter___construct arginfo_class_ReturnTypeWillChange___construct + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SensitiveParameterValue___construct, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SensitiveParameterValue_getValue, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SensitiveParameterValue___debugInfo, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Override___construct arginfo_class_ReturnTypeWillChange___construct + + +ZEND_METHOD(Attribute, __construct); +ZEND_METHOD(ReturnTypeWillChange, __construct); +ZEND_METHOD(AllowDynamicProperties, __construct); +ZEND_METHOD(SensitiveParameter, __construct); +ZEND_METHOD(SensitiveParameterValue, __construct); +ZEND_METHOD(SensitiveParameterValue, getValue); +ZEND_METHOD(SensitiveParameterValue, __debugInfo); +ZEND_METHOD(Override, __construct); + + +static const zend_function_entry class_Attribute_methods[] = { + ZEND_ME(Attribute, __construct, arginfo_class_Attribute___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_ReturnTypeWillChange_methods[] = { + ZEND_ME(ReturnTypeWillChange, __construct, arginfo_class_ReturnTypeWillChange___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_AllowDynamicProperties_methods[] = { + ZEND_ME(AllowDynamicProperties, __construct, arginfo_class_AllowDynamicProperties___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_SensitiveParameter_methods[] = { + ZEND_ME(SensitiveParameter, __construct, arginfo_class_SensitiveParameter___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_SensitiveParameterValue_methods[] = { + ZEND_ME(SensitiveParameterValue, __construct, arginfo_class_SensitiveParameterValue___construct, ZEND_ACC_PUBLIC) + ZEND_ME(SensitiveParameterValue, getValue, arginfo_class_SensitiveParameterValue_getValue, ZEND_ACC_PUBLIC) + ZEND_ME(SensitiveParameterValue, __debugInfo, arginfo_class_SensitiveParameterValue___debugInfo, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_Override_methods[] = { + ZEND_ME(Override, __construct, arginfo_class_Override___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static zend_class_entry *register_class_Attribute(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Attribute", class_Attribute_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL; + + zval const_TARGET_CLASS_value; + ZVAL_LONG(&const_TARGET_CLASS_value, ZEND_ATTRIBUTE_TARGET_CLASS); + zend_string *const_TARGET_CLASS_name = zend_string_init_interned("TARGET_CLASS", sizeof("TARGET_CLASS") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_TARGET_CLASS_name, &const_TARGET_CLASS_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_TARGET_CLASS_name); + + zval const_TARGET_FUNCTION_value; + ZVAL_LONG(&const_TARGET_FUNCTION_value, ZEND_ATTRIBUTE_TARGET_FUNCTION); + zend_string *const_TARGET_FUNCTION_name = zend_string_init_interned("TARGET_FUNCTION", sizeof("TARGET_FUNCTION") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_TARGET_FUNCTION_name, &const_TARGET_FUNCTION_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_TARGET_FUNCTION_name); + + zval const_TARGET_METHOD_value; + ZVAL_LONG(&const_TARGET_METHOD_value, ZEND_ATTRIBUTE_TARGET_METHOD); + zend_string *const_TARGET_METHOD_name = zend_string_init_interned("TARGET_METHOD", sizeof("TARGET_METHOD") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_TARGET_METHOD_name, &const_TARGET_METHOD_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_TARGET_METHOD_name); + + zval const_TARGET_PROPERTY_value; + ZVAL_LONG(&const_TARGET_PROPERTY_value, ZEND_ATTRIBUTE_TARGET_PROPERTY); + zend_string *const_TARGET_PROPERTY_name = zend_string_init_interned("TARGET_PROPERTY", sizeof("TARGET_PROPERTY") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_TARGET_PROPERTY_name, &const_TARGET_PROPERTY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_TARGET_PROPERTY_name); + + zval const_TARGET_CLASS_CONSTANT_value; + ZVAL_LONG(&const_TARGET_CLASS_CONSTANT_value, ZEND_ATTRIBUTE_TARGET_CLASS_CONST); + zend_string *const_TARGET_CLASS_CONSTANT_name = zend_string_init_interned("TARGET_CLASS_CONSTANT", sizeof("TARGET_CLASS_CONSTANT") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_TARGET_CLASS_CONSTANT_name, &const_TARGET_CLASS_CONSTANT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_TARGET_CLASS_CONSTANT_name); + + zval const_TARGET_PARAMETER_value; + ZVAL_LONG(&const_TARGET_PARAMETER_value, ZEND_ATTRIBUTE_TARGET_PARAMETER); + zend_string *const_TARGET_PARAMETER_name = zend_string_init_interned("TARGET_PARAMETER", sizeof("TARGET_PARAMETER") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_TARGET_PARAMETER_name, &const_TARGET_PARAMETER_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_TARGET_PARAMETER_name); + + zval const_TARGET_ALL_value; + ZVAL_LONG(&const_TARGET_ALL_value, ZEND_ATTRIBUTE_TARGET_ALL); + zend_string *const_TARGET_ALL_name = zend_string_init_interned("TARGET_ALL", sizeof("TARGET_ALL") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_TARGET_ALL_name, &const_TARGET_ALL_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_TARGET_ALL_name); + + zval const_IS_REPEATABLE_value; + ZVAL_LONG(&const_IS_REPEATABLE_value, ZEND_ATTRIBUTE_IS_REPEATABLE); + zend_string *const_IS_REPEATABLE_name = zend_string_init_interned("IS_REPEATABLE", sizeof("IS_REPEATABLE") - 1, 1); + zend_declare_typed_class_constant(class_entry, const_IS_REPEATABLE_name, &const_IS_REPEATABLE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(const_IS_REPEATABLE_name); + + zval property_flags_default_value; + ZVAL_UNDEF(&property_flags_default_value); + zend_string *property_flags_name = zend_string_init("flags", sizeof("flags") - 1, 1); + zend_declare_typed_property(class_entry, property_flags_name, &property_flags_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(property_flags_name); + + zend_string *attribute_name_Attribute_class_Attribute_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_attribute *attribute_Attribute_class_Attribute_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_Attribute_0, 1); + zend_string_release(attribute_name_Attribute_class_Attribute_0); + zval attribute_Attribute_class_Attribute_0_arg0; + ZVAL_LONG(&attribute_Attribute_class_Attribute_0_arg0, ZEND_ATTRIBUTE_TARGET_CLASS); + ZVAL_COPY_VALUE(&attribute_Attribute_class_Attribute_0->args[0].value, &attribute_Attribute_class_Attribute_0_arg0); + + return class_entry; +} + +static zend_class_entry *register_class_ReturnTypeWillChange(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ReturnTypeWillChange", class_ReturnTypeWillChange_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL; + + zend_string *attribute_name_Attribute_class_ReturnTypeWillChange_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_attribute *attribute_Attribute_class_ReturnTypeWillChange_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_ReturnTypeWillChange_0, 1); + zend_string_release(attribute_name_Attribute_class_ReturnTypeWillChange_0); + zval attribute_Attribute_class_ReturnTypeWillChange_0_arg0; + ZVAL_LONG(&attribute_Attribute_class_ReturnTypeWillChange_0_arg0, ZEND_ATTRIBUTE_TARGET_METHOD); + ZVAL_COPY_VALUE(&attribute_Attribute_class_ReturnTypeWillChange_0->args[0].value, &attribute_Attribute_class_ReturnTypeWillChange_0_arg0); + + return class_entry; +} + +static zend_class_entry *register_class_AllowDynamicProperties(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "AllowDynamicProperties", class_AllowDynamicProperties_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL; + + zend_string *attribute_name_Attribute_class_AllowDynamicProperties_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_attribute *attribute_Attribute_class_AllowDynamicProperties_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_AllowDynamicProperties_0, 1); + zend_string_release(attribute_name_Attribute_class_AllowDynamicProperties_0); + zval attribute_Attribute_class_AllowDynamicProperties_0_arg0; + ZVAL_LONG(&attribute_Attribute_class_AllowDynamicProperties_0_arg0, ZEND_ATTRIBUTE_TARGET_CLASS); + ZVAL_COPY_VALUE(&attribute_Attribute_class_AllowDynamicProperties_0->args[0].value, &attribute_Attribute_class_AllowDynamicProperties_0_arg0); + + return class_entry; +} + +static zend_class_entry *register_class_SensitiveParameter(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "SensitiveParameter", class_SensitiveParameter_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + + zend_string *attribute_name_Attribute_class_SensitiveParameter_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_attribute *attribute_Attribute_class_SensitiveParameter_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_SensitiveParameter_0, 1); + zend_string_release(attribute_name_Attribute_class_SensitiveParameter_0); + zval attribute_Attribute_class_SensitiveParameter_0_arg0; + ZVAL_LONG(&attribute_Attribute_class_SensitiveParameter_0_arg0, ZEND_ATTRIBUTE_TARGET_PARAMETER); + ZVAL_COPY_VALUE(&attribute_Attribute_class_SensitiveParameter_0->args[0].value, &attribute_Attribute_class_SensitiveParameter_0_arg0); + + return class_entry; +} + +static zend_class_entry *register_class_SensitiveParameterValue(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "SensitiveParameterValue", class_SensitiveParameterValue_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; + + zval property_value_default_value; + ZVAL_UNDEF(&property_value_default_value); + zend_string *property_value_name = zend_string_init("value", sizeof("value") - 1, 1); + zend_declare_typed_property(class_entry, property_value_name, &property_value_default_value, ZEND_ACC_PRIVATE|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); + zend_string_release(property_value_name); + + return class_entry; +} + +static zend_class_entry *register_class_Override(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Override", class_Override_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + + zend_string *attribute_name_Attribute_class_Override_0 = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1); + zend_attribute *attribute_Attribute_class_Override_0 = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_Override_0, 1); + zend_string_release(attribute_name_Attribute_class_Override_0); + zval attribute_Attribute_class_Override_0_arg0; + ZVAL_LONG(&attribute_Attribute_class_Override_0_arg0, ZEND_ATTRIBUTE_TARGET_METHOD); + ZVAL_COPY_VALUE(&attribute_Attribute_class_Override_0->args[0].value, &attribute_Attribute_class_Override_0_arg0); + + return class_entry; +} diff --git a/include/php/Zend/zend_bitset.h b/include/php/Zend/zend_bitset.h new file mode 100644 index 0000000..262fab2 --- /dev/null +++ b/include/php/Zend/zend_bitset.h @@ -0,0 +1,301 @@ +/* + +----------------------------------------------------------------------+ + | Zend OPcache JIT | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef _ZEND_BITSET_H_ +#define _ZEND_BITSET_H_ + +#include +#include +#include + +#include "zend_portability.h" +#include "zend_long.h" + +typedef zend_ulong *zend_bitset; + +#define ZEND_BITSET_ELM_SIZE sizeof(zend_ulong) + +#if SIZEOF_ZEND_LONG == 4 +# define ZEND_BITSET_ELM_NUM(n) ((n) >> 5) +# define ZEND_BITSET_BIT_NUM(n) ((zend_ulong)(n) & Z_UL(0x1f)) +#elif SIZEOF_ZEND_LONG == 8 +# define ZEND_BITSET_ELM_NUM(n) ((n) >> 6) +# define ZEND_BITSET_BIT_NUM(n) ((zend_ulong)(n) & Z_UL(0x3f)) +#else +# define ZEND_BITSET_ELM_NUM(n) ((n) / (sizeof(zend_long) * 8)) +# define ZEND_BITSET_BIT_NUM(n) ((n) % (sizeof(zend_long) * 8)) +#endif + +#define ZEND_BITSET_ALLOCA(n, use_heap) \ + (zend_bitset)do_alloca((n) * ZEND_BITSET_ELM_SIZE, use_heap) + +/* Number of trailing zero bits (0x01 -> 0; 0x40 -> 6; 0x00 -> LEN) */ +static zend_always_inline int zend_ulong_ntz(zend_ulong num) +{ +#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) \ + && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL) + return __builtin_ctzl(num); +#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL) + return __builtin_ctzll(num); +#elif defined(_WIN32) + unsigned long index; + +#if defined(_WIN64) + if (!BitScanForward64(&index, num)) { +#else + if (!BitScanForward(&index, num)) { +#endif + /* undefined behavior */ + return SIZEOF_ZEND_LONG * 8; + } + + return (int) index; +#else + int n; + + if (num == Z_UL(0)) return SIZEOF_ZEND_LONG * 8; + + n = 1; +#if SIZEOF_ZEND_LONG == 8 + if ((num & 0xffffffff) == 0) {n += 32; num = num >> Z_UL(32);} +#endif + if ((num & 0x0000ffff) == 0) {n += 16; num = num >> 16;} + if ((num & 0x000000ff) == 0) {n += 8; num = num >> 8;} + if ((num & 0x0000000f) == 0) {n += 4; num = num >> 4;} + if ((num & 0x00000003) == 0) {n += 2; num = num >> 2;} + return n - (num & 1); +#endif +} + +/* Number of leading zero bits (Undefined for zero) */ +static zend_always_inline int zend_ulong_nlz(zend_ulong num) +{ +#if (defined(__GNUC__) || __has_builtin(__builtin_clzl)) \ + && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CLZL) + return __builtin_clzl(num); +#elif (defined(__GNUC__) || __has_builtin(__builtin_clzll)) && defined(PHP_HAVE_BUILTIN_CLZLL) + return __builtin_clzll(num); +#elif defined(_WIN32) + unsigned long index; + +#if defined(_WIN64) + if (!BitScanReverse64(&index, num)) { +#else + if (!BitScanReverse(&index, num)) { +#endif + /* undefined behavior */ + return SIZEOF_ZEND_LONG * 8; + } + + return (int) (SIZEOF_ZEND_LONG * 8 - 1)- index; +#else + zend_ulong x; + int n; + +#if SIZEOF_ZEND_LONG == 8 + n = 64; + x = num >> 32; if (x != 0) {n -= 32; num = x;} +#else + n = 32; +#endif + x = num >> 16; if (x != 0) {n -= 16; num = x;} + x = num >> 8; if (x != 0) {n -= 8; num = x;} + x = num >> 4; if (x != 0) {n -= 4; num = x;} + x = num >> 2; if (x != 0) {n -= 2; num = x;} + x = num >> 1; if (x != 0) return n - 2; + return n - num; +#endif +} + +/* Returns the number of zend_ulong words needed to store a bitset that is N + bits long. */ +static inline uint32_t zend_bitset_len(uint32_t n) +{ + return (n + ((sizeof(zend_long) * 8) - 1)) / (sizeof(zend_long) * 8); +} + +static inline bool zend_bitset_in(zend_bitset set, uint32_t n) +{ + return ZEND_BIT_TEST(set, n); +} + +static inline void zend_bitset_incl(zend_bitset set, uint32_t n) +{ + set[ZEND_BITSET_ELM_NUM(n)] |= Z_UL(1) << ZEND_BITSET_BIT_NUM(n); +} + +static inline void zend_bitset_excl(zend_bitset set, uint32_t n) +{ + set[ZEND_BITSET_ELM_NUM(n)] &= ~(Z_UL(1) << ZEND_BITSET_BIT_NUM(n)); +} + +static inline void zend_bitset_clear(zend_bitset set, uint32_t len) +{ + memset(set, 0, len * ZEND_BITSET_ELM_SIZE); +} + +static inline bool zend_bitset_empty(zend_bitset set, uint32_t len) +{ + uint32_t i; + for (i = 0; i < len; i++) { + if (set[i]) { + return 0; + } + } + return 1; +} + +static inline void zend_bitset_fill(zend_bitset set, uint32_t len) +{ + memset(set, 0xff, len * ZEND_BITSET_ELM_SIZE); +} + +static inline bool zend_bitset_equal(zend_bitset set1, zend_bitset set2, uint32_t len) +{ + return memcmp(set1, set2, len * ZEND_BITSET_ELM_SIZE) == 0; +} + +static inline void zend_bitset_copy(zend_bitset set1, zend_bitset set2, uint32_t len) +{ + memcpy(set1, set2, len * ZEND_BITSET_ELM_SIZE); +} + +static inline void zend_bitset_intersection(zend_bitset set1, zend_bitset set2, uint32_t len) +{ + uint32_t i; + + for (i = 0; i < len; i++) { + set1[i] &= set2[i]; + } +} + +static inline void zend_bitset_union(zend_bitset set1, zend_bitset set2, uint32_t len) +{ + uint32_t i; + + for (i = 0; i < len; i++) { + set1[i] |= set2[i]; + } +} + +static inline void zend_bitset_difference(zend_bitset set1, zend_bitset set2, uint32_t len) +{ + uint32_t i; + + for (i = 0; i < len; i++) { + set1[i] = set1[i] & ~set2[i]; + } +} + +static inline void zend_bitset_union_with_intersection(zend_bitset set1, zend_bitset set2, zend_bitset set3, zend_bitset set4, uint32_t len) +{ + uint32_t i; + + for (i = 0; i < len; i++) { + set1[i] = set2[i] | (set3[i] & set4[i]); + } +} + +static inline void zend_bitset_union_with_difference(zend_bitset set1, zend_bitset set2, zend_bitset set3, zend_bitset set4, uint32_t len) +{ + uint32_t i; + + for (i = 0; i < len; i++) { + set1[i] = set2[i] | (set3[i] & ~set4[i]); + } +} + +static inline bool zend_bitset_subset(zend_bitset set1, zend_bitset set2, uint32_t len) +{ + uint32_t i; + + for (i = 0; i < len; i++) { + if (set1[i] & ~set2[i]) { + return 0; + } + } + return 1; +} + +static inline int zend_bitset_first(zend_bitset set, uint32_t len) +{ + uint32_t i; + + for (i = 0; i < len; i++) { + if (set[i]) { + return ZEND_BITSET_ELM_SIZE * 8 * i + zend_ulong_ntz(set[i]); + } + } + return -1; /* empty set */ +} + +static inline int zend_bitset_last(zend_bitset set, uint32_t len) +{ + uint32_t i = len; + + while (i > 0) { + i--; + if (set[i]) { + int j = ZEND_BITSET_ELM_SIZE * 8 * i - 1; + zend_ulong x = set[i]; + while (x != Z_UL(0)) { + x = x >> Z_UL(1); + j++; + } + return j; + } + } + return -1; /* empty set */ +} + +#define ZEND_BITSET_FOREACH(set, len, bit) do { \ + zend_bitset _set = (set); \ + uint32_t _i, _len = (len); \ + for (_i = 0; _i < _len; _i++) { \ + zend_ulong _x = _set[_i]; \ + if (_x) { \ + (bit) = ZEND_BITSET_ELM_SIZE * 8 * _i; \ + for (; _x != 0; _x >>= Z_UL(1), (bit)++) { \ + if (!(_x & Z_UL(1))) continue; + +#define ZEND_BITSET_REVERSE_FOREACH(set, len, bit) do { \ + zend_bitset _set = (set); \ + uint32_t _i = (len); \ + zend_ulong _test = Z_UL(1) << (ZEND_BITSET_ELM_SIZE * 8 - 1); \ + while (_i-- > 0) { \ + zend_ulong _x = _set[_i]; \ + if (_x) { \ + (bit) = ZEND_BITSET_ELM_SIZE * 8 * (_i + 1) - 1; \ + for (; _x != 0; _x <<= Z_UL(1), (bit)--) { \ + if (!(_x & _test)) continue; \ + +#define ZEND_BITSET_FOREACH_END() \ + } \ + } \ + } \ +} while (0) + +static inline int zend_bitset_pop_first(zend_bitset set, uint32_t len) { + int i = zend_bitset_first(set, len); + if (i >= 0) { + zend_bitset_excl(set, i); + } + return i; +} + +#endif /* _ZEND_BITSET_H_ */ diff --git a/include/php/Zend/zend_build.h b/include/php/Zend/zend_build.h new file mode 100644 index 0000000..c604fb3 --- /dev/null +++ b/include/php/Zend/zend_build.h @@ -0,0 +1,46 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Stanislav Malyshev | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_BUILD_H +#define ZEND_BUILD_H + +#define ZEND_TOSTR_(x) #x +#define ZEND_TOSTR(x) ZEND_TOSTR_(x) + +#ifdef ZTS +#define ZEND_BUILD_TS ",TS" +#else +#define ZEND_BUILD_TS ",NTS" +#endif + +#if ZEND_DEBUG +#define ZEND_BUILD_DEBUG ",debug" +#else +#define ZEND_BUILD_DEBUG +#endif + +#if defined(ZEND_WIN32) && defined(PHP_COMPILER_ID) +#define ZEND_BUILD_SYSTEM "," PHP_COMPILER_ID +#else +#define ZEND_BUILD_SYSTEM +#endif + +/* for private applications */ +#define ZEND_BUILD_EXTRA + +#endif diff --git a/include/php/Zend/zend_builtin_functions.h b/include/php/Zend/zend_builtin_functions.h new file mode 100644 index 0000000..a49dab1 --- /dev/null +++ b/include/php/Zend/zend_builtin_functions.h @@ -0,0 +1,29 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_BUILTIN_FUNCTIONS_H +#define ZEND_BUILTIN_FUNCTIONS_H + +zend_result zend_startup_builtin_functions(void); + +BEGIN_EXTERN_C() +ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit); +END_EXTERN_C() + +#endif /* ZEND_BUILTIN_FUNCTIONS_H */ diff --git a/include/php/Zend/zend_builtin_functions_arginfo.h b/include/php/Zend/zend_builtin_functions_arginfo.h new file mode 100644 index 0000000..aa28fd4 --- /dev/null +++ b/include/php/Zend/zend_builtin_functions_arginfo.h @@ -0,0 +1,363 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 12899073f3791c5da31aa555c0e612ee1faadf55 */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_func_num_args, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_func_get_arg, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_func_get_args, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strlen, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strcmp, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strncmp, 0, 3, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_strcasecmp arginfo_strcmp + +#define arginfo_strncasecmp arginfo_strncmp + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_error_reporting, 0, 0, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_level, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_define, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, constant_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, case_insensitive, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_defined, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, constant_name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_class, 0, 0, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0) +ZEND_END_ARG_INFO() + +#define arginfo_get_called_class arginfo_zend_version + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_parent_class, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_MASK(0, object_or_class, MAY_BE_OBJECT|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_subclass_of, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, object_or_class, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, allow_string, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_a, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, object_or_class, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, allow_string, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_class_vars, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_object_vars, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0) +ZEND_END_ARG_INFO() + +#define arginfo_get_mangled_object_vars arginfo_get_object_vars + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_class_methods, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_MASK(0, object_or_class, MAY_BE_OBJECT|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_method_exists, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, object_or_class) + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_property_exists, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, object_or_class) + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_exists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, autoload, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interface_exists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, interface, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, autoload, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_trait_exists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, trait, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, autoload, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enum_exists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, enum, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, autoload, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_exists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, function, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_alias, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, autoload, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +#define arginfo_get_included_files arginfo_func_get_args + +#define arginfo_get_required_files arginfo_func_get_args + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_trigger_error, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_level, IS_LONG, 0, "E_USER_NOTICE") +ZEND_END_ARG_INFO() + +#define arginfo_user_error arginfo_trigger_error + +ZEND_BEGIN_ARG_INFO_EX(arginfo_set_error_handler, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_levels, IS_LONG, 0, "E_ALL") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_restore_error_handler, 0, 0, IS_TRUE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_set_exception_handler, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) +ZEND_END_ARG_INFO() + +#define arginfo_restore_exception_handler arginfo_restore_error_handler + +#define arginfo_get_declared_classes arginfo_func_get_args + +#define arginfo_get_declared_traits arginfo_func_get_args + +#define arginfo_get_declared_interfaces arginfo_func_get_args + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_defined_functions, 0, 0, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, exclude_disabled, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +#define arginfo_get_defined_vars arginfo_func_get_args + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_resource_type, 0, 1, IS_STRING, 0) + ZEND_ARG_INFO(0, resource) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_resource_id, 0, 1, IS_LONG, 0) + ZEND_ARG_INFO(0, resource) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_resources, 0, 0, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_loaded_extensions, 0, 0, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, zend_extensions, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_defined_constants, 0, 0, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, categorize, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_debug_backtrace, 0, 0, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "DEBUG_BACKTRACE_PROVIDE_OBJECT") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, limit, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_debug_print_backtrace, 0, 0, IS_VOID, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, limit, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_extension_loaded, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, extension, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_extension_funcs, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, extension, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#if ZEND_DEBUG && defined(ZTS) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_thread_id, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +#define arginfo_gc_mem_caches arginfo_func_num_args + +#define arginfo_gc_collect_cycles arginfo_func_num_args + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gc_enabled, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gc_enable, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +#define arginfo_gc_disable arginfo_gc_enable + +#define arginfo_gc_status arginfo_func_get_args + + +ZEND_FUNCTION(zend_version); +ZEND_FUNCTION(func_num_args); +ZEND_FUNCTION(func_get_arg); +ZEND_FUNCTION(func_get_args); +ZEND_FUNCTION(strlen); +ZEND_FUNCTION(strcmp); +ZEND_FUNCTION(strncmp); +ZEND_FUNCTION(strcasecmp); +ZEND_FUNCTION(strncasecmp); +ZEND_FUNCTION(error_reporting); +ZEND_FUNCTION(define); +ZEND_FUNCTION(defined); +ZEND_FUNCTION(get_class); +ZEND_FUNCTION(get_called_class); +ZEND_FUNCTION(get_parent_class); +ZEND_FUNCTION(is_subclass_of); +ZEND_FUNCTION(is_a); +ZEND_FUNCTION(get_class_vars); +ZEND_FUNCTION(get_object_vars); +ZEND_FUNCTION(get_mangled_object_vars); +ZEND_FUNCTION(get_class_methods); +ZEND_FUNCTION(method_exists); +ZEND_FUNCTION(property_exists); +ZEND_FUNCTION(class_exists); +ZEND_FUNCTION(interface_exists); +ZEND_FUNCTION(trait_exists); +ZEND_FUNCTION(enum_exists); +ZEND_FUNCTION(function_exists); +ZEND_FUNCTION(class_alias); +ZEND_FUNCTION(get_included_files); +ZEND_FUNCTION(trigger_error); +ZEND_FUNCTION(set_error_handler); +ZEND_FUNCTION(restore_error_handler); +ZEND_FUNCTION(set_exception_handler); +ZEND_FUNCTION(restore_exception_handler); +ZEND_FUNCTION(get_declared_classes); +ZEND_FUNCTION(get_declared_traits); +ZEND_FUNCTION(get_declared_interfaces); +ZEND_FUNCTION(get_defined_functions); +ZEND_FUNCTION(get_defined_vars); +ZEND_FUNCTION(get_resource_type); +ZEND_FUNCTION(get_resource_id); +ZEND_FUNCTION(get_resources); +ZEND_FUNCTION(get_loaded_extensions); +ZEND_FUNCTION(get_defined_constants); +ZEND_FUNCTION(debug_backtrace); +ZEND_FUNCTION(debug_print_backtrace); +ZEND_FUNCTION(extension_loaded); +ZEND_FUNCTION(get_extension_funcs); +#if ZEND_DEBUG && defined(ZTS) +ZEND_FUNCTION(zend_thread_id); +#endif +ZEND_FUNCTION(gc_mem_caches); +ZEND_FUNCTION(gc_collect_cycles); +ZEND_FUNCTION(gc_enabled); +ZEND_FUNCTION(gc_enable); +ZEND_FUNCTION(gc_disable); +ZEND_FUNCTION(gc_status); + + +static const zend_function_entry ext_functions[] = { + ZEND_FE(zend_version, arginfo_zend_version) + ZEND_FE(func_num_args, arginfo_func_num_args) + ZEND_FE(func_get_arg, arginfo_func_get_arg) + ZEND_FE(func_get_args, arginfo_func_get_args) + ZEND_FE(strlen, arginfo_strlen) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strcmp, arginfo_strcmp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strncmp, arginfo_strncmp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strcasecmp, arginfo_strcasecmp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strncasecmp, arginfo_strncasecmp) + ZEND_FE(error_reporting, arginfo_error_reporting) + ZEND_FE(define, arginfo_define) + ZEND_FE(defined, arginfo_defined) + ZEND_FE(get_class, arginfo_get_class) + ZEND_FE(get_called_class, arginfo_get_called_class) + ZEND_FE(get_parent_class, arginfo_get_parent_class) + ZEND_FE(is_subclass_of, arginfo_is_subclass_of) + ZEND_FE(is_a, arginfo_is_a) + ZEND_FE(get_class_vars, arginfo_get_class_vars) + ZEND_FE(get_object_vars, arginfo_get_object_vars) + ZEND_FE(get_mangled_object_vars, arginfo_get_mangled_object_vars) + ZEND_FE(get_class_methods, arginfo_get_class_methods) + ZEND_FE(method_exists, arginfo_method_exists) + ZEND_FE(property_exists, arginfo_property_exists) + ZEND_FE(class_exists, arginfo_class_exists) + ZEND_FE(interface_exists, arginfo_interface_exists) + ZEND_FE(trait_exists, arginfo_trait_exists) + ZEND_FE(enum_exists, arginfo_enum_exists) + ZEND_FE(function_exists, arginfo_function_exists) + ZEND_FE(class_alias, arginfo_class_alias) + ZEND_FE(get_included_files, arginfo_get_included_files) + ZEND_FALIAS(get_required_files, get_included_files, arginfo_get_required_files) + ZEND_FE(trigger_error, arginfo_trigger_error) + ZEND_FALIAS(user_error, trigger_error, arginfo_user_error) + ZEND_FE(set_error_handler, arginfo_set_error_handler) + ZEND_FE(restore_error_handler, arginfo_restore_error_handler) + ZEND_FE(set_exception_handler, arginfo_set_exception_handler) + ZEND_FE(restore_exception_handler, arginfo_restore_exception_handler) + ZEND_FE(get_declared_classes, arginfo_get_declared_classes) + ZEND_FE(get_declared_traits, arginfo_get_declared_traits) + ZEND_FE(get_declared_interfaces, arginfo_get_declared_interfaces) + ZEND_FE(get_defined_functions, arginfo_get_defined_functions) + ZEND_FE(get_defined_vars, arginfo_get_defined_vars) + ZEND_FE(get_resource_type, arginfo_get_resource_type) + ZEND_FE(get_resource_id, arginfo_get_resource_id) + ZEND_FE(get_resources, arginfo_get_resources) + ZEND_FE(get_loaded_extensions, arginfo_get_loaded_extensions) + ZEND_FE(get_defined_constants, arginfo_get_defined_constants) + ZEND_FE(debug_backtrace, arginfo_debug_backtrace) + ZEND_FE(debug_print_backtrace, arginfo_debug_print_backtrace) + ZEND_FE(extension_loaded, arginfo_extension_loaded) + ZEND_FE(get_extension_funcs, arginfo_get_extension_funcs) +#if ZEND_DEBUG && defined(ZTS) + ZEND_FE(zend_thread_id, arginfo_zend_thread_id) +#endif + ZEND_FE(gc_mem_caches, arginfo_gc_mem_caches) + ZEND_FE(gc_collect_cycles, arginfo_gc_collect_cycles) + ZEND_FE(gc_enabled, arginfo_gc_enabled) + ZEND_FE(gc_enable, arginfo_gc_enable) + ZEND_FE(gc_disable, arginfo_gc_disable) + ZEND_FE(gc_status, arginfo_gc_status) + ZEND_FE_END +}; + + +static const zend_function_entry class_stdClass_methods[] = { + ZEND_FE_END +}; + +static zend_class_entry *register_class_stdClass(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "stdClass", class_stdClass_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES; + + zend_string *attribute_name_AllowDynamicProperties_class_stdClass_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, 1); + zend_add_class_attribute(class_entry, attribute_name_AllowDynamicProperties_class_stdClass_0, 0); + zend_string_release(attribute_name_AllowDynamicProperties_class_stdClass_0); + + return class_entry; +} diff --git a/include/php/Zend/zend_call_stack.h b/include/php/Zend/zend_call_stack.h new file mode 100644 index 0000000..bdea17a --- /dev/null +++ b/include/php/Zend/zend_call_stack.h @@ -0,0 +1,94 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Arnaud Le Blanc | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_CALL_STACK_H +#define ZEND_CALL_STACK_H + +#include "zend.h" +#include "zend_portability.h" +#ifdef __APPLE__ +# include +#endif + +#ifdef ZEND_CHECK_STACK_LIMIT + +typedef struct _zend_call_stack { + void *base; + size_t max_size; +} zend_call_stack; + +ZEND_API void zend_call_stack_init(void); + +ZEND_API bool zend_call_stack_get(zend_call_stack *stack); + +/** Returns an approximation of the current stack position */ +static zend_always_inline void *zend_call_stack_position(void) { +#ifdef ZEND_WIN32 + return _AddressOfReturnAddress(); +#elif PHP_HAVE_BUILTIN_FRAME_ADDRESS + return __builtin_frame_address(0); +#else + void *a; + void *pos = (void*)&a; + return pos; +#endif +} + +static zend_always_inline bool zend_call_stack_overflowed(void *stack_limit) { + return (uintptr_t) zend_call_stack_position() <= (uintptr_t) stack_limit; +} + +static inline void* zend_call_stack_limit(void *base, size_t size, size_t reserved_size) +{ + if (UNEXPECTED(size > (uintptr_t)base)) { + return (void*)0; + } + + base = (int8_t*)base - size; + + if (UNEXPECTED(UINTPTR_MAX - (uintptr_t)base < reserved_size)) { + return (void*)UINTPTR_MAX; + } + + return (int8_t*)base + reserved_size; +} + +static inline size_t zend_call_stack_default_size(void) +{ +#ifdef __linux__ + return 8 * 1024 * 1024; +#endif +#if defined(__FreeBSD__) || defined(__NetBSD__) + return 4 * 1024 * 1024; +#endif +#ifdef __OpenBSD__ + return 512 * 1024; +#endif +#ifdef __APPLE__ + // https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html + if (pthread_main_np()) { + return 8 * 1024 * 1024; + } + return 512 * 1024; +#endif + + return 2 * 1024 * 1024; +} + +#endif /* ZEND_CHECK_STACK_LIMIT */ +#endif /* ZEND_CALL_STACK_H */ diff --git a/include/php/Zend/zend_closures.h b/include/php/Zend/zend_closures.h new file mode 100644 index 0000000..2d093fa --- /dev/null +++ b/include/php/Zend/zend_closures.h @@ -0,0 +1,44 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Christian Seiler | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_CLOSURES_H +#define ZEND_CLOSURES_H + +BEGIN_EXTERN_C() + +/* This macro depends on zend_closure structure layout */ +#define ZEND_CLOSURE_OBJECT(op_array) \ + ((zend_object*)((char*)(op_array) - sizeof(zend_object))) + +void zend_register_closure_ce(void); +void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var); +void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val); +void zend_closure_from_frame(zval *closure_zv, zend_execute_data *frame); + +extern ZEND_API zend_class_entry *zend_ce_closure; + +ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr); +ZEND_API void zend_create_fake_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr); +ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *obj); +ZEND_API const zend_function *zend_get_closure_method_def(zend_object *obj); +ZEND_API zval* zend_get_closure_this_ptr(zval *obj); + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_closures_arginfo.h b/include/php/Zend/zend_closures_arginfo.h new file mode 100644 index 0000000..cb5a012 --- /dev/null +++ b/include/php/Zend/zend_closures_arginfo.h @@ -0,0 +1,53 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: e3b480674671a698814db282c5ea34d438fe519d */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Closure___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_bind, 0, 2, Closure, 1) + ZEND_ARG_OBJ_INFO(0, closure, Closure, 0) + ZEND_ARG_TYPE_INFO(0, newThis, IS_OBJECT, 1) + ZEND_ARG_TYPE_MASK(0, newScope, MAY_BE_OBJECT|MAY_BE_STRING|MAY_BE_NULL, "\"static\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_bindTo, 0, 1, Closure, 1) + ZEND_ARG_TYPE_INFO(0, newThis, IS_OBJECT, 1) + ZEND_ARG_TYPE_MASK(0, newScope, MAY_BE_OBJECT|MAY_BE_STRING|MAY_BE_NULL, "\"static\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Closure_call, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, newThis, IS_OBJECT, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_fromCallable, 0, 1, Closure, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) +ZEND_END_ARG_INFO() + + +ZEND_METHOD(Closure, __construct); +ZEND_METHOD(Closure, bind); +ZEND_METHOD(Closure, bindTo); +ZEND_METHOD(Closure, call); +ZEND_METHOD(Closure, fromCallable); + + +static const zend_function_entry class_Closure_methods[] = { + ZEND_ME(Closure, __construct, arginfo_class_Closure___construct, ZEND_ACC_PRIVATE) + ZEND_ME(Closure, bind, arginfo_class_Closure_bind, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Closure, bindTo, arginfo_class_Closure_bindTo, ZEND_ACC_PUBLIC) + ZEND_ME(Closure, call, arginfo_class_Closure_call, ZEND_ACC_PUBLIC) + ZEND_ME(Closure, fromCallable, arginfo_class_Closure_fromCallable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_FE_END +}; + +static zend_class_entry *register_class_Closure(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Closure", class_Closure_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; + + return class_entry; +} diff --git a/include/php/Zend/zend_compile.h b/include/php/Zend/zend_compile.h new file mode 100644 index 0000000..724b5b8 --- /dev/null +++ b/include/php/Zend/zend_compile.h @@ -0,0 +1,1220 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_COMPILE_H +#define ZEND_COMPILE_H + +#include "zend.h" +#include "zend_ast.h" + +#include +#include + +#include "zend_llist.h" + +#define SET_UNUSED(op) do { \ + op ## _type = IS_UNUSED; \ + op.num = (uint32_t) -1; \ +} while (0) + +#define MAKE_NOP(opline) do { \ + (opline)->opcode = ZEND_NOP; \ + SET_UNUSED((opline)->op1); \ + SET_UNUSED((opline)->op2); \ + SET_UNUSED((opline)->result); \ +} while (0) + +#define RESET_DOC_COMMENT() do { \ + if (CG(doc_comment)) { \ + zend_string_release_ex(CG(doc_comment), 0); \ + CG(doc_comment) = NULL; \ + } \ +} while (0) + +typedef struct _zend_op_array zend_op_array; +typedef struct _zend_op zend_op; + +/* On 64-bit systems less optimal, but more compact VM code leads to better + * performance. So on 32-bit systems we use absolute addresses for jump + * targets and constants, but on 64-bit systems relative 32-bit offsets */ +#if SIZEOF_SIZE_T == 4 +# define ZEND_USE_ABS_JMP_ADDR 1 +# define ZEND_USE_ABS_CONST_ADDR 1 +#else +# define ZEND_USE_ABS_JMP_ADDR 0 +# define ZEND_USE_ABS_CONST_ADDR 0 +#endif + +typedef union _znode_op { + uint32_t constant; + uint32_t var; + uint32_t num; + uint32_t opline_num; /* Needs to be signed */ +#if ZEND_USE_ABS_JMP_ADDR + zend_op *jmp_addr; +#else + uint32_t jmp_offset; +#endif +#if ZEND_USE_ABS_CONST_ADDR + zval *zv; +#endif +} znode_op; + +typedef struct _znode { /* used only during compilation */ + uint8_t op_type; + uint8_t flag; + union { + znode_op op; + zval constant; /* replaced by literal/zv */ + } u; +} znode; + +/* Temporarily defined here, to avoid header ordering issues */ +typedef struct _zend_ast_znode { + zend_ast_kind kind; + zend_ast_attr attr; + uint32_t lineno; + znode node; +} zend_ast_znode; + +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_znode(znode *node); + +static zend_always_inline znode *zend_ast_get_znode(zend_ast *ast) { + return &((zend_ast_znode *) ast)->node; +} + +typedef struct _zend_declarables { + zend_long ticks; +} zend_declarables; + +/* Compilation context that is different for each file, but shared between op arrays. */ +typedef struct _zend_file_context { + zend_declarables declarables; + + zend_string *current_namespace; + bool in_namespace; + bool has_bracketed_namespaces; + + HashTable *imports; + HashTable *imports_function; + HashTable *imports_const; + + HashTable seen_symbols; +} zend_file_context; + +typedef union _zend_parser_stack_elem { + zend_ast *ast; + zend_string *str; + zend_ulong num; + unsigned char *ptr; + unsigned char *ident; +} zend_parser_stack_elem; + +void zend_compile_top_stmt(zend_ast *ast); +void zend_const_expr_to_zval(zval *result, zend_ast **ast_ptr, bool allow_dynamic); + +typedef int (*user_opcode_handler_t) (zend_execute_data *execute_data); + +struct _zend_op { + const void *handler; + znode_op op1; + znode_op op2; + znode_op result; + uint32_t extended_value; + uint32_t lineno; + uint8_t opcode; /* Opcodes defined in Zend/zend_vm_opcodes.h */ + uint8_t op1_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */ + uint8_t op2_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */ + uint8_t result_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */ +}; + + +typedef struct _zend_brk_cont_element { + int start; + int cont; + int brk; + int parent; + bool is_switch; +} zend_brk_cont_element; + +typedef struct _zend_label { + int brk_cont; + uint32_t opline_num; +} zend_label; + +typedef struct _zend_try_catch_element { + uint32_t try_op; + uint32_t catch_op; /* ketchup! */ + uint32_t finally_op; + uint32_t finally_end; +} zend_try_catch_element; + +#define ZEND_LIVE_TMPVAR 0 +#define ZEND_LIVE_LOOP 1 +#define ZEND_LIVE_SILENCE 2 +#define ZEND_LIVE_ROPE 3 +#define ZEND_LIVE_NEW 4 +#define ZEND_LIVE_MASK 7 + +typedef struct _zend_live_range { + uint32_t var; /* low bits are used for variable type (ZEND_LIVE_* macros) */ + uint32_t start; + uint32_t end; +} zend_live_range; + +/* Compilation context that is different for each op array. */ +typedef struct _zend_oparray_context { + uint32_t opcodes_size; + int vars_size; + int literals_size; + uint32_t fast_call_var; + uint32_t try_catch_offset; + int current_brk_cont; + int last_brk_cont; + zend_brk_cont_element *brk_cont_array; + HashTable *labels; +} zend_oparray_context; + +/* Class, property and method flags class|meth.|prop.|const*/ +/* | | | */ +/* Common flags | | | */ +/* ============ | | | */ +/* | | | */ +/* Visibility flags (public < protected < private) | | | */ +#define ZEND_ACC_PUBLIC (1 << 0) /* | X | X | X */ +#define ZEND_ACC_PROTECTED (1 << 1) /* | X | X | X */ +#define ZEND_ACC_PRIVATE (1 << 2) /* | X | X | X */ +/* | | | */ +/* Property or method overrides private one | | | */ +#define ZEND_ACC_CHANGED (1 << 3) /* | X | X | */ +/* | | | */ +/* Static method or property | | | */ +#define ZEND_ACC_STATIC (1 << 4) /* | X | X | */ +/* | | | */ +/* Promoted property / parameter | | | */ +#define ZEND_ACC_PROMOTED (1 << 5) /* | | X | X */ +/* | | | */ +/* Final class or method | | | */ +#define ZEND_ACC_FINAL (1 << 5) /* X | X | | */ +/* | | | */ +/* Abstract method | | | */ +#define ZEND_ACC_ABSTRACT (1 << 6) /* X | X | | */ +#define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS (1 << 6) /* X | | | */ +/* | | | */ +/* Readonly property | | | */ +#define ZEND_ACC_READONLY (1 << 7) /* | | X | */ +/* | | | */ +/* Immutable op_array and class_entries | | | */ +/* (implemented only for lazy loading of op_arrays) | | | */ +#define ZEND_ACC_IMMUTABLE (1 << 7) /* X | X | | */ +/* | | | */ +/* Function has typed arguments / class has typed props | | | */ +#define ZEND_ACC_HAS_TYPE_HINTS (1 << 8) /* X | X | | */ +/* | | | */ +/* Top-level class or function declaration | | | */ +#define ZEND_ACC_TOP_LEVEL (1 << 9) /* X | X | | */ +/* | | | */ +/* op_array or class is preloaded | | | */ +#define ZEND_ACC_PRELOADED (1 << 10) /* X | X | | */ +/* | | | */ +/* Flag to differentiate cases from constants. | | | */ +/* Must not conflict with ZEND_ACC_ visibility flags | | | */ +/* or IS_CONSTANT_VISITED_MARK | | | */ +#define ZEND_CLASS_CONST_IS_CASE (1 << 6) /* | | | X */ +/* | | | */ +/* Class Flags (unused: 30,31) | | | */ +/* =========== | | | */ +/* | | | */ +/* Special class types | | | */ +#define ZEND_ACC_INTERFACE (1 << 0) /* X | | | */ +#define ZEND_ACC_TRAIT (1 << 1) /* X | | | */ +#define ZEND_ACC_ANON_CLASS (1 << 2) /* X | | | */ +#define ZEND_ACC_ENUM (1 << 28) /* X | | | */ +/* | | | */ +/* Class linked with parent, interfaces and traits | | | */ +#define ZEND_ACC_LINKED (1 << 3) /* X | | | */ +/* | | | */ +/* Class is abstract, since it is set by any | | | */ +/* abstract method | | | */ +#define ZEND_ACC_IMPLICIT_ABSTRACT_CLASS (1 << 4) /* X | | | */ +/* | | | */ +/* Class has magic methods __get/__set/__unset/ | | | */ +/* __isset that use guards | | | */ +#define ZEND_ACC_USE_GUARDS (1 << 11) /* X | | | */ +/* | | | */ +/* Class constants updated | | | */ +#define ZEND_ACC_CONSTANTS_UPDATED (1 << 12) /* X | | | */ +/* | | | */ +/* Objects of this class may not have dynamic properties | | | */ +#define ZEND_ACC_NO_DYNAMIC_PROPERTIES (1 << 13) /* X | | | */ +/* | | | */ +/* User class has methods with static variables | | | */ +#define ZEND_HAS_STATIC_IN_METHODS (1 << 14) /* X | | | */ +/* | | | */ +/* Objects of this class may have dynamic properties | | | */ +/* without triggering a deprecation warning | | | */ +#define ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES (1 << 15) /* X | | | */ +/* | | | */ +/* Readonly class | | | */ +#define ZEND_ACC_READONLY_CLASS (1 << 16) /* X | | | */ +/* | | | */ +/* Parent class is resolved (CE). | | | */ +#define ZEND_ACC_RESOLVED_PARENT (1 << 17) /* X | | | */ +/* | | | */ +/* Interfaces are resolved (CEs). | | | */ +#define ZEND_ACC_RESOLVED_INTERFACES (1 << 18) /* X | | | */ +/* | | | */ +/* Class has unresolved variance obligations. | | | */ +#define ZEND_ACC_UNRESOLVED_VARIANCE (1 << 19) /* X | | | */ +/* | | | */ +/* Class is linked apart from variance obligations. | | | */ +#define ZEND_ACC_NEARLY_LINKED (1 << 20) /* X | | | */ +/* Class has readonly props | | | */ +#define ZEND_ACC_HAS_READONLY_PROPS (1 << 21) /* X | | | */ +/* | | | */ +/* stored in opcache (may be partially) | | | */ +#define ZEND_ACC_CACHED (1 << 22) /* X | | | */ +/* | | | */ +/* temporary flag used during delayed variance checks | | | */ +#define ZEND_ACC_CACHEABLE (1 << 23) /* X | | | */ +/* | | | */ +#define ZEND_ACC_HAS_AST_CONSTANTS (1 << 24) /* X | | | */ +#define ZEND_ACC_HAS_AST_PROPERTIES (1 << 25) /* X | | | */ +#define ZEND_ACC_HAS_AST_STATICS (1 << 26) /* X | | | */ +/* | | | */ +/* loaded from file cache to process memory | | | */ +#define ZEND_ACC_FILE_CACHED (1 << 27) /* X | | | */ +/* | | | */ +/* Class cannot be serialized or unserialized | | | */ +#define ZEND_ACC_NOT_SERIALIZABLE (1 << 29) /* X | | | */ +/* | | | */ +/* Function Flags (unused: 29-30) | | | */ +/* ============== | | | */ +/* | | | */ +/* deprecation flag | | | */ +#define ZEND_ACC_DEPRECATED (1 << 11) /* | X | | */ +/* | | | */ +/* Function returning by reference | | | */ +#define ZEND_ACC_RETURN_REFERENCE (1 << 12) /* | X | | */ +/* | | | */ +/* Function has a return type | | | */ +#define ZEND_ACC_HAS_RETURN_TYPE (1 << 13) /* | X | | */ +/* | | | */ +/* Function with variable number of arguments | | | */ +#define ZEND_ACC_VARIADIC (1 << 14) /* | X | | */ +/* | | | */ +/* op_array has finally blocks (user only) | | | */ +#define ZEND_ACC_HAS_FINALLY_BLOCK (1 << 15) /* | X | | */ +/* | | | */ +/* "main" op_array with | | | */ +/* ZEND_DECLARE_CLASS_DELAYED opcodes | | | */ +#define ZEND_ACC_EARLY_BINDING (1 << 16) /* | X | | */ +/* | | | */ +/* closure uses $this | | | */ +#define ZEND_ACC_USES_THIS (1 << 17) /* | X | | */ +/* | | | */ +/* call through user function trampoline. e.g. | | | */ +/* __call, __callstatic | | | */ +#define ZEND_ACC_CALL_VIA_TRAMPOLINE (1 << 18) /* | X | | */ +/* | | | */ +/* disable inline caching | | | */ +#define ZEND_ACC_NEVER_CACHE (1 << 19) /* | X | | */ +/* | | | */ +/* op_array is a clone of trait method | | | */ +#define ZEND_ACC_TRAIT_CLONE (1 << 20) /* | X | | */ +/* | | | */ +/* functions is a constructor | | | */ +#define ZEND_ACC_CTOR (1 << 21) /* | X | | */ +/* | | | */ +/* Closure related | | | */ +#define ZEND_ACC_CLOSURE (1 << 22) /* | X | | */ +#define ZEND_ACC_FAKE_CLOSURE (1 << 23) /* | X | | */ /* Same as ZEND_CALL_FAKE_CLOSURE */ +/* | | | */ +#define ZEND_ACC_GENERATOR (1 << 24) /* | X | | */ +/* | | | */ +/* function was processed by pass two (user only) | | | */ +#define ZEND_ACC_DONE_PASS_TWO (1 << 25) /* | X | | */ +/* | | | */ +/* internal function is allocated at arena (int only) | | | */ +#define ZEND_ACC_ARENA_ALLOCATED (1 << 25) /* | X | | */ +/* | | | */ +/* run_time_cache allocated on heap (user only) | | | */ +#define ZEND_ACC_HEAP_RT_CACHE (1 << 26) /* | X | | */ +/* | | | */ +/* method flag used by Closure::__invoke() (int only) | | | */ +#define ZEND_ACC_USER_ARG_INFO (1 << 26) /* | X | | */ +/* | | | */ +/* supports opcache compile-time evaluation (funcs) | | | */ +#define ZEND_ACC_COMPILE_TIME_EVAL (1 << 27) /* | X | | */ +/* | | | */ +/* has #[\Override] attribute | | | */ +#define ZEND_ACC_OVERRIDE (1 << 28) /* | X | | */ +/* | | | */ +/* op_array uses strict mode types | | | */ +#define ZEND_ACC_STRICT_TYPES (1U << 31) /* | X | | */ + + +#define ZEND_ACC_PPP_MASK (ZEND_ACC_PUBLIC | ZEND_ACC_PROTECTED | ZEND_ACC_PRIVATE) + +/* call through internal function handler. e.g. Closure::invoke() */ +#define ZEND_ACC_CALL_VIA_HANDLER ZEND_ACC_CALL_VIA_TRAMPOLINE + +#define ZEND_SHORT_CIRCUITING_CHAIN_MASK 0x3 +#define ZEND_SHORT_CIRCUITING_CHAIN_EXPR 0 +#define ZEND_SHORT_CIRCUITING_CHAIN_ISSET 1 +#define ZEND_SHORT_CIRCUITING_CHAIN_EMPTY 2 + +// Must not clash with ZEND_SHORT_CIRCUITING_CHAIN_MASK +#define ZEND_JMP_NULL_BP_VAR_IS 4 + +char *zend_visibility_string(uint32_t fn_flags); + +typedef struct _zend_property_info { + uint32_t offset; /* property offset for object properties or + property index for static properties */ + uint32_t flags; + zend_string *name; + zend_string *doc_comment; + HashTable *attributes; + zend_class_entry *ce; + zend_type type; +} zend_property_info; + +#define OBJ_PROP(obj, offset) \ + ((zval*)((char*)(obj) + offset)) +#define OBJ_PROP_NUM(obj, num) \ + (&(obj)->properties_table[(num)]) +#define OBJ_PROP_TO_OFFSET(num) \ + ((uint32_t)(XtOffsetOf(zend_object, properties_table) + sizeof(zval) * (num))) +#define OBJ_PROP_TO_NUM(offset) \ + ((offset - OBJ_PROP_TO_OFFSET(0)) / sizeof(zval)) + +typedef struct _zend_class_constant { + zval value; /* flags are stored in u2 */ + zend_string *doc_comment; + HashTable *attributes; + zend_class_entry *ce; + zend_type type; +} zend_class_constant; + +#define ZEND_CLASS_CONST_FLAGS(c) Z_CONSTANT_FLAGS((c)->value) + +/* arg_info for internal functions */ +typedef struct _zend_internal_arg_info { + const char *name; + zend_type type; + const char *default_value; +} zend_internal_arg_info; + +/* arg_info for user functions */ +typedef struct _zend_arg_info { + zend_string *name; + zend_type type; + zend_string *default_value; +} zend_arg_info; + +/* the following structure repeats the layout of zend_internal_arg_info, + * but its fields have different meaning. It's used as the first element of + * arg_info array to define properties of internal functions. + * It's also used for the return type. + */ +typedef struct _zend_internal_function_info { + uintptr_t required_num_args; + zend_type type; + const char *default_value; +} zend_internal_function_info; + +struct _zend_op_array { + /* Common elements */ + uint8_t type; + uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */ + uint32_t fn_flags; + zend_string *function_name; + zend_class_entry *scope; + zend_function *prototype; + uint32_t num_args; + uint32_t required_num_args; + zend_arg_info *arg_info; + HashTable *attributes; + ZEND_MAP_PTR_DEF(void **, run_time_cache); + uint32_t T; /* number of temporary variables */ + /* END of common elements */ + + int cache_size; /* number of run_time_cache_slots * sizeof(void*) */ + int last_var; /* number of CV variables */ + uint32_t last; /* number of opcodes */ + + zend_op *opcodes; + ZEND_MAP_PTR_DEF(HashTable *, static_variables_ptr); + HashTable *static_variables; + zend_string **vars; /* names of CV variables */ + + uint32_t *refcount; + + int last_live_range; + int last_try_catch; + zend_live_range *live_range; + zend_try_catch_element *try_catch_array; + + zend_string *filename; + uint32_t line_start; + uint32_t line_end; + zend_string *doc_comment; + + int last_literal; + uint32_t num_dynamic_func_defs; + zval *literals; + + /* Functions that are declared dynamically are stored here and + * referenced by index from opcodes. */ + zend_op_array **dynamic_func_defs; + + void *reserved[ZEND_MAX_RESERVED_RESOURCES]; +}; + + +#define ZEND_RETURN_VALUE 0 +#define ZEND_RETURN_REFERENCE 1 + +/* zend_internal_function_handler */ +typedef void (ZEND_FASTCALL *zif_handler)(INTERNAL_FUNCTION_PARAMETERS); + +typedef struct _zend_internal_function { + /* Common elements */ + uint8_t type; + uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */ + uint32_t fn_flags; + zend_string* function_name; + zend_class_entry *scope; + zend_function *prototype; + uint32_t num_args; + uint32_t required_num_args; + zend_internal_arg_info *arg_info; + HashTable *attributes; + ZEND_MAP_PTR_DEF(void **, run_time_cache); + uint32_t T; /* number of temporary variables */ + /* END of common elements */ + + zif_handler handler; + struct _zend_module_entry *module; + void *reserved[ZEND_MAX_RESERVED_RESOURCES]; +} zend_internal_function; + +#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? ZSTR_VAL((function)->common.scope->name) : "") + +union _zend_function { + uint8_t type; /* MUST be the first element of this struct! */ + uint32_t quick_arg_flags; + + struct { + uint8_t type; /* never used */ + uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */ + uint32_t fn_flags; + zend_string *function_name; + zend_class_entry *scope; + zend_function *prototype; + uint32_t num_args; + uint32_t required_num_args; + zend_arg_info *arg_info; /* index -1 represents the return value info, if any */ + HashTable *attributes; + ZEND_MAP_PTR_DEF(void **, run_time_cache); + uint32_t T; /* number of temporary variables */ + } common; + + zend_op_array op_array; + zend_internal_function internal_function; +}; + +struct _zend_execute_data { + const zend_op *opline; /* executed opline */ + zend_execute_data *call; /* current call */ + zval *return_value; + zend_function *func; /* executed function */ + zval This; /* this + call_info + num_args */ + zend_execute_data *prev_execute_data; + zend_array *symbol_table; + void **run_time_cache; /* cache op_array->run_time_cache */ + zend_array *extra_named_params; +}; + +#define ZEND_CALL_HAS_THIS IS_OBJECT_EX + +/* Top 16 bits of Z_TYPE_INFO(EX(This)) are used as call_info flags */ +#define ZEND_CALL_FUNCTION (0 << 16) +#define ZEND_CALL_CODE (1 << 16) +#define ZEND_CALL_NESTED (0 << 17) +#define ZEND_CALL_TOP (1 << 17) +#define ZEND_CALL_ALLOCATED (1 << 18) +#define ZEND_CALL_FREE_EXTRA_ARGS (1 << 19) +#define ZEND_CALL_HAS_SYMBOL_TABLE (1 << 20) +#define ZEND_CALL_RELEASE_THIS (1 << 21) +#define ZEND_CALL_CLOSURE (1 << 22) +#define ZEND_CALL_FAKE_CLOSURE (1 << 23) /* Same as ZEND_ACC_FAKE_CLOSURE */ +#define ZEND_CALL_GENERATOR (1 << 24) +#define ZEND_CALL_DYNAMIC (1 << 25) +#define ZEND_CALL_MAY_HAVE_UNDEF (1 << 26) +#define ZEND_CALL_HAS_EXTRA_NAMED_PARAMS (1 << 27) +#define ZEND_CALL_OBSERVED (1 << 28) /* "fcall_begin" observer handler may set this flag */ + /* to prevent optimization in RETURN handler and */ + /* keep all local variables for "fcall_end" handler */ +#define ZEND_CALL_JIT_RESERVED (1 << 29) /* reserved for tracing JIT */ +#define ZEND_CALL_NEEDS_REATTACH (1 << 30) +#define ZEND_CALL_SEND_ARG_BY_REF (1u << 31) + +#define ZEND_CALL_NESTED_FUNCTION (ZEND_CALL_FUNCTION | ZEND_CALL_NESTED) +#define ZEND_CALL_NESTED_CODE (ZEND_CALL_CODE | ZEND_CALL_NESTED) +#define ZEND_CALL_TOP_FUNCTION (ZEND_CALL_TOP | ZEND_CALL_FUNCTION) +#define ZEND_CALL_TOP_CODE (ZEND_CALL_CODE | ZEND_CALL_TOP) + +#define ZEND_CALL_INFO(call) \ + Z_TYPE_INFO((call)->This) + +#define ZEND_CALL_KIND_EX(call_info) \ + (call_info & (ZEND_CALL_CODE | ZEND_CALL_TOP)) + +#define ZEND_CALL_KIND(call) \ + ZEND_CALL_KIND_EX(ZEND_CALL_INFO(call)) + +#define ZEND_ADD_CALL_FLAG_EX(call_info, flag) do { \ + call_info |= (flag); \ + } while (0) + +#define ZEND_DEL_CALL_FLAG_EX(call_info, flag) do { \ + call_info &= ~(flag); \ + } while (0) + +#define ZEND_ADD_CALL_FLAG(call, flag) do { \ + ZEND_ADD_CALL_FLAG_EX(Z_TYPE_INFO((call)->This), flag); \ + } while (0) + +#define ZEND_DEL_CALL_FLAG(call, flag) do { \ + ZEND_DEL_CALL_FLAG_EX(Z_TYPE_INFO((call)->This), flag); \ + } while (0) + +#define ZEND_CALL_NUM_ARGS(call) \ + (call)->This.u2.num_args + +/* Ensure the correct alignment before slots calculation */ +ZEND_STATIC_ASSERT(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval), + "zval must be aligned by ZEND_MM_ALIGNMENT"); +/* A number of call frame slots (zvals) reserved for zend_execute_data. */ +#define ZEND_CALL_FRAME_SLOT \ + ((int)((sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval))) + +#define ZEND_CALL_VAR(call, n) \ + ((zval*)(((char*)(call)) + ((int)(n)))) + +#define ZEND_CALL_VAR_NUM(call, n) \ + (((zval*)(call)) + (ZEND_CALL_FRAME_SLOT + ((int)(n)))) + +#define ZEND_CALL_ARG(call, n) \ + ZEND_CALL_VAR_NUM(call, ((int)(n)) - 1) + +#define EX(element) ((execute_data)->element) + +#define EX_CALL_INFO() ZEND_CALL_INFO(execute_data) +#define EX_CALL_KIND() ZEND_CALL_KIND(execute_data) +#define EX_NUM_ARGS() ZEND_CALL_NUM_ARGS(execute_data) + +#define ZEND_CALL_USES_STRICT_TYPES(call) \ + (((call)->func->common.fn_flags & ZEND_ACC_STRICT_TYPES) != 0) + +#define EX_USES_STRICT_TYPES() \ + ZEND_CALL_USES_STRICT_TYPES(execute_data) + +#define ZEND_ARG_USES_STRICT_TYPES() \ + (EG(current_execute_data)->prev_execute_data && \ + EG(current_execute_data)->prev_execute_data->func && \ + ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)->prev_execute_data)) + +#define ZEND_RET_USES_STRICT_TYPES() \ + ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)) + +#define EX_VAR(n) ZEND_CALL_VAR(execute_data, n) +#define EX_VAR_NUM(n) ZEND_CALL_VAR_NUM(execute_data, n) + +#define EX_VAR_TO_NUM(n) ((uint32_t)((n) / sizeof(zval) - ZEND_CALL_FRAME_SLOT)) +#define EX_NUM_TO_VAR(n) ((uint32_t)(((n) + ZEND_CALL_FRAME_SLOT) * sizeof(zval))) + +#define ZEND_OPLINE_TO_OFFSET(opline, target) \ + ((char*)(target) - (char*)(opline)) + +#define ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline_num) \ + ((char*)&(op_array)->opcodes[opline_num] - (char*)(opline)) + +#define ZEND_OFFSET_TO_OPLINE(base, offset) \ + ((zend_op*)(((char*)(base)) + (int)offset)) + +#define ZEND_OFFSET_TO_OPLINE_NUM(op_array, base, offset) \ + (ZEND_OFFSET_TO_OPLINE(base, offset) - op_array->opcodes) + +#if ZEND_USE_ABS_JMP_ADDR + +/* run-time jump target */ +# define OP_JMP_ADDR(opline, node) \ + (node).jmp_addr + +# define ZEND_SET_OP_JMP_ADDR(opline, node, val) do { \ + (node).jmp_addr = (val); \ + } while (0) + +/* convert jump target from compile-time to run-time */ +# define ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, node) do { \ + (node).jmp_addr = (op_array)->opcodes + (node).opline_num; \ + } while (0) + +/* convert jump target back from run-time to compile-time */ +# define ZEND_PASS_TWO_UNDO_JMP_TARGET(op_array, opline, node) do { \ + (node).opline_num = (node).jmp_addr - (op_array)->opcodes; \ + } while (0) + +#else + +/* run-time jump target */ +# define OP_JMP_ADDR(opline, node) \ + ZEND_OFFSET_TO_OPLINE(opline, (node).jmp_offset) + +# define ZEND_SET_OP_JMP_ADDR(opline, node, val) do { \ + (node).jmp_offset = ZEND_OPLINE_TO_OFFSET(opline, val); \ + } while (0) + +/* convert jump target from compile-time to run-time */ +# define ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, node) do { \ + (node).jmp_offset = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, (node).opline_num); \ + } while (0) + +/* convert jump target back from run-time to compile-time */ +# define ZEND_PASS_TWO_UNDO_JMP_TARGET(op_array, opline, node) do { \ + (node).opline_num = ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, (node).jmp_offset); \ + } while (0) + +#endif + +/* constant-time constant */ +# define CT_CONSTANT_EX(op_array, num) \ + ((op_array)->literals + (num)) + +# define CT_CONSTANT(node) \ + CT_CONSTANT_EX(CG(active_op_array), (node).constant) + +#if ZEND_USE_ABS_CONST_ADDR + +/* run-time constant */ +# define RT_CONSTANT(opline, node) \ + (node).zv + +/* convert constant from compile-time to run-time */ +# define ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, node) do { \ + (node).zv = CT_CONSTANT_EX(op_array, (node).constant); \ + } while (0) + +#else + +/* At run-time, constants are allocated together with op_array->opcodes + * and addressed relatively to current opline. + */ + +/* run-time constant */ +# define RT_CONSTANT(opline, node) \ + ((zval*)(((char*)(opline)) + (int32_t)(node).constant)) + +/* convert constant from compile-time to run-time */ +# define ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, node) do { \ + (node).constant = \ + (((char*)CT_CONSTANT_EX(op_array, (node).constant)) - \ + ((char*)opline)); \ + } while (0) + +#endif + +/* convert constant back from run-time to compile-time */ +#define ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline, node) do { \ + (node).constant = RT_CONSTANT(opline, node) - (op_array)->literals; \ + } while (0) + +#define RUN_TIME_CACHE(op_array) \ + ZEND_MAP_PTR_GET((op_array)->run_time_cache) + +#define ZEND_OP_ARRAY_EXTENSION(op_array, handle) \ + ((void**)RUN_TIME_CACHE(op_array))[handle] + +#define IS_UNUSED 0 /* Unused operand */ +#define IS_CONST (1<<0) +#define IS_TMP_VAR (1<<1) +#define IS_VAR (1<<2) +#define IS_CV (1<<3) /* Compiled variable */ + +/* Used for result.type of smart branch instructions */ +#define IS_SMART_BRANCH_JMPZ (1<<4) +#define IS_SMART_BRANCH_JMPNZ (1<<5) + +#define ZEND_EXTRA_VALUE 1 + +#include "zend_globals.h" + +typedef enum _zend_compile_position { + ZEND_COMPILE_POSITION_AT_SHEBANG = 0, + ZEND_COMPILE_POSITION_AT_OPEN_TAG, + ZEND_COMPILE_POSITION_AFTER_OPEN_TAG +} zend_compile_position; + +BEGIN_EXTERN_C() + +void init_compiler(void); +void shutdown_compiler(void); +void zend_init_compiler_data_structures(void); + +void zend_oparray_context_begin(zend_oparray_context *prev_context); +void zend_oparray_context_end(zend_oparray_context *prev_context); +void zend_file_context_begin(zend_file_context *prev_context); +void zend_file_context_end(zend_file_context *prev_context); + +extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type); +extern ZEND_API zend_op_array *(*zend_compile_string)(zend_string *source_string, const char *filename, zend_compile_position position); + +ZEND_API int ZEND_FASTCALL lex_scan(zval *zendlval, zend_parser_stack_elem *elem); +void startup_scanner(void); +void shutdown_scanner(void); + +ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename); +ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename); +ZEND_API zend_string *zend_get_compiled_filename(void); +ZEND_API int zend_get_compiled_lineno(void); +ZEND_API size_t zend_get_scanned_file_offset(void); + +ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, uint32_t var); + +#ifdef ZTS +const char *zend_get_zendtext(void); +int zend_get_zendleng(void); +#endif + +typedef zend_result (ZEND_FASTCALL *unary_op_type)(zval *, zval *); +typedef zend_result (ZEND_FASTCALL *binary_op_type)(zval *, zval *, zval *); + +ZEND_API unary_op_type get_unary_op(int opcode); +ZEND_API binary_op_type get_binary_op(int opcode); + +void zend_stop_lexing(void); +void zend_emit_final_return(bool return_one); + +typedef enum { + ZEND_MODIFIER_TARGET_PROPERTY = 0, + ZEND_MODIFIER_TARGET_METHOD, + ZEND_MODIFIER_TARGET_CONSTANT, + ZEND_MODIFIER_TARGET_CPP, +} zend_modifier_target; + +/* Used during AST construction */ +zend_ast *zend_ast_append_str(zend_ast *left, zend_ast *right); +zend_ast *zend_negate_num_string(zend_ast *ast); +uint32_t zend_add_class_modifier(uint32_t flags, uint32_t new_flag); +uint32_t zend_add_anonymous_class_modifier(uint32_t flags, uint32_t new_flag); +uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag, zend_modifier_target target); + +uint32_t zend_modifier_token_to_flag(zend_modifier_target target, uint32_t flags); +uint32_t zend_modifier_list_to_flags(zend_modifier_target target, zend_ast *modifiers); + +bool zend_handle_encoding_declaration(zend_ast *ast); + +ZEND_API zend_class_entry *zend_bind_class_in_slot( + zval *class_table_slot, zval *lcname, zend_string *lc_parent_name); +ZEND_API zend_result do_bind_function(zend_function *func, zval *lcname); +ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name); + +void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline); + +ZEND_API void function_add_ref(zend_function *function); +zend_string *zval_make_interned_string(zval *zv); + +#define INITIAL_OP_ARRAY_SIZE 64 + + +/* helper functions in zend_language_scanner.l */ +struct _zend_arena; + +ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type); +ZEND_API zend_op_array *compile_string(zend_string *source_string, const char *filename, zend_compile_position position); +ZEND_API zend_op_array *compile_filename(int type, zend_string *filename); +ZEND_API zend_ast *zend_compile_string_to_ast( + zend_string *code, struct _zend_arena **ast_arena, zend_string *filename); +ZEND_API zend_result zend_execute_scripts(int type, zval *retval, int file_count, ...); +ZEND_API zend_result open_file_for_scanning(zend_file_handle *file_handle); +ZEND_API void init_op_array(zend_op_array *op_array, uint8_t type, int initial_ops_size); +ZEND_API void destroy_op_array(zend_op_array *op_array); +ZEND_API void zend_destroy_static_vars(zend_op_array *op_array); +ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle); +ZEND_API void zend_cleanup_mutable_class_data(zend_class_entry *ce); +ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce); +ZEND_API void zend_type_release(zend_type type, bool persistent); +ZEND_API zend_string *zend_create_member_string(zend_string *class_name, zend_string *member_name); + + +ZEND_API ZEND_COLD void zend_user_exception_handler(void); + +#define zend_try_exception_handler() do { \ + if (UNEXPECTED(EG(exception))) { \ + if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) { \ + zend_user_exception_handler(); \ + } \ + } \ + } while (0) + +void zend_free_internal_arg_info(zend_internal_function *function); +ZEND_API void destroy_zend_function(zend_function *function); +ZEND_API void zend_function_dtor(zval *zv); +ZEND_API void destroy_zend_class(zval *zv); +void zend_class_add_ref(zval *zv); + +ZEND_API zend_string *zend_mangle_property_name(const char *src1, size_t src1_length, const char *src2, size_t src2_length, bool internal); +#define zend_unmangle_property_name(mangled_property, class_name, prop_name) \ + zend_unmangle_property_name_ex(mangled_property, class_name, prop_name, NULL) +ZEND_API zend_result zend_unmangle_property_name_ex(const zend_string *name, const char **class_name, const char **prop_name, size_t *prop_len); + +static zend_always_inline const char *zend_get_unmangled_property_name(const zend_string *mangled_prop) { + const char *class_name, *prop_name; + zend_unmangle_property_name(mangled_prop, &class_name, &prop_name); + return prop_name; +} + +#define ZEND_FUNCTION_DTOR zend_function_dtor +#define ZEND_CLASS_DTOR destroy_zend_class + +typedef bool (*zend_needs_live_range_cb)(zend_op_array *op_array, zend_op *opline); +ZEND_API void zend_recalc_live_ranges( + zend_op_array *op_array, zend_needs_live_range_cb needs_live_range); + +ZEND_API void pass_two(zend_op_array *op_array); +ZEND_API bool zend_is_compiling(void); +ZEND_API char *zend_make_compiled_string_description(const char *name); +ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers); +uint32_t zend_get_class_fetch_type(const zend_string *name); +ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, zend_function *fbc); +ZEND_API bool zend_is_smart_branch(const zend_op *opline); + +typedef bool (*zend_auto_global_callback)(zend_string *name); +typedef struct _zend_auto_global { + zend_string *name; + zend_auto_global_callback auto_global_callback; + bool jit; + bool armed; +} zend_auto_global; + +ZEND_API zend_result zend_register_auto_global(zend_string *name, bool jit, zend_auto_global_callback auto_global_callback); +ZEND_API void zend_activate_auto_globals(void); +ZEND_API bool zend_is_auto_global(zend_string *name); +ZEND_API bool zend_is_auto_global_str(const char *name, size_t len); +ZEND_API size_t zend_dirname(char *path, size_t len); +ZEND_API void zend_set_function_arg_flags(zend_function *func); + +int ZEND_FASTCALL zendlex(zend_parser_stack_elem *elem); + +void zend_assert_valid_class_name(const zend_string *const_name); + +zend_string *zend_type_to_string_resolved(zend_type type, zend_class_entry *scope); +ZEND_API zend_string *zend_type_to_string(zend_type type); + +/* BEGIN: OPCODES */ + +#include "zend_vm_opcodes.h" + +/* END: OPCODES */ + +/* class fetches */ +#define ZEND_FETCH_CLASS_DEFAULT 0 +#define ZEND_FETCH_CLASS_SELF 1 +#define ZEND_FETCH_CLASS_PARENT 2 +#define ZEND_FETCH_CLASS_STATIC 3 +#define ZEND_FETCH_CLASS_AUTO 4 +#define ZEND_FETCH_CLASS_INTERFACE 5 +#define ZEND_FETCH_CLASS_TRAIT 6 +#define ZEND_FETCH_CLASS_MASK 0x0f +#define ZEND_FETCH_CLASS_NO_AUTOLOAD 0x80 +#define ZEND_FETCH_CLASS_SILENT 0x0100 +#define ZEND_FETCH_CLASS_EXCEPTION 0x0200 +#define ZEND_FETCH_CLASS_ALLOW_UNLINKED 0x0400 +#define ZEND_FETCH_CLASS_ALLOW_NEARLY_LINKED 0x0800 + +/* These should not clash with ZEND_ACC_(PUBLIC|PROTECTED|PRIVATE) */ +#define ZEND_PARAM_REF (1<<3) +#define ZEND_PARAM_VARIADIC (1<<4) + +#define ZEND_NAME_FQ 0 +#define ZEND_NAME_NOT_FQ 1 +#define ZEND_NAME_RELATIVE 2 + +/* ZEND_FETCH_ flags in class name AST of new const expression must not clash with ZEND_NAME_ flags */ +#define ZEND_CONST_EXPR_NEW_FETCH_TYPE_SHIFT 2 + +#define ZEND_TYPE_NULLABLE (1<<8) + +#define ZEND_ARRAY_SYNTAX_LIST 1 /* list() */ +#define ZEND_ARRAY_SYNTAX_LONG 2 /* array() */ +#define ZEND_ARRAY_SYNTAX_SHORT 3 /* [] */ + +/* var status for backpatching */ +#define BP_VAR_R 0 +#define BP_VAR_W 1 +#define BP_VAR_RW 2 +#define BP_VAR_IS 3 +#define BP_VAR_FUNC_ARG 4 +#define BP_VAR_UNSET 5 + +#define ZEND_INTERNAL_FUNCTION 1 +#define ZEND_USER_FUNCTION 2 +#define ZEND_EVAL_CODE 4 + +#define ZEND_USER_CODE(type) ((type) != ZEND_INTERNAL_FUNCTION) + +#define ZEND_INTERNAL_CLASS 1 +#define ZEND_USER_CLASS 2 + +#define ZEND_EVAL (1<<0) +#define ZEND_INCLUDE (1<<1) +#define ZEND_INCLUDE_ONCE (1<<2) +#define ZEND_REQUIRE (1<<3) +#define ZEND_REQUIRE_ONCE (1<<4) + +/* global/local fetches */ +#define ZEND_FETCH_GLOBAL (1<<1) +#define ZEND_FETCH_LOCAL (1<<2) +#define ZEND_FETCH_GLOBAL_LOCK (1<<3) + +#define ZEND_FETCH_TYPE_MASK 0xe + +/* Only one of these can ever be in use */ +#define ZEND_FETCH_REF 1 +#define ZEND_FETCH_DIM_WRITE 2 +#define ZEND_FETCH_OBJ_FLAGS 3 + +/* Used to mark what kind of operation a writing FETCH_DIM is used in, + * to produce a more precise error on incorrect string offset use. */ +#define ZEND_FETCH_DIM_REF 1 +#define ZEND_FETCH_DIM_DIM 2 +#define ZEND_FETCH_DIM_OBJ 3 +#define ZEND_FETCH_DIM_INCDEC 4 + +#define ZEND_ISEMPTY (1<<0) + +#define ZEND_LAST_CATCH (1<<0) + +#define ZEND_FREE_ON_RETURN (1<<0) +#define ZEND_FREE_SWITCH (1<<1) + +#define ZEND_SEND_BY_VAL 0u +#define ZEND_SEND_BY_REF 1u +#define ZEND_SEND_PREFER_REF 2u + +#define ZEND_THROW_IS_EXPR 1u + +#define ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS 1 + +/* The send mode, the is_variadic, the is_promoted, and the is_tentative flags are stored as part of zend_type */ +#define _ZEND_SEND_MODE_SHIFT _ZEND_TYPE_EXTRA_FLAGS_SHIFT +#define _ZEND_IS_VARIADIC_BIT (1 << (_ZEND_TYPE_EXTRA_FLAGS_SHIFT + 2)) +#define _ZEND_IS_PROMOTED_BIT (1 << (_ZEND_TYPE_EXTRA_FLAGS_SHIFT + 3)) +#define _ZEND_IS_TENTATIVE_BIT (1 << (_ZEND_TYPE_EXTRA_FLAGS_SHIFT + 4)) +#define ZEND_ARG_SEND_MODE(arg_info) \ + ((ZEND_TYPE_FULL_MASK((arg_info)->type) >> _ZEND_SEND_MODE_SHIFT) & 3) +#define ZEND_ARG_IS_VARIADIC(arg_info) \ + ((ZEND_TYPE_FULL_MASK((arg_info)->type) & _ZEND_IS_VARIADIC_BIT) != 0) +#define ZEND_ARG_IS_PROMOTED(arg_info) \ + ((ZEND_TYPE_FULL_MASK((arg_info)->type) & _ZEND_IS_PROMOTED_BIT) != 0) +#define ZEND_ARG_TYPE_IS_TENTATIVE(arg_info) \ + ((ZEND_TYPE_FULL_MASK((arg_info)->type) & _ZEND_IS_TENTATIVE_BIT) != 0) + +#define ZEND_DIM_IS (1 << 0) /* isset fetch needed for null coalesce. Set in zend_compile.c for ZEND_AST_DIM nested within ZEND_AST_COALESCE. */ +#define ZEND_DIM_ALTERNATIVE_SYNTAX (1 << 1) /* deprecated curly brace usage */ + +/* Attributes for ${} encaps var in strings (ZEND_AST_DIM or ZEND_AST_VAR node) */ +/* ZEND_AST_VAR nodes can have any of the ZEND_ENCAPS_VAR_* flags */ +/* ZEND_AST_DIM flags can have ZEND_DIM_ALTERNATIVE_SYNTAX or ZEND_ENCAPS_VAR_DOLLAR_CURLY during the parse phase (ZEND_DIM_ALTERNATIVE_SYNTAX is a thrown fatal error). */ +#define ZEND_ENCAPS_VAR_DOLLAR_CURLY (1 << 0) +#define ZEND_ENCAPS_VAR_DOLLAR_CURLY_VAR_VAR (1 << 1) + +/* Make sure these don't clash with ZEND_FETCH_CLASS_* flags. */ +#define IS_CONSTANT_CLASS 0x400 /* __CLASS__ in trait */ +#define IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE 0x800 + +static zend_always_inline bool zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask) +{ + arg_num--; + if (UNEXPECTED(arg_num >= zf->common.num_args)) { + if (EXPECTED((zf->common.fn_flags & ZEND_ACC_VARIADIC) == 0)) { + return 0; + } + arg_num = zf->common.num_args; + } + return UNEXPECTED((ZEND_ARG_SEND_MODE(&zf->common.arg_info[arg_num]) & mask) != 0); +} + +#define ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \ + zend_check_arg_send_type(zf, arg_num, ZEND_SEND_BY_REF) + +#define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \ + zend_check_arg_send_type(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF) + +#define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \ + zend_check_arg_send_type(zf, arg_num, ZEND_SEND_PREFER_REF) + +/* Quick API to check first 12 arguments */ +#define MAX_ARG_FLAG_NUM 12 + +#ifdef WORDS_BIGENDIAN +# define ZEND_SET_ARG_FLAG(zf, arg_num, mask) do { \ + (zf)->quick_arg_flags |= ((mask) << ((arg_num) - 1) * 2); \ + } while (0) +# define ZEND_CHECK_ARG_FLAG(zf, arg_num, mask) \ + (((zf)->quick_arg_flags >> (((arg_num) - 1) * 2)) & (mask)) +#else +# define ZEND_SET_ARG_FLAG(zf, arg_num, mask) do { \ + (zf)->quick_arg_flags |= (((mask) << 6) << (arg_num) * 2); \ + } while (0) +# define ZEND_CHECK_ARG_FLAG(zf, arg_num, mask) \ + (((zf)->quick_arg_flags >> (((arg_num) + 3) * 2)) & (mask)) +#endif + +#define QUICK_ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \ + ZEND_CHECK_ARG_FLAG(zf, arg_num, ZEND_SEND_BY_REF) + +#define QUICK_ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \ + ZEND_CHECK_ARG_FLAG(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF) + +#define QUICK_ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \ + ZEND_CHECK_ARG_FLAG(zf, arg_num, ZEND_SEND_PREFER_REF) + +#define ZEND_RETURN_VAL 0 +#define ZEND_RETURN_REF 1 + +#define ZEND_BIND_VAL 0 +#define ZEND_BIND_REF 1 +#define ZEND_BIND_IMPLICIT 2 +#define ZEND_BIND_EXPLICIT 4 + +#define ZEND_RETURNS_FUNCTION (1<<0) +#define ZEND_RETURNS_VALUE (1<<1) + +#define ZEND_ARRAY_ELEMENT_REF (1<<0) +#define ZEND_ARRAY_NOT_PACKED (1<<1) +#define ZEND_ARRAY_SIZE_SHIFT 2 + +/* Attribute for ternary inside parentheses */ +#define ZEND_PARENTHESIZED_CONDITIONAL 1 + +/* For "use" AST nodes and the seen symbol table */ +#define ZEND_SYMBOL_CLASS (1<<0) +#define ZEND_SYMBOL_FUNCTION (1<<1) +#define ZEND_SYMBOL_CONST (1<<2) + +/* All increment opcodes are even (decrement are odd) */ +#define ZEND_IS_INCREMENT(opcode) (((opcode) & 1) == 0) + +#define ZEND_IS_BINARY_ASSIGN_OP_OPCODE(opcode) \ + (((opcode) >= ZEND_ADD) && ((opcode) <= ZEND_POW)) + +/* Pseudo-opcodes that are used only temporarily during compilation */ +#define ZEND_GOTO 253 +#define ZEND_BRK 254 +#define ZEND_CONT 255 + + +END_EXTERN_C() + +#define ZEND_CLONE_FUNC_NAME "__clone" +#define ZEND_CONSTRUCTOR_FUNC_NAME "__construct" +#define ZEND_DESTRUCTOR_FUNC_NAME "__destruct" +#define ZEND_GET_FUNC_NAME "__get" +#define ZEND_SET_FUNC_NAME "__set" +#define ZEND_UNSET_FUNC_NAME "__unset" +#define ZEND_ISSET_FUNC_NAME "__isset" +#define ZEND_CALL_FUNC_NAME "__call" +#define ZEND_CALLSTATIC_FUNC_NAME "__callstatic" +#define ZEND_TOSTRING_FUNC_NAME "__tostring" +#define ZEND_INVOKE_FUNC_NAME "__invoke" +#define ZEND_DEBUGINFO_FUNC_NAME "__debuginfo" + +/* The following constants may be combined in CG(compiler_options) + * to change the default compiler behavior */ + +/* generate extended debug information */ +#define ZEND_COMPILE_EXTENDED_STMT (1<<0) +#define ZEND_COMPILE_EXTENDED_FCALL (1<<1) +#define ZEND_COMPILE_EXTENDED_INFO (ZEND_COMPILE_EXTENDED_STMT|ZEND_COMPILE_EXTENDED_FCALL) + +/* call op_array handler of extensions */ +#define ZEND_COMPILE_HANDLE_OP_ARRAY (1<<2) + +/* generate ZEND_INIT_FCALL_BY_NAME for internal functions instead of ZEND_INIT_FCALL */ +#define ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS (1<<3) + +/* don't perform early binding for classes inherited form internal ones; + * in namespaces assume that internal class that doesn't exist at compile-time + * may appear in run-time */ +#define ZEND_COMPILE_IGNORE_INTERNAL_CLASSES (1<<4) + +/* generate ZEND_DECLARE_CLASS_DELAYED opcode to delay early binding */ +#define ZEND_COMPILE_DELAYED_BINDING (1<<5) + +/* disable constant substitution at compile-time */ +#define ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION (1<<6) + +/* disable substitution of persistent constants at compile-time */ +#define ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION (1<<8) + +/* generate ZEND_INIT_FCALL_BY_NAME for userland functions instead of ZEND_INIT_FCALL */ +#define ZEND_COMPILE_IGNORE_USER_FUNCTIONS (1<<9) + +/* force ZEND_ACC_USE_GUARDS for all classes */ +#define ZEND_COMPILE_GUARDS (1<<10) + +/* disable builtin special case function calls */ +#define ZEND_COMPILE_NO_BUILTINS (1<<11) + +/* result of compilation may be stored in file cache */ +#define ZEND_COMPILE_WITH_FILE_CACHE (1<<12) + +/* ignore functions and classes declared in other files */ +#define ZEND_COMPILE_IGNORE_OTHER_FILES (1<<13) + +/* this flag is set when compiler invoked by opcache_compile_file() */ +#define ZEND_COMPILE_WITHOUT_EXECUTION (1<<14) + +/* this flag is set when compiler invoked during preloading */ +#define ZEND_COMPILE_PRELOAD (1<<15) + +/* disable jumptable optimization for switch statements */ +#define ZEND_COMPILE_NO_JUMPTABLES (1<<16) + +/* this flag is set when compiler invoked during preloading in separate process */ +#define ZEND_COMPILE_PRELOAD_IN_CHILD (1<<17) + +/* ignore observer notifications, e.g. to manually notify afterwards in a post-processing step after compilation */ +#define ZEND_COMPILE_IGNORE_OBSERVER (1<<18) + +/* The default value for CG(compiler_options) */ +#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY + +/* The default value for CG(compiler_options) during eval() */ +#define ZEND_COMPILE_DEFAULT_FOR_EVAL 0 + +ZEND_API bool zend_is_op_long_compatible(const zval *op); +ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, const zval *op1, const zval *op2); +ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, const zval *op); + +#endif /* ZEND_COMPILE_H */ diff --git a/include/php/Zend/zend_config.h b/include/php/Zend/zend_config.h new file mode 100644 index 0000000..325c7b5 --- /dev/null +++ b/include/php/Zend/zend_config.h @@ -0,0 +1 @@ +#include <../main/php_config.h> diff --git a/include/php/Zend/zend_config.w32.h b/include/php/Zend/zend_config.w32.h new file mode 100644 index 0000000..da6b1f8 --- /dev/null +++ b/include/php/Zend/zend_config.w32.h @@ -0,0 +1,60 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_CONFIG_W32_H +#define ZEND_CONFIG_W32_H + +#include <../main/config.w32.h> + +#define _CRTDBG_MAP_ALLOC + +#include +#include +#include + +#include + +#ifndef ZEND_INCLUDE_FULL_WINDOWS_HEADERS +#define WIN32_LEAN_AND_MEAN +#endif +#include +#include + +#include + +#define HAVE_STDIOSTR_H 1 +#define HAVE_CLASS_ISTDIOSTREAM +#define istdiostream stdiostream + +#if _MSC_VER < 1900 +#define snprintf _snprintf +#endif +#define strcasecmp(s1, s2) _stricmp(s1, s2) +#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) + +#ifdef LIBZEND_EXPORTS +# define ZEND_API __declspec(dllexport) +#else +# define ZEND_API __declspec(dllimport) +#endif + +#define ZEND_DLEXPORT __declspec(dllexport) +#define ZEND_DLIMPORT __declspec(dllimport) + +#endif /* ZEND_CONFIG_W32_H */ diff --git a/include/php/Zend/zend_constants.h b/include/php/Zend/zend_constants.h new file mode 100644 index 0000000..736dbb0 --- /dev/null +++ b/include/php/Zend/zend_constants.h @@ -0,0 +1,106 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_CONSTANTS_H +#define ZEND_CONSTANTS_H + +#include "zend_globals.h" + +#define CONST_CS 0 /* No longer used -- always case sensitive */ +#define CONST_PERSISTENT (1<<0) /* Persistent */ +#define CONST_NO_FILE_CACHE (1<<1) /* Can't be saved in file cache */ +#define CONST_DEPRECATED (1<<2) /* Deprecated */ +#define CONST_OWNED (1<<3) /* constant should be destroyed together with class */ + +#define PHP_USER_CONSTANT 0x7fffff /* a constant defined in user space */ + +typedef struct _zend_constant { + zval value; + zend_string *name; +} zend_constant; + +#define ZEND_CONSTANT_FLAGS(c) \ + (Z_CONSTANT_FLAGS((c)->value) & 0xff) + +#define ZEND_CONSTANT_MODULE_NUMBER(c) \ + (Z_CONSTANT_FLAGS((c)->value) >> 8) + +#define ZEND_CONSTANT_SET_FLAGS(c, _flags, _module_number) do { \ + Z_CONSTANT_FLAGS((c)->value) = \ + ((_flags) & 0xff) | ((_module_number) << 8); \ + } while (0) + +#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), module_number) +#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), module_number) +#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number) +#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name)-1, (dval), (flags), module_number) +#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number) +#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), module_number) + +#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (flags), module_number) +#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (bval), (flags), module_number) +#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (lval), (flags), module_number) +#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (dval), (flags), module_number) +#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number) +#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (len), (flags), module_number) + +#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), 0) +#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), 0) +#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), 0) +#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name)-1, (dval), (flags), 0) +#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), 0) +#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), 0) + +BEGIN_EXTERN_C() +void clean_module_constants(int module_number); +void free_zend_constant(zval *zv); +void zend_startup_constants(void); +void zend_shutdown_constants(void); +void zend_register_standard_constants(void); +ZEND_API bool zend_verify_const_access(zend_class_constant *c, zend_class_entry *ce); +ZEND_API zval *zend_get_constant(zend_string *name); +ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len); +ZEND_API zval *zend_get_constant_ex(zend_string *name, zend_class_entry *scope, uint32_t flags); +ZEND_API zval *zend_get_class_constant_ex(zend_string *class_name, zend_string *constant_name, zend_class_entry *scope, uint32_t flags); +ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, bool bval, int flags, int module_number); +ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_number); +ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int flags, int module_number); +ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int flags, int module_number); +ZEND_API void zend_register_string_constant(const char *name, size_t name_len, const char *strval, int flags, int module_number); +ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, const char *strval, size_t strlen, int flags, int module_number); +ZEND_API zend_result zend_register_constant(zend_constant *c); +#ifdef ZTS +void zend_copy_constants(HashTable *target, HashTable *source); +#endif + +ZEND_API zend_constant *_zend_get_special_const(const char *name, size_t name_len); + +static zend_always_inline zend_constant *zend_get_special_const( + const char *name, size_t name_len) { + if (name_len == 4 || name_len == 5) { + return _zend_get_special_const(name, name_len); + } + return NULL; +} + +END_EXTERN_C() + +#define ZEND_CONSTANT_DTOR free_zend_constant + +#endif diff --git a/include/php/Zend/zend_constants_arginfo.h b/include/php/Zend/zend_constants_arginfo.h new file mode 100644 index 0000000..c2b24c2 --- /dev/null +++ b/include/php/Zend/zend_constants_arginfo.h @@ -0,0 +1,31 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: df76f4e5a735baba96c4ac3538e9e3e48d934f0f */ + + + +static void register_zend_constants_symbols(int module_number) +{ + REGISTER_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_CORE_ERROR", E_CORE_ERROR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_COMPILE_WARNING", E_COMPILE_WARNING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_USER_ERROR", E_USER_ERROR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_USER_WARNING", E_USER_WARNING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_USER_NOTICE", E_USER_NOTICE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_STRICT", E_STRICT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_DEPRECATED", E_DEPRECATED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_USER_DEPRECATED", E_USER_DEPRECATED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("DEBUG_BACKTRACE_PROVIDE_OBJECT", DEBUG_BACKTRACE_PROVIDE_OBJECT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("DEBUG_BACKTRACE_IGNORE_ARGS", DEBUG_BACKTRACE_IGNORE_ARGS, CONST_PERSISTENT); + REGISTER_BOOL_CONSTANT("ZEND_THREAD_SAFE", ZTS_V, CONST_PERSISTENT); + REGISTER_BOOL_CONSTANT("ZEND_DEBUG_BUILD", ZEND_DEBUG, CONST_PERSISTENT); + REGISTER_BOOL_CONSTANT("TRUE", true, CONST_PERSISTENT); + REGISTER_BOOL_CONSTANT("FALSE", false, CONST_PERSISTENT); + REGISTER_NULL_CONSTANT("NULL", CONST_PERSISTENT); +} diff --git a/include/php/Zend/zend_cpuinfo.h b/include/php/Zend/zend_cpuinfo.h new file mode 100644 index 0000000..9d221c5 --- /dev/null +++ b/include/php/Zend/zend_cpuinfo.h @@ -0,0 +1,272 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_CPU_INFO_H +#define ZEND_CPU_INFO_H + +#include "zend.h" + +#define ZEND_CPU_EBX_MASK (1<<30) +#define ZEND_CPU_EDX_MASK (1U<<31) + +typedef enum _zend_cpu_feature { + /* ECX */ + ZEND_CPU_FEATURE_SSE3 = (1<<0), + ZEND_CPU_FEATURE_PCLMULQDQ = (1<<1), + ZEND_CPU_FEATURE_DTES64 = (1<<2), + ZEND_CPU_FEATURE_MONITOR = (1<<3), + ZEND_CPU_FEATURE_DSCPL = (1<<4), + ZEND_CPU_FEATURE_VMX = (1<<5), + ZEND_CPU_FEATURE_SMX = (1<<6), + ZEND_CPU_FEATURE_EST = (1<<7), + ZEND_CPU_FEATURE_TM2 = (1<<8), + ZEND_CPU_FEATURE_SSSE3 = (1<<9), + ZEND_CPU_FEATURE_CID = (1<<10), + ZEND_CPU_FEATURE_SDBG = (1<<11), + ZEND_CPU_FEATURE_FMA = (1<<12), + ZEND_CPU_FEATURE_CX16 = (1<<13), + ZEND_CPU_FEATURE_XTPR = (1<<14), + ZEND_CPU_FEATURE_PDCM = (1<<15), + /* reserved = (1<<16),*/ + ZEND_CPU_FEATURE_PCID = (1<<17), + ZEND_CPU_FEATURE_DCA = (1<<18), + ZEND_CPU_FEATURE_SSE41 = (1<<19), + ZEND_CPU_FEATURE_SSE42 = (1<<20), + ZEND_CPU_FEATURE_X2APIC = (1<<21), + ZEND_CPU_FEATURE_MOVBE = (1<<22), + ZEND_CPU_FEATURE_POPCNT = (1<<23), + ZEND_CPU_FEATURE_TSC_DEADLINE = (1<<24), + ZEND_CPU_FEATURE_AES = (1<<25), + ZEND_CPU_FEATURE_XSAVE = (1<<26), + ZEND_CPU_FEATURE_OSXSAVE = (1<<27) , + ZEND_CPU_FEATURE_AVX = (1<<28), + ZEND_CPU_FEATURE_F16C = (1<<29), + /* intentionally don't support = (1<<30) */ + /* intentionally don't support = (1<<31) */ + + /* EBX */ + ZEND_CPU_FEATURE_AVX2 = (1<<5 | ZEND_CPU_EBX_MASK), + ZEND_CPU_FEATURE_AVX512F = (1<<16 | ZEND_CPU_EBX_MASK), + ZEND_CPU_FEATURE_AVX512DQ = (1<<17 | ZEND_CPU_EBX_MASK), + ZEND_CPU_FEATURE_AVX512CD = (1<<28 | ZEND_CPU_EBX_MASK), + /* intentionally don't support = (1<<30 | ZEND_CPU_EBX_MASK) */ + /* intentionally don't support = (1<<31 | ZEND_CPU_EBX_MASK) */ + + /* EDX */ + ZEND_CPU_FEATURE_FPU = (1<<0 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_VME = (1<<1 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_DE = (1<<2 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_PSE = (1<<3 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_TSC = (1<<4 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_MSR = (1<<5 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_PAE = (1<<6 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_MCE = (1<<7 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_CX8 = (1<<8 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_APIC = (1<<9 | ZEND_CPU_EDX_MASK), + /* reserved = (1<<10 | ZEND_CPU_EDX_MASK),*/ + ZEND_CPU_FEATURE_SEP = (1<<11 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_MTRR = (1<<12 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_PGE = (1<<13 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_MCA = (1<<14 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_CMOV = (1<<15 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_PAT = (1<<16 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_PSE36 = (1<<17 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_PN = (1<<18 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_CLFLUSH = (1<<19 | ZEND_CPU_EDX_MASK), + /* reserved = (1<<20 | ZEND_CPU_EDX_MASK),*/ + ZEND_CPU_FEATURE_DS = (1<<21 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_ACPI = (1<<22 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_MMX = (1<<23 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_FXSR = (1<<24 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_SSE = (1<<25 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_SSE2 = (1<<26 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_SS = (1<<27 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_HT = (1<<28 | ZEND_CPU_EDX_MASK), + ZEND_CPU_FEATURE_TM = (1<<29 | ZEND_CPU_EDX_MASK) + /*intentionally don't support = (1<<30 | ZEND_CPU_EDX_MASK)*/ + /*intentionally don't support = (1<<31 | ZEND_CPU_EDX_MASK)*/ +} zend_cpu_feature; + +void zend_cpu_startup(void); +ZEND_API int zend_cpu_supports(zend_cpu_feature feature); + +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif + +/* Address sanitizer is incompatible with ifunc resolvers, so exclude the + * CPU support helpers from asan. + * See also https://github.com/google/sanitizers/issues/342. */ +#if __has_attribute(no_sanitize_address) +# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) +#else +# define ZEND_NO_SANITIZE_ADDRESS +#endif + +#if PHP_HAVE_BUILTIN_CPU_SUPPORTS +/* NOTE: you should use following inline function in + * resolver functions (ifunc), as it could be called + * before all PLT symbols are resolved. in other words, + * resolver functions should not depend on any external + * functions */ +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_sse2(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("sse2"); +} + +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_sse3(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("sse3"); +} + +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_ssse3(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("ssse3"); +} + +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_sse41(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("sse4.1"); +} + +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_sse42(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("sse4.2"); +} + +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_avx(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("avx"); +} + +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_avx2(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("avx2"); +} + +#if PHP_HAVE_AVX512_SUPPORTS +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_avx512(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512dq") + && __builtin_cpu_supports("avx512cd") && __builtin_cpu_supports("avx512bw") + && __builtin_cpu_supports("avx512vl"); +} +#endif + +#if PHP_HAVE_AVX512_VBMI_SUPPORTS +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_avx512_vbmi(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return zend_cpu_supports_avx512() && __builtin_cpu_supports("avx512vbmi"); +} +#endif + +#else + +static inline int zend_cpu_supports_sse2(void) { + return zend_cpu_supports(ZEND_CPU_FEATURE_SSE2); +} + +static inline int zend_cpu_supports_sse3(void) { + return zend_cpu_supports(ZEND_CPU_FEATURE_SSE3); +} + +static inline int zend_cpu_supports_ssse3(void) { + return zend_cpu_supports(ZEND_CPU_FEATURE_SSSE3); +} + +static inline int zend_cpu_supports_sse41(void) { + return zend_cpu_supports(ZEND_CPU_FEATURE_SSE41); +} + +static inline int zend_cpu_supports_sse42(void) { + return zend_cpu_supports(ZEND_CPU_FEATURE_SSE42); +} + +static inline int zend_cpu_supports_avx(void) { + return zend_cpu_supports(ZEND_CPU_FEATURE_AVX); +} + +static inline int zend_cpu_supports_avx2(void) { + return zend_cpu_supports(ZEND_CPU_FEATURE_AVX2); +} + +static inline int zend_cpu_supports_avx512(void) { + /* TODO: avx512_bw/avx512_vl use bit 30/31 which are reserved for mask */ + return 0; +} + +static zend_always_inline int zend_cpu_supports_avx512_vbmi(void) { + /* TODO: avx512_vbmi use ECX of cpuid 7 */ + return 0; +} +#endif + +/* __builtin_cpu_supports has pclmul from gcc9 */ +#if PHP_HAVE_BUILTIN_CPU_SUPPORTS && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000)) +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_pclmul(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("pclmul"); +} +#else +static inline int zend_cpu_supports_pclmul(void) { + return zend_cpu_supports(ZEND_CPU_FEATURE_PCLMULQDQ); +} +#endif + +/* __builtin_cpu_supports has cldemote from gcc11 */ +#if PHP_HAVE_BUILTIN_CPU_SUPPORTS && defined(__GNUC__) && (ZEND_GCC_VERSION >= 11000) +ZEND_NO_SANITIZE_ADDRESS +static inline int zend_cpu_supports_cldemote(void) { +#if PHP_HAVE_BUILTIN_CPU_INIT + __builtin_cpu_init(); +#endif + return __builtin_cpu_supports("cldemote"); +} +#endif + +#endif diff --git a/include/php/Zend/zend_dtrace.h b/include/php/Zend/zend_dtrace.h new file mode 100644 index 0000000..53ccaca --- /dev/null +++ b/include/php/Zend/zend_dtrace.h @@ -0,0 +1,48 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: David Soria Parra | + +----------------------------------------------------------------------+ +*/ + +#ifndef _ZEND_DTRACE_H +#define _ZEND_DTRACE_H + +#ifndef ZEND_WIN32 +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_DTRACE +ZEND_API extern zend_op_array *(*zend_dtrace_compile_file)(zend_file_handle *file_handle, int type); +ZEND_API extern void (*zend_dtrace_execute)(zend_op_array *op_array); +ZEND_API extern void (*zend_dtrace_execute_internal)(zend_execute_data *execute_data, zval *return_value); + +ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type); +ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data); +ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data, zval *return_value); +#include + +void dtrace_error_notify_cb(int type, zend_string *error_filename, uint32_t error_lineno, zend_string *message); + +#endif /* HAVE_DTRACE */ + +#ifdef __cplusplus +} +#endif + +#endif /* _ZEND_DTRACE_H */ diff --git a/include/php/Zend/zend_enum.h b/include/php/Zend/zend_enum.h new file mode 100644 index 0000000..7b58592 --- /dev/null +++ b/include/php/Zend/zend_enum.h @@ -0,0 +1,64 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Ilija Tovilo | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_ENUM_H +#define ZEND_ENUM_H + +#include "zend.h" +#include "zend_types.h" + +#include + +BEGIN_EXTERN_C() + +extern ZEND_API zend_class_entry *zend_ce_unit_enum; +extern ZEND_API zend_class_entry *zend_ce_backed_enum; +extern ZEND_API zend_object_handlers zend_enum_object_handlers; + +void zend_register_enum_ce(void); +void zend_enum_add_interfaces(zend_class_entry *ce); +zend_result zend_enum_build_backed_enum_table(zend_class_entry *ce); +zend_object *zend_enum_new(zval *result, zend_class_entry *ce, zend_string *case_name, zval *backing_value_zv); +void zend_verify_enum(zend_class_entry *ce); +void zend_enum_register_funcs(zend_class_entry *ce); +void zend_enum_register_props(zend_class_entry *ce); + +ZEND_API zend_class_entry *zend_register_internal_enum( + const char *name, uint8_t type, const zend_function_entry *functions); +ZEND_API void zend_enum_add_case(zend_class_entry *ce, zend_string *case_name, zval *value); +ZEND_API void zend_enum_add_case_cstr(zend_class_entry *ce, const char *name, zval *value); +ZEND_API zend_object *zend_enum_get_case(zend_class_entry *ce, zend_string *name); +ZEND_API zend_object *zend_enum_get_case_cstr(zend_class_entry *ce, const char *name); +ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool try); + +static zend_always_inline zval *zend_enum_fetch_case_name(zend_object *zobj) +{ + ZEND_ASSERT(zobj->ce->ce_flags & ZEND_ACC_ENUM); + return OBJ_PROP_NUM(zobj, 0); +} + +static zend_always_inline zval *zend_enum_fetch_case_value(zend_object *zobj) +{ + ZEND_ASSERT(zobj->ce->ce_flags & ZEND_ACC_ENUM); + ZEND_ASSERT(zobj->ce->enum_backing_type != IS_UNDEF); + return OBJ_PROP_NUM(zobj, 1); +} + +END_EXTERN_C() + +#endif /* ZEND_ENUM_H */ diff --git a/include/php/Zend/zend_enum_arginfo.h b/include/php/Zend/zend_enum_arginfo.h new file mode 100644 index 0000000..a1b53cf --- /dev/null +++ b/include/php/Zend/zend_enum_arginfo.h @@ -0,0 +1,49 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 7092f1d4ba651f077cff37050899f090f00abf22 */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_UnitEnum_cases, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_BackedEnum_from, 0, 1, IS_STATIC, 0) + ZEND_ARG_TYPE_MASK(0, value, MAY_BE_LONG|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_BackedEnum_tryFrom, 0, 1, IS_STATIC, 1) + ZEND_ARG_TYPE_MASK(0, value, MAY_BE_LONG|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + + + + +static const zend_function_entry class_UnitEnum_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(UnitEnum, cases, arginfo_class_UnitEnum_cases, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + + +static const zend_function_entry class_BackedEnum_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(BackedEnum, from, arginfo_class_BackedEnum_from, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(BackedEnum, tryFrom, arginfo_class_BackedEnum_tryFrom, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + +static zend_class_entry *register_class_UnitEnum(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "UnitEnum", class_UnitEnum_methods); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + +static zend_class_entry *register_class_BackedEnum(zend_class_entry *class_entry_UnitEnum) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "BackedEnum", class_BackedEnum_methods); + class_entry = zend_register_internal_interface(&ce); + zend_class_implements(class_entry, 1, class_entry_UnitEnum); + + return class_entry; +} diff --git a/include/php/Zend/zend_errors.h b/include/php/Zend/zend_errors.h new file mode 100644 index 0000000..dd75395 --- /dev/null +++ b/include/php/Zend/zend_errors.h @@ -0,0 +1,50 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_ERRORS_H +#define ZEND_ERRORS_H + +#define E_ERROR (1<<0L) +#define E_WARNING (1<<1L) +#define E_PARSE (1<<2L) +#define E_NOTICE (1<<3L) +#define E_CORE_ERROR (1<<4L) +#define E_CORE_WARNING (1<<5L) +#define E_COMPILE_ERROR (1<<6L) +#define E_COMPILE_WARNING (1<<7L) +#define E_USER_ERROR (1<<8L) +#define E_USER_WARNING (1<<9L) +#define E_USER_NOTICE (1<<10L) +#define E_STRICT (1<<11L) +#define E_RECOVERABLE_ERROR (1<<12L) +#define E_DEPRECATED (1<<13L) +#define E_USER_DEPRECATED (1<<14L) + +/* Indicates that this usually fatal error should not result in a bailout */ +#define E_DONT_BAIL (1<<15L) + +#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT) +#define E_CORE (E_CORE_ERROR | E_CORE_WARNING) + +/* Fatal errors that are ignored by the silence operator */ +#define E_FATAL_ERRORS (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE) + +#define E_HAS_ONLY_FATAL_ERRORS(mask) !((mask) & ~E_FATAL_ERRORS) + +#endif /* ZEND_ERRORS_H */ diff --git a/include/php/Zend/zend_exceptions.h b/include/php/Zend/zend_exceptions.h new file mode 100644 index 0000000..f61b5ec --- /dev/null +++ b/include/php/Zend/zend_exceptions.h @@ -0,0 +1,93 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Marcus Boerger | + | Sterling Hughes | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_EXCEPTIONS_H +#define ZEND_EXCEPTIONS_H + +BEGIN_EXTERN_C() + +extern ZEND_API zend_class_entry *zend_ce_throwable; +extern ZEND_API zend_class_entry *zend_ce_exception; +extern ZEND_API zend_class_entry *zend_ce_error_exception; +extern ZEND_API zend_class_entry *zend_ce_error; +extern ZEND_API zend_class_entry *zend_ce_compile_error; +extern ZEND_API zend_class_entry *zend_ce_parse_error; +extern ZEND_API zend_class_entry *zend_ce_type_error; +extern ZEND_API zend_class_entry *zend_ce_argument_count_error; +extern ZEND_API zend_class_entry *zend_ce_value_error; +extern ZEND_API zend_class_entry *zend_ce_arithmetic_error; +extern ZEND_API zend_class_entry *zend_ce_division_by_zero_error; +extern ZEND_API zend_class_entry *zend_ce_unhandled_match_error; + +ZEND_API void zend_exception_set_previous(zend_object *exception, zend_object *add_previous); +ZEND_API void zend_exception_save(void); +ZEND_API void zend_exception_restore(void); + +ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception); + +void zend_register_default_exception(void); + +ZEND_API zend_class_entry *zend_get_exception_base(zend_object *object); + +/* Deprecated - Use zend_ce_exception directly instead */ +ZEND_API zend_class_entry *zend_exception_get_default(void); + +/* Deprecated - Use zend_ce_error_exception directly instead */ +ZEND_API zend_class_entry *zend_get_error_exception(void); + +ZEND_API void zend_register_default_classes(void); + +/* exception_ce NULL, zend_ce_exception, zend_ce_error, or a derived class + * message NULL or the message of the exception */ +ZEND_API ZEND_COLD zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code); +ZEND_API ZEND_COLD zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4); +ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception); +ZEND_API void zend_clear_exception(void); + +ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, zend_string *message, zend_long code, int severity); + +extern ZEND_API void (*zend_throw_exception_hook)(zend_object *ex); + +/* show an exception using zend_error(severity,...), severity should be E_ERROR */ +ZEND_API ZEND_COLD zend_result zend_exception_error(zend_object *exception, int severity); +ZEND_NORETURN void zend_exception_uncaught_error(const char *prefix, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); +ZEND_API zend_string *zend_trace_to_string(HashTable *trace, bool include_main); + +ZEND_API ZEND_COLD zend_object *zend_create_unwind_exit(void); +ZEND_API ZEND_COLD zend_object *zend_create_graceful_exit(void); +ZEND_API ZEND_COLD void zend_throw_unwind_exit(void); +ZEND_API ZEND_COLD void zend_throw_graceful_exit(void); +ZEND_API bool zend_is_unwind_exit(const zend_object *ex); +ZEND_API bool zend_is_graceful_exit(const zend_object *ex); + +#include "zend_globals.h" + +static zend_always_inline void zend_rethrow_exception(zend_execute_data *execute_data) +{ + if (EX(opline)->opcode != ZEND_HANDLE_EXCEPTION) { + EG(opline_before_exception) = EX(opline); + EX(opline) = EG(exception_op); + } +} + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_exceptions_arginfo.h b/include/php/Zend/zend_exceptions_arginfo.h new file mode 100644 index 0000000..c0e274d --- /dev/null +++ b/include/php/Zend/zend_exceptions_arginfo.h @@ -0,0 +1,403 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 4cf2c620393f468968a219b5bd12a2b5f6b03ecc */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getMessage, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Throwable_getCode, 0, 0, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Throwable_getFile arginfo_class_Throwable_getMessage + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getLine, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getTrace, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Throwable_getPrevious, 0, 0, Throwable, 1) +ZEND_END_ARG_INFO() + +#define arginfo_class_Throwable_getTraceAsString arginfo_class_Throwable_getMessage + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Exception___clone, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Exception___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_LONG, 0, "0") + ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, previous, Throwable, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Exception___wakeup, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Exception_getMessage arginfo_class_Throwable_getMessage + +#define arginfo_class_Exception_getCode arginfo_class_Throwable_getCode + +#define arginfo_class_Exception_getFile arginfo_class_Throwable_getMessage + +#define arginfo_class_Exception_getLine arginfo_class_Throwable_getLine + +#define arginfo_class_Exception_getTrace arginfo_class_Throwable_getTrace + +#define arginfo_class_Exception_getPrevious arginfo_class_Throwable_getPrevious + +#define arginfo_class_Exception_getTraceAsString arginfo_class_Throwable_getMessage + +#define arginfo_class_Exception___toString arginfo_class_Throwable_getMessage + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ErrorException___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, severity, IS_LONG, 0, "E_ERROR") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, line, IS_LONG, 1, "null") + ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, previous, Throwable, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_class_ErrorException_getSeverity arginfo_class_Throwable_getLine + +#define arginfo_class_Error___clone arginfo_class_Exception___clone + +#define arginfo_class_Error___construct arginfo_class_Exception___construct + +#define arginfo_class_Error___wakeup arginfo_class_Exception___wakeup + +#define arginfo_class_Error_getMessage arginfo_class_Throwable_getMessage + +#define arginfo_class_Error_getCode arginfo_class_Throwable_getCode + +#define arginfo_class_Error_getFile arginfo_class_Throwable_getMessage + +#define arginfo_class_Error_getLine arginfo_class_Throwable_getLine + +#define arginfo_class_Error_getTrace arginfo_class_Throwable_getTrace + +#define arginfo_class_Error_getPrevious arginfo_class_Throwable_getPrevious + +#define arginfo_class_Error_getTraceAsString arginfo_class_Throwable_getMessage + +#define arginfo_class_Error___toString arginfo_class_Throwable_getMessage + + +ZEND_METHOD(Exception, __clone); +ZEND_METHOD(Exception, __construct); +ZEND_METHOD(Exception, __wakeup); +ZEND_METHOD(Exception, getMessage); +ZEND_METHOD(Exception, getCode); +ZEND_METHOD(Exception, getFile); +ZEND_METHOD(Exception, getLine); +ZEND_METHOD(Exception, getTrace); +ZEND_METHOD(Exception, getPrevious); +ZEND_METHOD(Exception, getTraceAsString); +ZEND_METHOD(Exception, __toString); +ZEND_METHOD(ErrorException, __construct); +ZEND_METHOD(ErrorException, getSeverity); + + +static const zend_function_entry class_Throwable_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getMessage, arginfo_class_Throwable_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getCode, arginfo_class_Throwable_getCode, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getFile, arginfo_class_Throwable_getFile, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getLine, arginfo_class_Throwable_getLine, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getTrace, arginfo_class_Throwable_getTrace, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getPrevious, arginfo_class_Throwable_getPrevious, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getTraceAsString, arginfo_class_Throwable_getTraceAsString, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + + +static const zend_function_entry class_Exception_methods[] = { + ZEND_ME(Exception, __clone, arginfo_class_Exception___clone, ZEND_ACC_PRIVATE) + ZEND_ME(Exception, __construct, arginfo_class_Exception___construct, ZEND_ACC_PUBLIC) + ZEND_ME(Exception, __wakeup, arginfo_class_Exception___wakeup, ZEND_ACC_PUBLIC) + ZEND_ME(Exception, getMessage, arginfo_class_Exception_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(Exception, getCode, arginfo_class_Exception_getCode, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(Exception, getFile, arginfo_class_Exception_getFile, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(Exception, getLine, arginfo_class_Exception_getLine, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(Exception, getTrace, arginfo_class_Exception_getTrace, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(Exception, getPrevious, arginfo_class_Exception_getPrevious, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(Exception, getTraceAsString, arginfo_class_Exception_getTraceAsString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(Exception, __toString, arginfo_class_Exception___toString, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_ErrorException_methods[] = { + ZEND_ME(ErrorException, __construct, arginfo_class_ErrorException___construct, ZEND_ACC_PUBLIC) + ZEND_ME(ErrorException, getSeverity, arginfo_class_ErrorException_getSeverity, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_FE_END +}; + + +static const zend_function_entry class_Error_methods[] = { + ZEND_MALIAS(Exception, __clone, __clone, arginfo_class_Error___clone, ZEND_ACC_PRIVATE) + ZEND_MALIAS(Exception, __construct, __construct, arginfo_class_Error___construct, ZEND_ACC_PUBLIC) + ZEND_MALIAS(Exception, __wakeup, __wakeup, arginfo_class_Error___wakeup, ZEND_ACC_PUBLIC) + ZEND_MALIAS(Exception, getMessage, getMessage, arginfo_class_Error_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_MALIAS(Exception, getCode, getCode, arginfo_class_Error_getCode, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_MALIAS(Exception, getFile, getFile, arginfo_class_Error_getFile, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_MALIAS(Exception, getLine, getLine, arginfo_class_Error_getLine, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_MALIAS(Exception, getTrace, getTrace, arginfo_class_Error_getTrace, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_MALIAS(Exception, getPrevious, getPrevious, arginfo_class_Error_getPrevious, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_MALIAS(Exception, getTraceAsString, getTraceAsString, arginfo_class_Error_getTraceAsString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_MALIAS(Exception, __toString, __toString, arginfo_class_Error___toString, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_CompileError_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_ParseError_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_TypeError_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_ArgumentCountError_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_ValueError_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_ArithmeticError_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_DivisionByZeroError_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_UnhandledMatchError_methods[] = { + ZEND_FE_END +}; + +static zend_class_entry *register_class_Throwable(zend_class_entry *class_entry_Stringable) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Throwable", class_Throwable_methods); + class_entry = zend_register_internal_interface(&ce); + zend_class_implements(class_entry, 1, class_entry_Stringable); + + return class_entry; +} + +static zend_class_entry *register_class_Exception(zend_class_entry *class_entry_Throwable) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Exception", class_Exception_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + zend_class_implements(class_entry, 1, class_entry_Throwable); + + zval property_message_default_value; + ZVAL_EMPTY_STRING(&property_message_default_value); + zend_string *property_message_name = zend_string_init("message", sizeof("message") - 1, 1); + zend_declare_typed_property(class_entry, property_message_name, &property_message_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); + zend_string_release(property_message_name); + + zval property_string_default_value; + ZVAL_EMPTY_STRING(&property_string_default_value); + zend_string *property_string_name = zend_string_init("string", sizeof("string") - 1, 1); + zend_declare_typed_property(class_entry, property_string_name, &property_string_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_string_release(property_string_name); + + zval property_code_default_value; + ZVAL_LONG(&property_code_default_value, 0); + zend_string *property_code_name = zend_string_init("code", sizeof("code") - 1, 1); + zend_declare_typed_property(class_entry, property_code_name, &property_code_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); + zend_string_release(property_code_name); + + zval property_file_default_value; + ZVAL_EMPTY_STRING(&property_file_default_value); + zend_string *property_file_name = zend_string_init("file", sizeof("file") - 1, 1); + zend_declare_typed_property(class_entry, property_file_name, &property_file_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_string_release(property_file_name); + + zval property_line_default_value; + ZVAL_LONG(&property_line_default_value, 0); + zend_string *property_line_name = zend_string_init("line", sizeof("line") - 1, 1); + zend_declare_typed_property(class_entry, property_line_name, &property_line_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(property_line_name); + + zval property_trace_default_value; + ZVAL_EMPTY_ARRAY(&property_trace_default_value); + zend_string *property_trace_name = zend_string_init("trace", sizeof("trace") - 1, 1); + zend_declare_typed_property(class_entry, property_trace_name, &property_trace_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY)); + zend_string_release(property_trace_name); + + zval property_previous_default_value; + ZVAL_NULL(&property_previous_default_value); + zend_string *property_previous_name = zend_string_init("previous", sizeof("previous") - 1, 1); + zend_string *property_previous_class_Throwable = zend_string_init("Throwable", sizeof("Throwable")-1, 1); + zend_declare_typed_property(class_entry, property_previous_name, &property_previous_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previous_class_Throwable, 0, MAY_BE_NULL)); + zend_string_release(property_previous_name); + + return class_entry; +} + +static zend_class_entry *register_class_ErrorException(zend_class_entry *class_entry_Exception) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ErrorException", class_ErrorException_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception); + + zval property_severity_default_value; + ZVAL_LONG(&property_severity_default_value, E_ERROR); + zend_string *property_severity_name = zend_string_init("severity", sizeof("severity") - 1, 1); + zend_declare_typed_property(class_entry, property_severity_name, &property_severity_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(property_severity_name); + + return class_entry; +} + +static zend_class_entry *register_class_Error(zend_class_entry *class_entry_Throwable) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Error", class_Error_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + zend_class_implements(class_entry, 1, class_entry_Throwable); + + zval property_message_default_value; + ZVAL_EMPTY_STRING(&property_message_default_value); + zend_string *property_message_name = zend_string_init("message", sizeof("message") - 1, 1); + zend_declare_typed_property(class_entry, property_message_name, &property_message_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); + zend_string_release(property_message_name); + + zval property_string_default_value; + ZVAL_EMPTY_STRING(&property_string_default_value); + zend_string *property_string_name = zend_string_init("string", sizeof("string") - 1, 1); + zend_declare_typed_property(class_entry, property_string_name, &property_string_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_string_release(property_string_name); + + zval property_code_default_value; + ZVAL_LONG(&property_code_default_value, 0); + zend_string *property_code_name = zend_string_init("code", sizeof("code") - 1, 1); + zend_declare_typed_property(class_entry, property_code_name, &property_code_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); + zend_string_release(property_code_name); + + zval property_file_default_value; + ZVAL_EMPTY_STRING(&property_file_default_value); + zend_string *property_file_name = zend_string_init("file", sizeof("file") - 1, 1); + zend_declare_typed_property(class_entry, property_file_name, &property_file_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_string_release(property_file_name); + + zval property_line_default_value; + ZVAL_UNDEF(&property_line_default_value); + zend_string *property_line_name = zend_string_init("line", sizeof("line") - 1, 1); + zend_declare_typed_property(class_entry, property_line_name, &property_line_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_string_release(property_line_name); + + zval property_trace_default_value; + ZVAL_EMPTY_ARRAY(&property_trace_default_value); + zend_string *property_trace_name = zend_string_init("trace", sizeof("trace") - 1, 1); + zend_declare_typed_property(class_entry, property_trace_name, &property_trace_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY)); + zend_string_release(property_trace_name); + + zval property_previous_default_value; + ZVAL_NULL(&property_previous_default_value); + zend_string *property_previous_name = zend_string_init("previous", sizeof("previous") - 1, 1); + zend_string *property_previous_class_Throwable = zend_string_init("Throwable", sizeof("Throwable")-1, 1); + zend_declare_typed_property(class_entry, property_previous_name, &property_previous_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previous_class_Throwable, 0, MAY_BE_NULL)); + zend_string_release(property_previous_name); + + return class_entry; +} + +static zend_class_entry *register_class_CompileError(zend_class_entry *class_entry_Error) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "CompileError", class_CompileError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Error); + + return class_entry; +} + +static zend_class_entry *register_class_ParseError(zend_class_entry *class_entry_CompileError) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ParseError", class_ParseError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_CompileError); + + return class_entry; +} + +static zend_class_entry *register_class_TypeError(zend_class_entry *class_entry_Error) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "TypeError", class_TypeError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Error); + + return class_entry; +} + +static zend_class_entry *register_class_ArgumentCountError(zend_class_entry *class_entry_TypeError) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ArgumentCountError", class_ArgumentCountError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_TypeError); + + return class_entry; +} + +static zend_class_entry *register_class_ValueError(zend_class_entry *class_entry_Error) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ValueError", class_ValueError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Error); + + return class_entry; +} + +static zend_class_entry *register_class_ArithmeticError(zend_class_entry *class_entry_Error) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ArithmeticError", class_ArithmeticError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Error); + + return class_entry; +} + +static zend_class_entry *register_class_DivisionByZeroError(zend_class_entry *class_entry_ArithmeticError) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "DivisionByZeroError", class_DivisionByZeroError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_ArithmeticError); + + return class_entry; +} + +static zend_class_entry *register_class_UnhandledMatchError(zend_class_entry *class_entry_Error) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "UnhandledMatchError", class_UnhandledMatchError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Error); + + return class_entry; +} diff --git a/include/php/Zend/zend_execute.h b/include/php/Zend/zend_execute.h new file mode 100644 index 0000000..d0c1804 --- /dev/null +++ b/include/php/Zend/zend_execute.h @@ -0,0 +1,534 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_EXECUTE_H +#define ZEND_EXECUTE_H + +#include "zend_compile.h" +#include "zend_hash.h" +#include "zend_operators.h" +#include "zend_variables.h" + +#include + +BEGIN_EXTERN_C() +struct _zend_fcall_info; +ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data); +ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value); + +/* The lc_name may be stack allocated! */ +ZEND_API extern zend_class_entry *(*zend_autoload)(zend_string *name, zend_string *lc_name); + +void init_executor(void); +void shutdown_executor(void); +void shutdown_destructors(void); +ZEND_API void zend_shutdown_executor_values(bool fast_shutdown); + +ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value); +ZEND_API void zend_init_func_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value); +ZEND_API void zend_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value); +ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value); +ZEND_API void execute_ex(zend_execute_data *execute_data); +ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value); +ZEND_API bool zend_is_valid_class_name(zend_string *name); +ZEND_API zend_class_entry *zend_lookup_class(zend_string *name); +ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *lcname, uint32_t flags); +ZEND_API zend_class_entry *zend_get_called_scope(zend_execute_data *ex); +ZEND_API zend_object *zend_get_this_object(zend_execute_data *ex); +ZEND_API zend_result zend_eval_string(const char *str, zval *retval_ptr, const char *string_name); +ZEND_API zend_result zend_eval_stringl(const char *str, size_t str_len, zval *retval_ptr, const char *string_name); +ZEND_API zend_result zend_eval_string_ex(const char *str, zval *retval_ptr, const char *string_name, bool handle_exceptions); +ZEND_API zend_result zend_eval_stringl_ex(const char *str, size_t str_len, zval *retval_ptr, const char *string_name, bool handle_exceptions); + +/* export zend_pass_function to allow comparisons against it */ +extern ZEND_API const zend_internal_function zend_pass_function; + +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_false_to_array_deprecated(void); +ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_use_resource_as_offset(const zval *dim); + +ZEND_API bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, bool strict); + +typedef enum { + ZEND_VERIFY_PROP_ASSIGNABLE_BY_REF_CONTEXT_ASSIGNMENT, + ZEND_VERIFY_PROP_ASSIGNABLE_BY_REF_CONTEXT_MAGIC_GET, +} zend_verify_prop_assignable_by_ref_context; +ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref_ex(const zend_property_info *prop_info, zval *orig_val, bool strict, zend_verify_prop_assignable_by_ref_context context); +ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(const zend_property_info *prop_info, zval *orig_val, bool strict); + +ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv); +ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv); +ZEND_API ZEND_COLD zval* ZEND_FASTCALL zend_undefined_offset_write(HashTable *ht, zend_long lval); +ZEND_API ZEND_COLD zval* ZEND_FASTCALL zend_undefined_index_write(HashTable *ht, zend_string *offset); +ZEND_API ZEND_COLD void zend_wrong_string_offset_error(void); + +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(const zend_property_info *info); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info); + +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(uint8_t type); + +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info); + +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_add_element(void); + +ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg); +ZEND_API ZEND_COLD void zend_verify_arg_error( + const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, zval *value); +ZEND_API ZEND_COLD void zend_verify_return_error( + const zend_function *zf, zval *value); +ZEND_API ZEND_COLD void zend_verify_never_error( + const zend_function *zf); +ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref); +ZEND_API bool zend_check_user_type_slow( + zend_type *type, zval *arg, zend_reference *ref, void **cache_slot, bool is_return_type); + +#if ZEND_DEBUG +ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call); +ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc); +ZEND_API bool zend_verify_internal_return_type(zend_function *zf, zval *ret); +#endif + +#define ZEND_REF_TYPE_SOURCES(ref) \ + (ref)->sources + +#define ZEND_REF_HAS_TYPE_SOURCES(ref) \ + (ZEND_REF_TYPE_SOURCES(ref).ptr != NULL) + +#define ZEND_REF_FIRST_SOURCE(ref) \ + (ZEND_PROPERTY_INFO_SOURCE_IS_LIST((ref)->sources.list) \ + ? ZEND_PROPERTY_INFO_SOURCE_TO_LIST((ref)->sources.list)->ptr[0] \ + : (ref)->sources.ptr) + + +ZEND_API void ZEND_FASTCALL zend_ref_add_type_source(zend_property_info_source_list *source_list, zend_property_info *prop); +ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_list *source_list, const zend_property_info *prop); + +ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, uint8_t value_type, bool strict); +ZEND_API zval* zend_assign_to_typed_ref_ex(zval *variable_ptr, zval *value, uint8_t value_type, bool strict, zend_refcounted **garbage_ptr); + +static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *value, uint8_t value_type) +{ + zend_refcounted *ref = NULL; + + if (ZEND_CONST_COND(value_type & (IS_VAR|IS_CV), 1) && Z_ISREF_P(value)) { + ref = Z_COUNTED_P(value); + value = Z_REFVAL_P(value); + } + + ZVAL_COPY_VALUE(variable_ptr, value); + if (ZEND_CONST_COND(value_type == IS_CONST, 0)) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) { + Z_ADDREF_P(variable_ptr); + } + } else if (value_type & (IS_CONST|IS_CV)) { + if (Z_OPT_REFCOUNTED_P(variable_ptr)) { + Z_ADDREF_P(variable_ptr); + } + } else if (ZEND_CONST_COND(value_type == IS_VAR, 1) && UNEXPECTED(ref)) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(variable_ptr)) { + Z_ADDREF_P(variable_ptr); + } + } +} + +static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, uint8_t value_type, bool strict) +{ + do { + if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) { + zend_refcounted *garbage; + + if (Z_ISREF_P(variable_ptr)) { + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(variable_ptr)))) { + return zend_assign_to_typed_ref(variable_ptr, value, value_type, strict); + } + + variable_ptr = Z_REFVAL_P(variable_ptr); + if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) { + break; + } + } + garbage = Z_COUNTED_P(variable_ptr); + zend_copy_to_variable(variable_ptr, value, value_type); + GC_DTOR_NO_REF(garbage); + return variable_ptr; + } + } while (0); + + zend_copy_to_variable(variable_ptr, value, value_type); + return variable_ptr; +} + +static zend_always_inline zval* zend_assign_to_variable_ex(zval *variable_ptr, zval *value, zend_uchar value_type, bool strict, zend_refcounted **garbage_ptr) +{ + do { + if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) { + if (Z_ISREF_P(variable_ptr)) { + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(variable_ptr)))) { + return zend_assign_to_typed_ref_ex(variable_ptr, value, value_type, strict, garbage_ptr); + } + + variable_ptr = Z_REFVAL_P(variable_ptr); + if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) { + break; + } + } + *garbage_ptr = Z_COUNTED_P(variable_ptr); + } + } while (0); + + zend_copy_to_variable(variable_ptr, value, value_type); + return variable_ptr; +} + +ZEND_API zend_result ZEND_FASTCALL zval_update_constant(zval *pp); +ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *pp, zend_class_entry *scope); +ZEND_API zend_result ZEND_FASTCALL zval_update_constant_with_ctx(zval *pp, zend_class_entry *scope, zend_ast_evaluate_ctx *ctx); + +/* dedicated Zend executor functions - do not use! */ +struct _zend_vm_stack { + zval *top; + zval *end; + zend_vm_stack prev; +}; + +/* Ensure the correct alignment before slots calculation */ +ZEND_STATIC_ASSERT(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval), + "zval must be aligned by ZEND_MM_ALIGNMENT"); +/* A number of call frame slots (zvals) reserved for _zend_vm_stack. */ +#define ZEND_VM_STACK_HEADER_SLOTS \ + ((sizeof(struct _zend_vm_stack) + sizeof(zval) - 1) / sizeof(zval)) + +#define ZEND_VM_STACK_ELEMENTS(stack) \ + (((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOTS) + +/* + * In general in RELEASE build ZEND_ASSERT() must be zero-cost, but for some + * reason, GCC generated worse code, performing CSE on assertion code and the + * following "slow path" and moving memory read operations from slow path into + * common header. This made a degradation for the fast path. + * The following "#if ZEND_DEBUG" eliminates it. + */ +#if ZEND_DEBUG +# define ZEND_ASSERT_VM_STACK(stack) ZEND_ASSERT(stack->top > (zval *) stack && stack->end > (zval *) stack && stack->top <= stack->end) +# define ZEND_ASSERT_VM_STACK_GLOBAL ZEND_ASSERT(EG(vm_stack_top) > (zval *) EG(vm_stack) && EG(vm_stack_end) > (zval *) EG(vm_stack) && EG(vm_stack_top) <= EG(vm_stack_end)) +#else +# define ZEND_ASSERT_VM_STACK(stack) +# define ZEND_ASSERT_VM_STACK_GLOBAL +#endif + +ZEND_API void zend_vm_stack_init(void); +ZEND_API void zend_vm_stack_init_ex(size_t page_size); +ZEND_API void zend_vm_stack_destroy(void); +ZEND_API void* zend_vm_stack_extend(size_t size); + +static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) { + zend_vm_stack page = (zend_vm_stack)emalloc(size); + + page->top = ZEND_VM_STACK_ELEMENTS(page); + page->end = (zval*)((char*)page + size); + page->prev = prev; + return page; +} + +static zend_always_inline void zend_vm_init_call_frame(zend_execute_data *call, uint32_t call_info, zend_function *func, uint32_t num_args, void *object_or_called_scope) +{ + ZEND_ASSERT(!func->common.scope || object_or_called_scope); + call->func = func; + Z_PTR(call->This) = object_or_called_scope; + ZEND_CALL_INFO(call) = call_info; + ZEND_CALL_NUM_ARGS(call) = num_args; +} + +static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame_ex(uint32_t used_stack, uint32_t call_info, zend_function *func, uint32_t num_args, void *object_or_called_scope) +{ + zend_execute_data *call = (zend_execute_data*)EG(vm_stack_top); + + ZEND_ASSERT_VM_STACK_GLOBAL; + + if (UNEXPECTED(used_stack > (size_t)(((char*)EG(vm_stack_end)) - (char*)call))) { + call = (zend_execute_data*)zend_vm_stack_extend(used_stack); + ZEND_ASSERT_VM_STACK_GLOBAL; + zend_vm_init_call_frame(call, call_info | ZEND_CALL_ALLOCATED, func, num_args, object_or_called_scope); + return call; + } else { + EG(vm_stack_top) = (zval*)((char*)call + used_stack); + zend_vm_init_call_frame(call, call_info, func, num_args, object_or_called_scope); + return call; + } +} + +static zend_always_inline uint32_t zend_vm_calc_used_stack(uint32_t num_args, zend_function *func) +{ + uint32_t used_stack = ZEND_CALL_FRAME_SLOT + num_args + func->common.T; + + if (EXPECTED(ZEND_USER_CODE(func->type))) { + used_stack += func->op_array.last_var - MIN(func->op_array.num_args, num_args); + } + return used_stack * sizeof(zval); +} + +static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint32_t call_info, zend_function *func, uint32_t num_args, void *object_or_called_scope) +{ + uint32_t used_stack = zend_vm_calc_used_stack(num_args, func); + + return zend_vm_stack_push_call_frame_ex(used_stack, call_info, + func, num_args, object_or_called_scope); +} + +static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_info, zend_execute_data *call) +{ + if (UNEXPECTED(call_info & ZEND_CALL_FREE_EXTRA_ARGS)) { + uint32_t count = ZEND_CALL_NUM_ARGS(call) - call->func->op_array.num_args; + zval *p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T); + do { + i_zval_ptr_dtor(p); + p++; + } while (--count); + } +} + +static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *call) +{ + zend_vm_stack_free_extra_args_ex(ZEND_CALL_INFO(call), call); +} + +static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call) +{ + uint32_t num_args = ZEND_CALL_NUM_ARGS(call); + + if (EXPECTED(num_args > 0)) { + zval *p = ZEND_CALL_ARG(call, 1); + + do { + zval_ptr_dtor_nogc(p); + p++; + } while (--num_args); + } +} + +static zend_always_inline void zend_vm_stack_free_call_frame_ex(uint32_t call_info, zend_execute_data *call) +{ + ZEND_ASSERT_VM_STACK_GLOBAL; + + if (UNEXPECTED(call_info & ZEND_CALL_ALLOCATED)) { + zend_vm_stack p = EG(vm_stack); + zend_vm_stack prev = p->prev; + + ZEND_ASSERT(call == (zend_execute_data*)ZEND_VM_STACK_ELEMENTS(EG(vm_stack))); + EG(vm_stack_top) = prev->top; + EG(vm_stack_end) = prev->end; + EG(vm_stack) = prev; + efree(p); + } else { + EG(vm_stack_top) = (zval*)call; + } + + ZEND_ASSERT_VM_STACK_GLOBAL; +} + +static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *call) +{ + zend_vm_stack_free_call_frame_ex(ZEND_CALL_INFO(call), call); +} + +zend_execute_data *zend_vm_stack_copy_call_frame( + zend_execute_data *call, uint32_t passed_args, uint32_t additional_args); + +static zend_always_inline void zend_vm_stack_extend_call_frame( + zend_execute_data **call, uint32_t passed_args, uint32_t additional_args) +{ + if (EXPECTED((uint32_t)(EG(vm_stack_end) - EG(vm_stack_top)) > additional_args)) { + EG(vm_stack_top) += additional_args; + } else { + *call = zend_vm_stack_copy_call_frame(*call, passed_args, additional_args); + } +} + +ZEND_API void ZEND_FASTCALL zend_free_extra_named_params(zend_array *extra_named_params); + +/* services */ +ZEND_API const char *get_active_class_name(const char **space); +ZEND_API const char *get_active_function_name(void); +ZEND_API const char *get_active_function_arg_name(uint32_t arg_num); +ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num); +ZEND_API zend_string *get_active_function_or_method_name(void); +ZEND_API zend_string *get_function_or_method_name(const zend_function *func); +ZEND_API const char *zend_get_executed_filename(void); +ZEND_API zend_string *zend_get_executed_filename_ex(void); +ZEND_API uint32_t zend_get_executed_lineno(void); +ZEND_API zend_class_entry *zend_get_executed_scope(void); +ZEND_API bool zend_is_executing(void); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num); + +ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals); +ZEND_API void zend_unset_timeout(void); +ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void); +ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, uint32_t fetch_type); +ZEND_API zend_class_entry *zend_fetch_class_with_scope(zend_string *class_name, uint32_t fetch_type, zend_class_entry *scope); +ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string *lcname, uint32_t fetch_type); + +ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name); +ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len); +ZEND_API void ZEND_FASTCALL zend_init_func_run_time_cache(zend_op_array *op_array); + +ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type); + +ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var); + +ZEND_API bool zend_gcc_global_regs(void); + +#define ZEND_USER_OPCODE_CONTINUE 0 /* execute next opcode */ +#define ZEND_USER_OPCODE_RETURN 1 /* exit from executor (return from function) */ +#define ZEND_USER_OPCODE_DISPATCH 2 /* call original opcode handler */ +#define ZEND_USER_OPCODE_ENTER 3 /* enter into new op_array without recursion */ +#define ZEND_USER_OPCODE_LEAVE 4 /* return to calling op_array within the same executor */ + +#define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of returned opcode */ + +ZEND_API zend_result zend_set_user_opcode_handler(uint8_t opcode, user_opcode_handler_t handler); +ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(uint8_t opcode); + +ZEND_API zval *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data); + +ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table); +ZEND_API void ZEND_FASTCALL zend_free_compiled_variables(zend_execute_data *execute_data); +ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_execute_data *call, uint32_t op_num, zend_get_gc_buffer *buf); +ZEND_API void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num); +ZEND_API ZEND_ATTRIBUTE_DEPRECATED HashTable *zend_unfinished_execution_gc(zend_execute_data *execute_data, zend_execute_data *call, zend_get_gc_buffer *gc_buffer); +ZEND_API HashTable *zend_unfinished_execution_gc_ex(zend_execute_data *execute_data, zend_execute_data *call, zend_get_gc_buffer *gc_buffer, bool suspended_by_yield); + +zval * ZEND_FASTCALL zend_handle_named_arg( + zend_execute_data **call_ptr, zend_string *arg_name, + uint32_t *arg_num_ptr, void **cache_slot); +ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *call); + +#define CACHE_ADDR(num) \ + ((void**)((char*)EX(run_time_cache) + (num))) + +#define CACHED_PTR(num) \ + ((void**)((char*)EX(run_time_cache) + (num)))[0] + +#define CACHE_PTR(num, ptr) do { \ + ((void**)((char*)EX(run_time_cache) + (num)))[0] = (ptr); \ + } while (0) + +#define CACHED_POLYMORPHIC_PTR(num, ce) \ + (EXPECTED(((void**)((char*)EX(run_time_cache) + (num)))[0] == (void*)(ce)) ? \ + ((void**)((char*)EX(run_time_cache) + (num)))[1] : \ + NULL) + +#define CACHE_POLYMORPHIC_PTR(num, ce, ptr) do { \ + void **slot = (void**)((char*)EX(run_time_cache) + (num)); \ + slot[0] = (ce); \ + slot[1] = (ptr); \ + } while (0) + +#define CACHED_PTR_EX(slot) \ + (slot)[0] + +#define CACHE_PTR_EX(slot, ptr) do { \ + (slot)[0] = (ptr); \ + } while (0) + +#define CACHED_POLYMORPHIC_PTR_EX(slot, ce) \ + (EXPECTED((slot)[0] == (ce)) ? (slot)[1] : NULL) + +#define CACHE_POLYMORPHIC_PTR_EX(slot, ce, ptr) do { \ + (slot)[0] = (ce); \ + (slot)[1] = (ptr); \ + } while (0) + +#define CACHE_SPECIAL (1<<0) + +#define IS_SPECIAL_CACHE_VAL(ptr) \ + (((uintptr_t)(ptr)) & CACHE_SPECIAL) + +#define ENCODE_SPECIAL_CACHE_NUM(num) \ + ((void*)((((uintptr_t)(num)) << 1) | CACHE_SPECIAL)) + +#define DECODE_SPECIAL_CACHE_NUM(ptr) \ + (((uintptr_t)(ptr)) >> 1) + +#define ENCODE_SPECIAL_CACHE_PTR(ptr) \ + ((void*)(((uintptr_t)(ptr)) | CACHE_SPECIAL)) + +#define DECODE_SPECIAL_CACHE_PTR(ptr) \ + ((void*)(((uintptr_t)(ptr)) & ~CACHE_SPECIAL)) + +#define SKIP_EXT_OPLINE(opline) do { \ + while (UNEXPECTED((opline)->opcode >= ZEND_EXT_STMT \ + && (opline)->opcode <= ZEND_TICKS)) { \ + (opline)--; \ + } \ + } while (0) + +#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) == ZEND_ACC_HAS_TYPE_HINTS) +#define ZEND_CLASS_HAS_READONLY_PROPS(ce) ((ce->ce_flags & ZEND_ACC_HAS_READONLY_PROPS) == ZEND_ACC_HAS_READONLY_PROPS) + + +ZEND_API bool zend_verify_class_constant_type(zend_class_constant *c, const zend_string *name, zval *constant); +ZEND_COLD void zend_verify_class_constant_type_error(const zend_class_constant *c, const zend_string *name, const zval *constant); + +ZEND_API bool zend_verify_property_type(const zend_property_info *info, zval *property, bool strict); +ZEND_COLD void zend_verify_property_type_error(const zend_property_info *info, const zval *property); +ZEND_COLD void zend_magic_get_property_type_inconsistency_error(const zend_property_info *info, const zval *property); + +#define ZEND_REF_ADD_TYPE_SOURCE(ref, source) \ + zend_ref_add_type_source(&ZEND_REF_TYPE_SOURCES(ref), source) + +#define ZEND_REF_DEL_TYPE_SOURCE(ref, source) \ + zend_ref_del_type_source(&ZEND_REF_TYPE_SOURCES(ref), source) + +#define ZEND_REF_FOREACH_TYPE_SOURCES(ref, prop) do { \ + zend_property_info_source_list *_source_list = &ZEND_REF_TYPE_SOURCES(ref); \ + zend_property_info **_prop, **_end; \ + zend_property_info_list *_list; \ + if (_source_list->ptr) { \ + if (ZEND_PROPERTY_INFO_SOURCE_IS_LIST(_source_list->list)) { \ + _list = ZEND_PROPERTY_INFO_SOURCE_TO_LIST(_source_list->list); \ + _prop = _list->ptr; \ + _end = _list->ptr + _list->num; \ + } else { \ + _prop = &_source_list->ptr; \ + _end = _prop + 1; \ + } \ + for (; _prop < _end; _prop++) { \ + prop = *_prop; \ + +#define ZEND_REF_FOREACH_TYPE_SOURCES_END() \ + } \ + } \ + } while (0) + +ZEND_COLD void zend_match_unhandled_error(const zval *value); + +static zend_always_inline void *zend_get_bad_ptr(void) +{ + ZEND_UNREACHABLE(); + return NULL; +} + +END_EXTERN_C() + +#endif /* ZEND_EXECUTE_H */ diff --git a/include/php/Zend/zend_extensions.h b/include/php/Zend/zend_extensions.h new file mode 100644 index 0000000..461358a --- /dev/null +++ b/include/php/Zend/zend_extensions.h @@ -0,0 +1,160 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_EXTENSIONS_H +#define ZEND_EXTENSIONS_H + +#include "zend_compile.h" +#include "zend_build.h" + +/* +The constants below are derived from ext/opcache/ZendAccelerator.h + +You can use the following macro to check the extension API version for compatibilities: + +#define ZEND_EXTENSION_API_NO_5_0_X 220040412 +#define ZEND_EXTENSION_API_NO_5_1_X 220051025 +#define ZEND_EXTENSION_API_NO_5_2_X 220060519 +#define ZEND_EXTENSION_API_NO_5_3_X 220090626 +#define ZEND_EXTENSION_API_NO_5_4_X 220100525 +#define ZEND_EXTENSION_API_NO_5_5_X 220121212 +#define ZEND_EXTENSION_API_NO_5_6_X 220131226 +#define ZEND_EXTENSION_API_NO_7_0_X 320151012 + +#if ZEND_EXTENSION_API_NO < ZEND_EXTENSION_API_NO_5_5_X + // do something for php versions lower than 5.5.x +#endif +*/ + +/* The first number is the engine version and the rest is the date (YYYYMMDD). + * This way engine 2/3 API no. is always greater than engine 1 API no.. */ +#define ZEND_EXTENSION_API_NO 420230831 + +typedef struct _zend_extension_version_info { + int zend_extension_api_no; + const char *build_id; +} zend_extension_version_info; + +#define ZEND_EXTENSION_BUILD_ID "API" ZEND_TOSTR(ZEND_EXTENSION_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA + +typedef struct _zend_extension zend_extension; + +/* Typedef's for zend_extension function pointers */ +typedef int (*startup_func_t)(zend_extension *extension); +typedef void (*shutdown_func_t)(zend_extension *extension); +typedef void (*activate_func_t)(void); +typedef void (*deactivate_func_t)(void); + +typedef void (*message_handler_func_t)(int message, void *arg); + +typedef void (*op_array_handler_func_t)(zend_op_array *op_array); + +typedef void (*statement_handler_func_t)(zend_execute_data *frame); +typedef void (*fcall_begin_handler_func_t)(zend_execute_data *frame); +typedef void (*fcall_end_handler_func_t)(zend_execute_data *frame); + +typedef void (*op_array_ctor_func_t)(zend_op_array *op_array); +typedef void (*op_array_dtor_func_t)(zend_op_array *op_array); +typedef size_t (*op_array_persist_calc_func_t)(zend_op_array *op_array); +typedef size_t (*op_array_persist_func_t)(zend_op_array *op_array, void *mem); + +struct _zend_extension { + const char *name; + const char *version; + const char *author; + const char *URL; + const char *copyright; + + startup_func_t startup; + shutdown_func_t shutdown; + activate_func_t activate; + deactivate_func_t deactivate; + + message_handler_func_t message_handler; + + op_array_handler_func_t op_array_handler; + + statement_handler_func_t statement_handler; + fcall_begin_handler_func_t fcall_begin_handler; + fcall_end_handler_func_t fcall_end_handler; + + op_array_ctor_func_t op_array_ctor; + op_array_dtor_func_t op_array_dtor; + + int (*api_no_check)(int api_no); + int (*build_id_check)(const char* build_id); + op_array_persist_calc_func_t op_array_persist_calc; + op_array_persist_func_t op_array_persist; + void *reserved5; + void *reserved6; + void *reserved7; + void *reserved8; + + DL_HANDLE handle; + int resource_number; +}; + +BEGIN_EXTERN_C() +extern ZEND_API int zend_op_array_extension_handles; + +ZEND_API int zend_get_resource_handle(const char *module_name); +ZEND_API int zend_get_op_array_extension_handle(const char *module_name); +ZEND_API int zend_get_op_array_extension_handles(const char *module_name, int handles); +ZEND_API void zend_extension_dispatch_message(int message, void *arg); +END_EXTERN_C() + +#define ZEND_EXTMSG_NEW_EXTENSION 1 + + +#define ZEND_EXTENSION() \ + ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, ZEND_EXTENSION_BUILD_ID } + +#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1 +#define COMPAT_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1 +#define BUILD_COMPAT_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1 + + +ZEND_API extern zend_llist zend_extensions; +ZEND_API extern uint32_t zend_extension_flags; + +#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_CTOR (1<<0) +#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_DTOR (1<<1) +#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_HANDLER (1<<2) +#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_PERSIST_CALC (1<<3) +#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_PERSIST (1<<4) + +void zend_extension_dtor(zend_extension *extension); +ZEND_API void zend_append_version_info(const zend_extension *extension); +void zend_startup_extensions_mechanism(void); +void zend_startup_extensions(void); +void zend_shutdown_extensions(void); + +ZEND_API size_t zend_internal_run_time_cache_reserved_size(void); +ZEND_API void zend_init_internal_run_time_cache(void); + +BEGIN_EXTERN_C() +ZEND_API zend_result zend_load_extension(const char *path); +ZEND_API zend_result zend_load_extension_handle(DL_HANDLE handle, const char *path); +ZEND_API void zend_register_extension(zend_extension *new_extension, DL_HANDLE handle); +ZEND_API zend_extension *zend_get_extension(const char *extension_name); +ZEND_API size_t zend_extensions_op_array_persist_calc(zend_op_array *op_array); +ZEND_API size_t zend_extensions_op_array_persist(zend_op_array *op_array, void *mem); +END_EXTERN_C() + +#endif /* ZEND_EXTENSIONS_H */ diff --git a/include/php/Zend/zend_fibers.h b/include/php/Zend/zend_fibers.h new file mode 100644 index 0000000..5c81f44 --- /dev/null +++ b/include/php/Zend/zend_fibers.h @@ -0,0 +1,162 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Aaron Piotrowski | + | Martin Schröder | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_FIBERS_H +#define ZEND_FIBERS_H + +#include "zend_API.h" +#include "zend_types.h" + +#define ZEND_FIBER_GUARD_PAGES 1 + +#define ZEND_FIBER_DEFAULT_C_STACK_SIZE (4096 * (((sizeof(void *)) < 8) ? 256 : 512)) +#define ZEND_FIBER_VM_STACK_SIZE (1024 * sizeof(zval)) + +BEGIN_EXTERN_C() + +typedef enum { + ZEND_FIBER_STATUS_INIT, + ZEND_FIBER_STATUS_RUNNING, + ZEND_FIBER_STATUS_SUSPENDED, + ZEND_FIBER_STATUS_DEAD, +} zend_fiber_status; + +typedef enum { + ZEND_FIBER_FLAG_THREW = 1 << 0, + ZEND_FIBER_FLAG_BAILOUT = 1 << 1, + ZEND_FIBER_FLAG_DESTROYED = 1 << 2, +} zend_fiber_flag; + +typedef enum { + ZEND_FIBER_TRANSFER_FLAG_ERROR = 1 << 0, + ZEND_FIBER_TRANSFER_FLAG_BAILOUT = 1 << 1 +} zend_fiber_transfer_flag; + +void zend_register_fiber_ce(void); +void zend_fiber_init(void); +void zend_fiber_shutdown(void); + +extern ZEND_API zend_class_entry *zend_ce_fiber; + +typedef struct _zend_fiber_stack zend_fiber_stack; + +/* Encapsulates data needed for a context switch. */ +typedef struct _zend_fiber_transfer { + /* Fiber that will be switched to / has resumed us. */ + zend_fiber_context *context; + + /* Value to that should be send to (or was received from) a fiber. */ + zval value; + + /* Bitmask of flags defined in enum zend_fiber_transfer_flag. */ + uint8_t flags; +} zend_fiber_transfer; + +/* Coroutine functions must populate the given transfer with a new context + * and (optional) data before they return. */ +typedef void (*zend_fiber_coroutine)(zend_fiber_transfer *transfer); +typedef void (*zend_fiber_clean)(zend_fiber_context *context); + +struct _zend_fiber_context { + /* Pointer to boost.context or ucontext_t data. */ + void *handle; + + /* Pointer that identifies the fiber type. */ + void *kind; + + /* Entrypoint function of the fiber. */ + zend_fiber_coroutine function; + + /* Cleanup function for fiber. */ + zend_fiber_clean cleanup; + + /* Assigned C stack. */ + zend_fiber_stack *stack; + + /* Fiber status. */ + zend_fiber_status status; + + /* Observer state */ + zend_execute_data *top_observed_frame; + + /* Reserved for extensions */ + void *reserved[ZEND_MAX_RESERVED_RESOURCES]; +}; + +struct _zend_fiber { + /* PHP object handle. */ + zend_object std; + + /* Flags are defined in enum zend_fiber_flag. */ + uint8_t flags; + + /* Native C fiber context. */ + zend_fiber_context context; + + /* Fiber that resumed us. */ + zend_fiber_context *caller; + + /* Fiber that suspended us. */ + zend_fiber_context *previous; + + /* Callback and info / cache to be used when fiber is started. */ + zend_fcall_info fci; + zend_fcall_info_cache fci_cache; + + /* Current Zend VM execute data being run by the fiber. */ + zend_execute_data *execute_data; + + /* Frame on the bottom of the fiber vm stack. */ + zend_execute_data *stack_bottom; + + /* Active fiber vm stack. */ + zend_vm_stack vm_stack; + + /* Storage for fiber return value. */ + zval result; +}; + +/* These functions may be used to create custom fiber objects using the bundled fiber switching context. */ +ZEND_API zend_result zend_fiber_init_context(zend_fiber_context *context, void *kind, zend_fiber_coroutine coroutine, size_t stack_size); +ZEND_API void zend_fiber_destroy_context(zend_fiber_context *context); +ZEND_API void zend_fiber_switch_context(zend_fiber_transfer *transfer); +#ifdef ZEND_CHECK_STACK_LIMIT +ZEND_API void* zend_fiber_stack_limit(zend_fiber_stack *stack); +ZEND_API void* zend_fiber_stack_base(zend_fiber_stack *stack); +#endif /* ZEND_CHECK_STACK_LIMIT */ + +ZEND_API void zend_fiber_switch_block(void); +ZEND_API void zend_fiber_switch_unblock(void); +ZEND_API bool zend_fiber_switch_blocked(void); + +END_EXTERN_C() + +static zend_always_inline zend_fiber *zend_fiber_from_context(zend_fiber_context *context) +{ + ZEND_ASSERT(context->kind == zend_ce_fiber && "Fiber context does not belong to a Zend fiber"); + + return (zend_fiber *)(((char *) context) - XtOffsetOf(zend_fiber, context)); +} + +static zend_always_inline zend_fiber_context *zend_fiber_get_context(zend_fiber *fiber) +{ + return &fiber->context; +} + +#endif diff --git a/include/php/Zend/zend_fibers_arginfo.h b/include/php/Zend/zend_fibers_arginfo.h new file mode 100644 index 0000000..3d12b20 --- /dev/null +++ b/include/php/Zend/zend_fibers_arginfo.h @@ -0,0 +1,96 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: e82bbc8e81fe98873a9a5697a4b38e63a24379da */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Fiber___construct, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Fiber_start, 0, 0, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Fiber_resume, 0, 0, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_MIXED, 0, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Fiber_throw, 0, 1, IS_MIXED, 0) + ZEND_ARG_OBJ_INFO(0, exception, Throwable, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Fiber_isStarted, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Fiber_isSuspended arginfo_class_Fiber_isStarted + +#define arginfo_class_Fiber_isRunning arginfo_class_Fiber_isStarted + +#define arginfo_class_Fiber_isTerminated arginfo_class_Fiber_isStarted + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Fiber_getReturn, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Fiber_getCurrent, 0, 0, Fiber, 1) +ZEND_END_ARG_INFO() + +#define arginfo_class_Fiber_suspend arginfo_class_Fiber_resume + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_FiberError___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + + +ZEND_METHOD(Fiber, __construct); +ZEND_METHOD(Fiber, start); +ZEND_METHOD(Fiber, resume); +ZEND_METHOD(Fiber, throw); +ZEND_METHOD(Fiber, isStarted); +ZEND_METHOD(Fiber, isSuspended); +ZEND_METHOD(Fiber, isRunning); +ZEND_METHOD(Fiber, isTerminated); +ZEND_METHOD(Fiber, getReturn); +ZEND_METHOD(Fiber, getCurrent); +ZEND_METHOD(Fiber, suspend); +ZEND_METHOD(FiberError, __construct); + + +static const zend_function_entry class_Fiber_methods[] = { + ZEND_ME(Fiber, __construct, arginfo_class_Fiber___construct, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, start, arginfo_class_Fiber_start, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, resume, arginfo_class_Fiber_resume, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, throw, arginfo_class_Fiber_throw, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, isStarted, arginfo_class_Fiber_isStarted, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, isSuspended, arginfo_class_Fiber_isSuspended, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, isRunning, arginfo_class_Fiber_isRunning, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, isTerminated, arginfo_class_Fiber_isTerminated, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, getReturn, arginfo_class_Fiber_getReturn, ZEND_ACC_PUBLIC) + ZEND_ME(Fiber, getCurrent, arginfo_class_Fiber_getCurrent, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Fiber, suspend, arginfo_class_Fiber_suspend, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_FiberError_methods[] = { + ZEND_ME(FiberError, __construct, arginfo_class_FiberError___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static zend_class_entry *register_class_Fiber(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Fiber", class_Fiber_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; + + return class_entry; +} + +static zend_class_entry *register_class_FiberError(zend_class_entry *class_entry_Error) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "FiberError", class_FiberError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Error); + class_entry->ce_flags |= ZEND_ACC_FINAL; + + return class_entry; +} diff --git a/include/php/Zend/zend_float.h b/include/php/Zend/zend_float.h new file mode 100644 index 0000000..c8e9112 --- /dev/null +++ b/include/php/Zend/zend_float.h @@ -0,0 +1,415 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Christian Seiler | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_FLOAT_H +#define ZEND_FLOAT_H + +BEGIN_EXTERN_C() + +/* + Define functions for FP initialization and de-initialization. +*/ +extern ZEND_API void zend_init_fpu(void); +extern ZEND_API void zend_shutdown_fpu(void); +extern ZEND_API void zend_ensure_fpu_mode(void); + +END_EXTERN_C() + +/* Copy of the contents of xpfpa.h (which is under public domain) + See http://wiki.php.net/rfc/rounding for details. + + Cross Platform Floating Point Arithmetics + + This header file defines several platform-dependent macros that ensure + equal and deterministic floating point behaviour across several platforms, + compilers and architectures. + + The current macros are currently only used on x86 and x86_64 architectures, + on every other architecture, these macros expand to NOPs. This assumes that + other architectures do not have an internal precision and the operhand types + define the computational precision of floating point operations. This + assumption may be false, in that case, the author is interested in further + details on the other platform. + + For further details, please visit: + http://www.christian-seiler.de/projekte/fpmath/ + + Version: 20090317 */ + +/* + Implementation notes: + + x86_64: + - Since all x86_64 compilers use SSE by default, we do not define these + macros there. We ignore the compiler option -mfpmath=i387, because there is + no reason to use it on x86_64. + + General: + - It would be nice if one could detect whether SSE if used for math via some + funky compiler defines and if so, make the macros go to NOPs. Any ideas + on how to do that? + + MS Visual C: + - Since MSVC users typically don't use autoconf or CMake, we will detect + MSVC via compile time define. +*/ + +/* MSVC detection (MSVC people usually don't use autoconf) */ +#if defined(_MSC_VER) && !defined(_WIN64) +# define HAVE__CONTROLFP_S +#endif /* _MSC_VER */ + +#if defined(HAVE__CONTROLFP_S) && !defined(__x86_64__) + +/* float.h defines _controlfp_s */ +# include + +# define XPFPA_HAVE_CW 1 +# define XPFPA_CW_DATATYPE \ + unsigned int + +# define XPFPA_STORE_CW(vptr) do { \ + _controlfp_s((unsigned int *)(vptr), 0, 0); \ + } while (0) + +# define XPFPA_RESTORE_CW(vptr) do { \ + unsigned int _xpfpa_fpu_cw; \ + _controlfp_s(&_xpfpa_fpu_cw, *((unsigned int *)(vptr)), _MCW_PC); \ + } while (0) + +# define XPFPA_DECLARE \ + unsigned int _xpfpa_fpu_oldcw, _xpfpa_fpu_cw; + +# define XPFPA_SWITCH_DOUBLE() do { \ + _controlfp_s(&_xpfpa_fpu_cw, 0, 0); \ + _xpfpa_fpu_oldcw = _xpfpa_fpu_cw; \ + _controlfp_s(&_xpfpa_fpu_cw, _PC_53, _MCW_PC); \ + } while (0) +# define XPFPA_SWITCH_SINGLE() do { \ + _controlfp_s(&_xpfpa_fpu_cw, 0, 0); \ + _xpfpa_fpu_oldcw = _xpfpa_fpu_cw; \ + _controlfp_s(&_xpfpa_fpu_cw, _PC_24, _MCW_PC); \ + } while (0) +/* NOTE: This only sets internal precision. MSVC does NOT support double- + extended precision! */ +# define XPFPA_SWITCH_DOUBLE_EXTENDED() do { \ + _controlfp_s(&_xpfpa_fpu_cw, 0, 0); \ + _xpfpa_fpu_oldcw = _xpfpa_fpu_cw; \ + _controlfp_s(&_xpfpa_fpu_cw, _PC_64, _MCW_PC); \ + } while (0) +# define XPFPA_RESTORE() \ + _controlfp_s(&_xpfpa_fpu_cw, _xpfpa_fpu_oldcw, _MCW_PC) +/* We do NOT use the volatile return trick since _controlfp_s is a function + call and thus FP registers are saved in memory anyway. However, we do use + a variable to ensure that the expression passed into val will be evaluated + *before* switching back contexts. */ +# define XPFPA_RETURN_DOUBLE(val) \ + do { \ + double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +# define XPFPA_RETURN_SINGLE(val) \ + do { \ + float _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +/* This won't work, but we add a macro for it anyway. */ +# define XPFPA_RETURN_DOUBLE_EXTENDED(val) \ + do { \ + long double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) + +#elif defined(HAVE__CONTROLFP) && !defined(__x86_64__) + +/* float.h defines _controlfp */ +# include + +# define XPFPA_DECLARE \ + unsigned int _xpfpa_fpu_oldcw; + +# define XPFPA_HAVE_CW 1 +# define XPFPA_CW_DATATYPE \ + unsigned int + +# define XPFPA_STORE_CW(vptr) do { \ + *((unsigned int *)(vptr)) = _controlfp(0, 0); \ + } while (0) + +# define XPFPA_RESTORE_CW(vptr) do { \ + _controlfp(*((unsigned int *)(vptr)), _MCW_PC); \ + } while (0) + +# define XPFPA_SWITCH_DOUBLE() do { \ + _xpfpa_fpu_oldcw = _controlfp(0, 0); \ + _controlfp(_PC_53, _MCW_PC); \ + } while (0) +# define XPFPA_SWITCH_SINGLE() do { \ + _xpfpa_fpu_oldcw = _controlfp(0, 0); \ + _controlfp(_PC_24, _MCW_PC); \ + } while (0) +/* NOTE: This will only work as expected on MinGW. */ +# define XPFPA_SWITCH_DOUBLE_EXTENDED() do { \ + _xpfpa_fpu_oldcw = _controlfp(0, 0); \ + _controlfp(_PC_64, _MCW_PC); \ + } while (0) +# define XPFPA_RESTORE() \ + _controlfp(_xpfpa_fpu_oldcw, _MCW_PC) +/* We do NOT use the volatile return trick since _controlfp is a function + call and thus FP registers are saved in memory anyway. However, we do use + a variable to ensure that the expression passed into val will be evaluated + *before* switching back contexts. */ +# define XPFPA_RETURN_DOUBLE(val) \ + do { \ + double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +# define XPFPA_RETURN_SINGLE(val) \ + do { \ + float _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +/* This will only work on MinGW */ +# define XPFPA_RETURN_DOUBLE_EXTENDED(val) \ + do { \ + long double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) + +#elif defined(HAVE__FPU_SETCW) && !defined(__x86_64__) /* glibc systems */ + +/* fpu_control.h defines _FPU_[GS]ETCW */ +# include + +# define XPFPA_DECLARE \ + fpu_control_t _xpfpa_fpu_oldcw, _xpfpa_fpu_cw; + +# define XPFPA_HAVE_CW 1 +# define XPFPA_CW_DATATYPE \ + fpu_control_t + +# define XPFPA_STORE_CW(vptr) do { \ + _FPU_GETCW((*((fpu_control_t *)(vptr)))); \ + } while (0) + +# define XPFPA_RESTORE_CW(vptr) do { \ + _FPU_SETCW((*((fpu_control_t *)(vptr)))); \ + } while (0) + +# define XPFPA_SWITCH_DOUBLE() do { \ + _FPU_GETCW(_xpfpa_fpu_oldcw); \ + _xpfpa_fpu_cw = (_xpfpa_fpu_oldcw & ~_FPU_EXTENDED & ~_FPU_SINGLE) | _FPU_DOUBLE; \ + _FPU_SETCW(_xpfpa_fpu_cw); \ + } while (0) +# define XPFPA_SWITCH_SINGLE() do { \ + _FPU_GETCW(_xpfpa_fpu_oldcw); \ + _xpfpa_fpu_cw = (_xpfpa_fpu_oldcw & ~_FPU_EXTENDED & ~_FPU_DOUBLE) | _FPU_SINGLE; \ + _FPU_SETCW(_xpfpa_fpu_cw); \ + } while (0) +# define XPFPA_SWITCH_DOUBLE_EXTENDED() do { \ + _FPU_GETCW(_xpfpa_fpu_oldcw); \ + _xpfpa_fpu_cw = (_xpfpa_fpu_oldcw & ~_FPU_SINGLE & ~_FPU_DOUBLE) | _FPU_EXTENDED; \ + _FPU_SETCW(_xpfpa_fpu_cw); \ + } while (0) +# define XPFPA_RESTORE() \ + _FPU_SETCW(_xpfpa_fpu_oldcw) +/* We use a temporary volatile variable (in a new block) in order to ensure + that the optimizer does not mis-optimize the instructions. Also, a volatile + variable ensures truncation to correct precision. */ +# define XPFPA_RETURN_DOUBLE(val) \ + do { \ + volatile double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +# define XPFPA_RETURN_SINGLE(val) \ + do { \ + volatile float _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +# define XPFPA_RETURN_DOUBLE_EXTENDED(val) \ + do { \ + volatile long double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) + +#elif defined(HAVE_FPSETPREC) && !defined(__x86_64__) /* FreeBSD */ + +/* fpu_control.h defines _FPU_[GS]ETCW */ +# include + +# define XPFPA_DECLARE \ + fp_prec_t _xpfpa_fpu_oldprec; + +# define XPFPA_HAVE_CW 1 +# define XPFPA_CW_DATATYPE \ + fp_prec_t + +# define XPFPA_STORE_CW(vptr) do { \ + *((fp_prec_t *)(vptr)) = fpgetprec(); \ + } while (0) + +# define XPFPA_RESTORE_CW(vptr) do { \ + fpsetprec(*((fp_prec_t *)(vptr))); \ + } while (0) + +# define XPFPA_SWITCH_DOUBLE() do { \ + _xpfpa_fpu_oldprec = fpgetprec(); \ + fpsetprec(FP_PD); \ + } while (0) +# define XPFPA_SWITCH_SINGLE() do { \ + _xpfpa_fpu_oldprec = fpgetprec(); \ + fpsetprec(FP_PS); \ + } while (0) +# define XPFPA_SWITCH_DOUBLE_EXTENDED() do { \ + _xpfpa_fpu_oldprec = fpgetprec(); \ + fpsetprec(FP_PE); \ + } while (0) +# define XPFPA_RESTORE() \ + fpsetprec(_xpfpa_fpu_oldprec) +/* We use a temporary volatile variable (in a new block) in order to ensure + that the optimizer does not mis-optimize the instructions. Also, a volatile + variable ensures truncation to correct precision. */ +# define XPFPA_RETURN_DOUBLE(val) \ + do { \ + volatile double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +# define XPFPA_RETURN_SINGLE(val) \ + do { \ + volatile float _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +# define XPFPA_RETURN_DOUBLE_EXTENDED(val) \ + do { \ + volatile long double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) + +#elif defined(HAVE_FPU_INLINE_ASM_X86) && !defined(__x86_64__) + +/* + Custom x86 inline assembler implementation. + + This implementation does not use predefined wrappers of the OS / compiler + but rather uses x86/x87 inline assembler directly. Basic instructions: + + fnstcw - Store the FPU control word in a variable + fldcw - Load the FPU control word from a variable + + Bits (only bits 8 and 9 are relevant, bits 0 to 7 are for other things): + 0x0yy: Single precision + 0x1yy: Reserved + 0x2yy: Double precision + 0x3yy: Double-extended precision + + We use an unsigned int for the datatype. glibc sources add __mode__ (__HI__) + attribute to it (HI stands for half-integer according to docs). It is unclear + what the does exactly and how portable it is. + + The assembly syntax works with GNU CC, Intel CC and Sun CC. +*/ + +# define XPFPA_DECLARE \ + unsigned int _xpfpa_fpu_oldcw, _xpfpa_fpu_cw; + +# define XPFPA_HAVE_CW 1 +# define XPFPA_CW_DATATYPE \ + unsigned int + +# define XPFPA_STORE_CW(vptr) do { \ + __asm__ __volatile__ ("fnstcw %0" : "=m" (*((unsigned int *)(vptr)))); \ + } while (0) + +# define XPFPA_RESTORE_CW(vptr) do { \ + __asm__ __volatile__ ("fldcw %0" : : "m" (*((unsigned int *)(vptr)))); \ + } while (0) + +# define XPFPA_SWITCH_DOUBLE() do { \ + __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_xpfpa_fpu_oldcw)); \ + _xpfpa_fpu_cw = (_xpfpa_fpu_oldcw & ~0x100) | 0x200; \ + __asm__ __volatile__ ("fldcw %0" : : "m" (*&_xpfpa_fpu_cw)); \ + } while (0) +# define XPFPA_SWITCH_SINGLE() do { \ + __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_xpfpa_fpu_oldcw)); \ + _xpfpa_fpu_cw = (_xpfpa_fpu_oldcw & ~0x300); \ + __asm__ __volatile__ ("fldcw %0" : : "m" (*&_xpfpa_fpu_cw)); \ + } while (0) +# define XPFPA_SWITCH_DOUBLE_EXTENDED() do { \ + __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_xpfpa_fpu_oldcw)); \ + _xpfpa_fpu_cw = _xpfpa_fpu_oldcw | 0x300; \ + __asm__ __volatile__ ("fldcw %0" : : "m" (*&_xpfpa_fpu_cw)); \ + } while (0) +# define XPFPA_RESTORE() \ + __asm__ __volatile__ ("fldcw %0" : : "m" (*&_xpfpa_fpu_oldcw)) +/* We use a temporary volatile variable (in a new block) in order to ensure + that the optimizer does not mis-optimize the instructions. Also, a volatile + variable ensures truncation to correct precision. */ +# define XPFPA_RETURN_DOUBLE(val) \ + do { \ + volatile double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +# define XPFPA_RETURN_SINGLE(val) \ + do { \ + volatile float _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) +# define XPFPA_RETURN_DOUBLE_EXTENDED(val) \ + do { \ + volatile long double _xpfpa_result = (val); \ + XPFPA_RESTORE(); \ + return _xpfpa_result; \ + } while (0) + +#else /* FPU CONTROL */ + +/* + This is either not an x87 FPU or the inline assembly syntax was not + recognized. In any case, default to NOPs for the macros and hope the + generated code will behave as planned. +*/ +# define XPFPA_DECLARE /* NOP */ +# define XPFPA_HAVE_CW 0 +# define XPFPA_CW_DATATYPE unsigned int +# define XPFPA_STORE_CW(variable) /* NOP */ +# define XPFPA_RESTORE_CW(variable) /* NOP */ +# define XPFPA_SWITCH_DOUBLE() /* NOP */ +# define XPFPA_SWITCH_SINGLE() /* NOP */ +# define XPFPA_SWITCH_DOUBLE_EXTENDED() /* NOP */ +# define XPFPA_RESTORE() /* NOP */ +# define XPFPA_RETURN_DOUBLE(val) return (val) +# define XPFPA_RETURN_SINGLE(val) return (val) +# define XPFPA_RETURN_DOUBLE_EXTENDED(val) return (val) + +#endif /* FPU CONTROL */ + +#endif diff --git a/include/php/Zend/zend_gc.h b/include/php/Zend/zend_gc.h new file mode 100644 index 0000000..84519aa --- /dev/null +++ b/include/php/Zend/zend_gc.h @@ -0,0 +1,160 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: David Wang | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_GC_H +#define ZEND_GC_H + +#include "zend_hrtime.h" + +#ifndef GC_BENCH +# define GC_BENCH 0 +#endif + +BEGIN_EXTERN_C() + +typedef struct _zend_gc_status { + bool active; + bool gc_protected; + bool full; + uint32_t runs; + uint32_t collected; + uint32_t threshold; + uint32_t buf_size; + uint32_t num_roots; + zend_hrtime_t application_time; + zend_hrtime_t collector_time; + zend_hrtime_t dtor_time; + zend_hrtime_t free_time; +} zend_gc_status; + +ZEND_API extern int (*gc_collect_cycles)(void); + +ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref); +ZEND_API void ZEND_FASTCALL gc_remove_from_buffer(zend_refcounted *ref); + +/* enable/disable automatic start of GC collection */ +ZEND_API bool gc_enable(bool enable); +ZEND_API bool gc_enabled(void); + +/* enable/disable possible root additions */ +ZEND_API bool gc_protect(bool protect); +ZEND_API bool gc_protected(void); + +#if GC_BENCH +void gc_bench_print(void); +#endif + +/* The default implementation of the gc_collect_cycles callback. */ +ZEND_API int zend_gc_collect_cycles(void); + +ZEND_API void zend_gc_get_status(zend_gc_status *status); + +void gc_globals_ctor(void); +void gc_globals_dtor(void); +void gc_reset(void); + +#ifdef ZTS +size_t zend_gc_globals_size(void); +#endif + +#define GC_REMOVE_FROM_BUFFER(p) do { \ + zend_refcounted *_p = (zend_refcounted*)(p); \ + if (GC_TYPE_INFO(_p) & GC_INFO_MASK) { \ + gc_remove_from_buffer(_p); \ + } \ + } while (0) + +#define GC_MAY_LEAK(ref) \ + ((GC_TYPE_INFO(ref) & \ + (GC_INFO_MASK | (GC_NOT_COLLECTABLE << GC_FLAGS_SHIFT))) == 0) + +static zend_always_inline void gc_check_possible_root(zend_refcounted *ref) +{ + if (EXPECTED(GC_TYPE_INFO(ref) == GC_REFERENCE)) { + zval *zv = &((zend_reference*)ref)->val; + + if (!Z_COLLECTABLE_P(zv)) { + return; + } + ref = Z_COUNTED_P(zv); + } + if (UNEXPECTED(GC_MAY_LEAK(ref))) { + gc_possible_root(ref); + } +} + +static zend_always_inline void gc_check_possible_root_no_ref(zend_refcounted *ref) +{ + ZEND_ASSERT(GC_TYPE_INFO(ref) != GC_REFERENCE); + if (UNEXPECTED(GC_MAY_LEAK(ref))) { + gc_possible_root(ref); + } +} + +/* These APIs can be used to simplify object get_gc implementations + * over heterogeneous structures. See zend_generator_get_gc() for + * a usage example. */ + +typedef struct { + zval *cur; + zval *end; + zval *start; +} zend_get_gc_buffer; + +ZEND_API zend_get_gc_buffer *zend_get_gc_buffer_create(void); +ZEND_API void zend_get_gc_buffer_grow(zend_get_gc_buffer *gc_buffer); + +static zend_always_inline void zend_get_gc_buffer_add_zval( + zend_get_gc_buffer *gc_buffer, zval *zv) { + if (Z_REFCOUNTED_P(zv)) { + if (UNEXPECTED(gc_buffer->cur == gc_buffer->end)) { + zend_get_gc_buffer_grow(gc_buffer); + } + ZVAL_COPY_VALUE(gc_buffer->cur, zv); + gc_buffer->cur++; + } +} + +static zend_always_inline void zend_get_gc_buffer_add_obj( + zend_get_gc_buffer *gc_buffer, zend_object *obj) { + if (UNEXPECTED(gc_buffer->cur == gc_buffer->end)) { + zend_get_gc_buffer_grow(gc_buffer); + } + ZVAL_OBJ(gc_buffer->cur, obj); + gc_buffer->cur++; +} + +static zend_always_inline void zend_get_gc_buffer_add_ptr( + zend_get_gc_buffer *gc_buffer, void *ptr) { + if (UNEXPECTED(gc_buffer->cur == gc_buffer->end)) { + zend_get_gc_buffer_grow(gc_buffer); + } + ZVAL_PTR(gc_buffer->cur, ptr); + gc_buffer->cur++; +} + +static zend_always_inline void zend_get_gc_buffer_use( + zend_get_gc_buffer *gc_buffer, zval **table, int *n) { + *table = gc_buffer->start; + *n = gc_buffer->cur - gc_buffer->start; +} + +END_EXTERN_C() + +#endif /* ZEND_GC_H */ diff --git a/include/php/Zend/zend_gdb.h b/include/php/Zend/zend_gdb.h new file mode 100644 index 0000000..aad0fef --- /dev/null +++ b/include/php/Zend/zend_gdb.h @@ -0,0 +1,27 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + | Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_GDB +#define ZEND_GDB + +ZEND_API bool zend_gdb_register_code(const void *object, size_t size); +ZEND_API void zend_gdb_unregister_all(void); +ZEND_API bool zend_gdb_present(void); + +#endif diff --git a/include/php/Zend/zend_generators.h b/include/php/Zend/zend_generators.h new file mode 100644 index 0000000..b3fb44c --- /dev/null +++ b/include/php/Zend/zend_generators.h @@ -0,0 +1,133 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Nikita Popov | + | Bob Weinand | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_GENERATORS_H +#define ZEND_GENERATORS_H + +#include + +BEGIN_EXTERN_C() + +extern ZEND_API zend_class_entry *zend_ce_generator; +extern ZEND_API zend_class_entry *zend_ce_ClosedGeneratorException; + +typedef struct _zend_generator_node zend_generator_node; +typedef struct _zend_generator zend_generator; + +/* The concept of `yield from` exposes problems when accessed at different levels of the chain of delegated generators. We need to be able to reference the currently executed Generator in all cases and still being able to access the return values of finished Generators. + * The solution to this problem is a doubly-linked tree, which all Generators referenced in maintain a reference to. It should be impossible to avoid walking the tree in all cases. This way, we only need tree walks from leaf to root in case where some part of the `yield from` chain is passed to another `yield from`. (Update of leaf node pointer and list of multi-children nodes needed when leaf gets a child in direct path from leaf to root node.) But only in that case, which should be a fairly rare case (which is then possible, but not totally cheap). + * The root of the tree is then the currently executed Generator. The subnodes of the tree (all except the root node) are all Generators which do `yield from`. Each node of the tree knows a pointer to one leaf descendant node. Each node with multiple children needs a list of all leaf descendant nodes paired with pointers to their respective child node. (The stack is determined by leaf node pointers) Nodes with only one child just don't need a list, there it is enough to just have a pointer to the child node. Further, leaf nodes store a pointer to the root node. + * That way, when we advance any generator, we just need to look up a leaf node (which all have a reference to a root node). Then we can see at the root node whether current Generator is finished. If it isn't, all is fine and we can just continue. If the Generator finished, there will be two cases. Either it is a simple node with just one child, then go down to child node. Or it has multiple children and we now will remove the current leaf node from the list of nodes (unnecessary, is microoptimization) and go down to the child node whose reference was paired with current leaf node. Child node is then removed its parent reference and becomes new top node. Or the current node references the Generator we're currently executing, then we can continue from the YIELD_FROM opcode. When a node referenced as root node in a leaf node has a parent, then we go the way up until we find a root node without parent. + * In case we go into a new `yield from` level, a node is created on top of current root and becomes the new root. Leaf node needs to be updated with new root node then. + * When a Generator referenced by a node of the tree is added to `yield from`, that node now gets a list of children (we need to walk the descendants of that node and nodes of the tree of the other Generator down to the first multi-children node and copy all the leaf node pointers from there). In case there was no multi-children node (linear tree), we just add a pair (pointer to leaf node, pointer to child node), with the child node being in a direct path from leaf to this node. + */ + +struct _zend_generator_node { + zend_generator *parent; /* NULL for root */ + uint32_t children; + union { + HashTable *ht; /* if multiple children */ + zend_generator *single; /* if one child */ + } child; + /* One generator can cache a direct pointer to the current root. + * The leaf member points back to the generator using the root cache. */ + union { + zend_generator *leaf; /* if parent != NULL */ + zend_generator *root; /* if parent == NULL */ + } ptr; +}; + +struct _zend_generator { + zend_object std; + + /* The suspended execution context. */ + zend_execute_data *execute_data; + + /* Frozen call stack for "yield" used in context of other calls */ + zend_execute_data *frozen_call_stack; + + /* Current value */ + zval value; + /* Current key */ + zval key; + /* Return value */ + zval retval; + /* Variable to put sent value into */ + zval *send_target; + /* Largest used integer key for auto-incrementing keys */ + zend_long largest_used_integer_key; + + /* Values specified by "yield from" to yield from this generator. + * This is only used for arrays or non-generator Traversables. + * This zval also uses the u2 structure in the same way as + * by-value foreach. */ + zval values; + + /* Node of waiting generators when multiple "yield from" expressions + * are nested. */ + zend_generator_node node; + + /* Fake execute_data for stacktraces */ + zend_execute_data execute_fake; + + /* ZEND_GENERATOR_* flags */ + uint8_t flags; +}; + +static const uint8_t ZEND_GENERATOR_CURRENTLY_RUNNING = 0x1; +static const uint8_t ZEND_GENERATOR_FORCED_CLOSE = 0x2; +static const uint8_t ZEND_GENERATOR_AT_FIRST_YIELD = 0x4; +static const uint8_t ZEND_GENERATOR_DO_INIT = 0x8; +static const uint8_t ZEND_GENERATOR_IN_FIBER = 0x10; + +void zend_register_generator_ce(void); +ZEND_API void zend_generator_close(zend_generator *generator, bool finished_execution); +ZEND_API void zend_generator_resume(zend_generator *generator); + +ZEND_API void zend_generator_restore_call_stack(zend_generator *generator); +ZEND_API zend_execute_data* zend_generator_freeze_call_stack(zend_execute_data *execute_data); + +void zend_generator_yield_from(zend_generator *generator, zend_generator *from); +ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_data *ptr); + +ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator); +ZEND_API zend_generator *zend_generator_update_root(zend_generator *generator); +static zend_always_inline zend_generator *zend_generator_get_current(zend_generator *generator) +{ + if (EXPECTED(generator->node.parent == NULL)) { + /* we're not in yield from mode */ + return generator; + } + + zend_generator *root = generator->node.ptr.root; + if (!root) { + root = zend_generator_update_root(generator); + } + + if (EXPECTED(root->execute_data)) { + /* generator still running */ + return root; + } + + return zend_generator_update_current(generator); +} + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_generators_arginfo.h b/include/php/Zend/zend_generators_arginfo.h new file mode 100644 index 0000000..26870a5 --- /dev/null +++ b/include/php/Zend/zend_generators_arginfo.h @@ -0,0 +1,75 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 0af5e8985dd4645bf23490b8cec312f8fd1fee2e */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Generator_rewind, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Generator_valid, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Generator_current, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Generator_key arginfo_class_Generator_current + +#define arginfo_class_Generator_next arginfo_class_Generator_rewind + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Generator_send, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Generator_throw, 0, 1, IS_MIXED, 0) + ZEND_ARG_OBJ_INFO(0, exception, Throwable, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Generator_getReturn arginfo_class_Generator_current + + +ZEND_METHOD(Generator, rewind); +ZEND_METHOD(Generator, valid); +ZEND_METHOD(Generator, current); +ZEND_METHOD(Generator, key); +ZEND_METHOD(Generator, next); +ZEND_METHOD(Generator, send); +ZEND_METHOD(Generator, throw); +ZEND_METHOD(Generator, getReturn); + + +static const zend_function_entry class_Generator_methods[] = { + ZEND_ME(Generator, rewind, arginfo_class_Generator_rewind, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, valid, arginfo_class_Generator_valid, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, current, arginfo_class_Generator_current, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, key, arginfo_class_Generator_key, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, next, arginfo_class_Generator_next, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, send, arginfo_class_Generator_send, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, throw, arginfo_class_Generator_throw, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, getReturn, arginfo_class_Generator_getReturn, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_ClosedGeneratorException_methods[] = { + ZEND_FE_END +}; + +static zend_class_entry *register_class_Generator(zend_class_entry *class_entry_Iterator) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Generator", class_Generator_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; + zend_class_implements(class_entry, 1, class_entry_Iterator); + + return class_entry; +} + +static zend_class_entry *register_class_ClosedGeneratorException(zend_class_entry *class_entry_Exception) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ClosedGeneratorException", class_ClosedGeneratorException_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception); + + return class_entry; +} diff --git a/include/php/Zend/zend_globals.h b/include/php/Zend/zend_globals.h new file mode 100644 index 0000000..8900a5f --- /dev/null +++ b/include/php/Zend/zend_globals.h @@ -0,0 +1,382 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_GLOBALS_H +#define ZEND_GLOBALS_H + + +#include +#include +#include + +#include "zend_globals_macros.h" + +#include "zend_atomic.h" +#include "zend_stack.h" +#include "zend_ptr_stack.h" +#include "zend_hash.h" +#include "zend_llist.h" +#include "zend_objects.h" +#include "zend_objects_API.h" +#include "zend_modules.h" +#include "zend_float.h" +#include "zend_multibyte.h" +#include "zend_multiply.h" +#include "zend_arena.h" +#include "zend_call_stack.h" +#include "zend_max_execution_timer.h" + +/* Define ZTS if you want a thread-safe Zend */ +/*#undef ZTS*/ + +#ifdef ZTS + +BEGIN_EXTERN_C() +ZEND_API extern int compiler_globals_id; +ZEND_API extern int executor_globals_id; +ZEND_API extern size_t compiler_globals_offset; +ZEND_API extern size_t executor_globals_offset; +END_EXTERN_C() + +#endif + +#define SYMTABLE_CACHE_SIZE 32 + +#ifdef ZEND_CHECK_STACK_LIMIT +# define ZEND_MAX_ALLOWED_STACK_SIZE_UNCHECKED -1 +# define ZEND_MAX_ALLOWED_STACK_SIZE_DETECT 0 +#endif + +#include "zend_compile.h" + +/* excpt.h on Digital Unix 4.0 defines function_table */ +#undef function_table + +typedef struct _zend_vm_stack *zend_vm_stack; +typedef struct _zend_ini_entry zend_ini_entry; +typedef struct _zend_fiber_context zend_fiber_context; +typedef struct _zend_fiber zend_fiber; + +typedef enum { + ZEND_MEMOIZE_NONE, + ZEND_MEMOIZE_COMPILE, + ZEND_MEMOIZE_FETCH, +} zend_memoize_mode; + +struct _zend_compiler_globals { + zend_stack loop_var_stack; + + zend_class_entry *active_class_entry; + + zend_string *compiled_filename; + + int zend_lineno; + + zend_op_array *active_op_array; + + HashTable *function_table; /* function symbol table */ + HashTable *class_table; /* class table */ + + HashTable *auto_globals; + + /* Refer to zend_yytnamerr() in zend_language_parser.y for meaning of values */ + uint8_t parse_error; + bool in_compilation; + bool short_tags; + + bool unclean_shutdown; + + bool ini_parser_unbuffered_errors; + + zend_llist open_files; + + struct _zend_ini_parser_param *ini_parser_param; + + bool skip_shebang; + bool increment_lineno; + + bool variable_width_locale; /* UTF-8, Shift-JIS, Big5, ISO 2022, EUC, etc */ + bool ascii_compatible_locale; /* locale uses ASCII characters as singletons */ + /* and don't use them as lead/trail units */ + + zend_string *doc_comment; + uint32_t extra_fn_flags; + + uint32_t compiler_options; /* set of ZEND_COMPILE_* constants */ + + zend_oparray_context context; + zend_file_context file_context; + + zend_arena *arena; + + HashTable interned_strings; + + const zend_encoding **script_encoding_list; + size_t script_encoding_list_size; + bool multibyte; + bool detect_unicode; + bool encoding_declared; + + zend_ast *ast; + zend_arena *ast_arena; + + zend_stack delayed_oplines_stack; + HashTable *memoized_exprs; + zend_memoize_mode memoize_mode; + + void *map_ptr_real_base; + void *map_ptr_base; + size_t map_ptr_size; + size_t map_ptr_last; + + HashTable *delayed_variance_obligations; + HashTable *delayed_autoloads; + HashTable *unlinked_uses; + zend_class_entry *current_linking_class; + + uint32_t rtd_key_counter; + + zend_stack short_circuiting_opnums; +#ifdef ZTS + uint32_t copied_functions_count; +#endif +}; + + +struct _zend_executor_globals { + zval uninitialized_zval; + zval error_zval; + + /* symbol table cache */ + zend_array *symtable_cache[SYMTABLE_CACHE_SIZE]; + /* Pointer to one past the end of the symtable_cache */ + zend_array **symtable_cache_limit; + /* Pointer to first unused symtable_cache slot */ + zend_array **symtable_cache_ptr; + + zend_array symbol_table; /* main symbol table */ + + HashTable included_files; /* files already included */ + + JMP_BUF *bailout; + + int error_reporting; + int exit_status; + + HashTable *function_table; /* function symbol table */ + HashTable *class_table; /* class table */ + HashTable *zend_constants; /* constants table */ + + zval *vm_stack_top; + zval *vm_stack_end; + zend_vm_stack vm_stack; + size_t vm_stack_page_size; + + struct _zend_execute_data *current_execute_data; + zend_class_entry *fake_scope; /* used to avoid checks accessing properties */ + + uint32_t jit_trace_num; /* Used by tracing JIT to reference the currently running trace */ + + int ticks_count; + + zend_long precision; + + uint32_t persistent_constants_count; + uint32_t persistent_functions_count; + uint32_t persistent_classes_count; + + /* for extended information support */ + bool no_extensions; + + bool full_tables_cleanup; + + zend_atomic_bool vm_interrupt; + zend_atomic_bool timed_out; + + HashTable *in_autoload; + + zend_long hard_timeout; + void *stack_base; + void *stack_limit; + +#ifdef ZEND_WIN32 + OSVERSIONINFOEX windows_version_info; +#endif + + HashTable regular_list; + HashTable persistent_list; + + int user_error_handler_error_reporting; + bool exception_ignore_args; + zval user_error_handler; + zval user_exception_handler; + zend_stack user_error_handlers_error_reporting; + zend_stack user_error_handlers; + zend_stack user_exception_handlers; + + zend_class_entry *exception_class; + zend_error_handling_t error_handling; + + int capture_warnings_during_sccp; + + /* timeout support */ + zend_long timeout_seconds; + + HashTable *ini_directives; + HashTable *modified_ini_directives; + zend_ini_entry *error_reporting_ini_entry; + + zend_objects_store objects_store; + zend_object *exception, *prev_exception; + const zend_op *opline_before_exception; + zend_op exception_op[3]; + + struct _zend_module_entry *current_module; + + bool active; + uint8_t flags; + + zend_long assertions; + + uint32_t ht_iterators_count; /* number of allocated slots */ + uint32_t ht_iterators_used; /* number of used slots */ + HashTableIterator *ht_iterators; + HashTableIterator ht_iterators_slots[16]; + + void *saved_fpu_cw_ptr; +#if XPFPA_HAVE_CW + XPFPA_CW_DATATYPE saved_fpu_cw; +#endif + + zend_function trampoline; + zend_op call_trampoline_op; + + HashTable weakrefs; + + zend_long exception_string_param_max_len; + + zend_get_gc_buffer get_gc_buffer; + + zend_fiber_context *main_fiber_context; + zend_fiber_context *current_fiber_context; + + /* Active instance of Fiber. */ + zend_fiber *active_fiber; + + /* Default fiber C stack size. */ + size_t fiber_stack_size; + + /* If record_errors is enabled, all emitted diagnostics will be recorded, + * in addition to being processed as usual. */ + bool record_errors; + uint32_t num_errors; + zend_error_info **errors; + + /* Override filename or line number of thrown errors and exceptions */ + zend_string *filename_override; + zend_long lineno_override; + +#ifdef ZEND_CHECK_STACK_LIMIT + zend_call_stack call_stack; + zend_long max_allowed_stack_size; + zend_ulong reserved_stack_size; +#endif + +#ifdef ZEND_MAX_EXECUTION_TIMERS + timer_t max_execution_timer_timer; + pid_t pid; + struct sigaction oldact; +#endif + + void *reserved[ZEND_MAX_RESERVED_RESOURCES]; +}; + +#define EG_FLAGS_INITIAL (0) +#define EG_FLAGS_IN_SHUTDOWN (1<<0) +#define EG_FLAGS_OBJECT_STORE_NO_REUSE (1<<1) +#define EG_FLAGS_IN_RESOURCE_SHUTDOWN (1<<2) + +struct _zend_ini_scanner_globals { + zend_file_handle *yy_in; + zend_file_handle *yy_out; + + unsigned int yy_leng; + const unsigned char *yy_start; + const unsigned char *yy_text; + const unsigned char *yy_cursor; + const unsigned char *yy_marker; + const unsigned char *yy_limit; + int yy_state; + zend_stack state_stack; + + zend_string *filename; + int lineno; + + /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */ + int scanner_mode; +}; + +typedef enum { + ON_TOKEN, + ON_FEEDBACK, + ON_STOP +} zend_php_scanner_event; + +struct _zend_php_scanner_globals { + zend_file_handle *yy_in; + zend_file_handle *yy_out; + + 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; + zend_ptr_stack heredoc_label_stack; + zend_stack nest_location_stack; /* for syntax error reporting */ + bool heredoc_scan_ahead; + int heredoc_indentation; + bool heredoc_indentation_uses_spaces; + + /* original (unfiltered) script */ + unsigned char *script_org; + size_t script_org_size; + + /* filtered script */ + unsigned char *script_filtered; + size_t script_filtered_size; + + /* input/output filters */ + zend_encoding_filter input_filter; + zend_encoding_filter output_filter; + const zend_encoding *script_encoding; + + /* initial string length after scanning to first variable */ + int scanned_string_len; + + /* hooks */ + void (*on_event)( + zend_php_scanner_event event, int token, int line, + const char *text, size_t length, void *context); + void *on_event_context; +}; + +#endif /* ZEND_GLOBALS_H */ diff --git a/include/php/Zend/zend_globals_macros.h b/include/php/Zend/zend_globals_macros.h new file mode 100644 index 0000000..59b3dac --- /dev/null +++ b/include/php/Zend/zend_globals_macros.h @@ -0,0 +1,71 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_GLOBALS_MACROS_H +#define ZEND_GLOBALS_MACROS_H + +typedef struct _zend_compiler_globals zend_compiler_globals; +typedef struct _zend_executor_globals zend_executor_globals; +typedef struct _zend_php_scanner_globals zend_php_scanner_globals; +typedef struct _zend_ini_scanner_globals zend_ini_scanner_globals; + +BEGIN_EXTERN_C() + +/* Compiler */ +#ifdef ZTS +# define CG(v) ZEND_TSRMG_FAST(compiler_globals_offset, zend_compiler_globals *, v) +#else +# define CG(v) (compiler_globals.v) +extern ZEND_API struct _zend_compiler_globals compiler_globals; +#endif +ZEND_API int zendparse(void); + + +/* Executor */ +#ifdef ZTS +# define EG(v) ZEND_TSRMG_FAST(executor_globals_offset, zend_executor_globals *, v) +#else +# define EG(v) (executor_globals.v) +extern ZEND_API zend_executor_globals executor_globals; +#endif + +/* Language Scanner */ +#ifdef ZTS +# define LANG_SCNG(v) ZEND_TSRMG_FAST(language_scanner_globals_offset, zend_php_scanner_globals *, v) +extern ZEND_API ts_rsrc_id language_scanner_globals_id; +extern ZEND_API size_t language_scanner_globals_offset; +#else +# define LANG_SCNG(v) (language_scanner_globals.v) +extern ZEND_API zend_php_scanner_globals language_scanner_globals; +#endif + + +/* INI Scanner */ +#ifdef ZTS +# define INI_SCNG(v) ZEND_TSRMG_FAST(ini_scanner_globals_offset, zend_ini_scanner_globals *, v) +extern ZEND_API ts_rsrc_id ini_scanner_globals_id; +extern ZEND_API size_t ini_scanner_globals_offset; +#else +# define INI_SCNG(v) (ini_scanner_globals.v) +extern ZEND_API zend_ini_scanner_globals ini_scanner_globals; +#endif + +END_EXTERN_C() + +#endif /* ZEND_GLOBALS_MACROS_H */ diff --git a/include/php/Zend/zend_hash.h b/include/php/Zend/zend_hash.h new file mode 100644 index 0000000..5726c8a --- /dev/null +++ b/include/php/Zend/zend_hash.h @@ -0,0 +1,1677 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_HASH_H +#define ZEND_HASH_H + +#include "zend.h" +#include "zend_sort.h" + +#define HASH_KEY_IS_STRING 1 +#define HASH_KEY_IS_LONG 2 +#define HASH_KEY_NON_EXISTENT 3 + +#define HASH_UPDATE (1<<0) +#define HASH_ADD (1<<1) +#define HASH_UPDATE_INDIRECT (1<<2) +#define HASH_ADD_NEW (1<<3) +#define HASH_ADD_NEXT (1<<4) +#define HASH_LOOKUP (1<<5) + +#define HASH_FLAG_CONSISTENCY ((1<<0) | (1<<1)) +#define HASH_FLAG_PACKED (1<<2) +#define HASH_FLAG_UNINITIALIZED (1<<3) +#define HASH_FLAG_STATIC_KEYS (1<<4) /* long and interned strings */ +#define HASH_FLAG_HAS_EMPTY_IND (1<<5) +#define HASH_FLAG_ALLOW_COW_VIOLATION (1<<6) + +/* Only the low byte are real flags */ +#define HASH_FLAG_MASK 0xff + +#define HT_FLAGS(ht) (ht)->u.flags + +#define HT_INVALIDATE(ht) do { \ + HT_FLAGS(ht) = HASH_FLAG_UNINITIALIZED; \ + } while (0) + +#define HT_IS_INITIALIZED(ht) \ + ((HT_FLAGS(ht) & HASH_FLAG_UNINITIALIZED) == 0) + +#define HT_IS_PACKED(ht) \ + ((HT_FLAGS(ht) & HASH_FLAG_PACKED) != 0) + +#define HT_IS_WITHOUT_HOLES(ht) \ + ((ht)->nNumUsed == (ht)->nNumOfElements) + +#define HT_HAS_STATIC_KEYS_ONLY(ht) \ + ((HT_FLAGS(ht) & (HASH_FLAG_PACKED|HASH_FLAG_STATIC_KEYS)) != 0) + +#if ZEND_DEBUG +# define HT_ALLOW_COW_VIOLATION(ht) HT_FLAGS(ht) |= HASH_FLAG_ALLOW_COW_VIOLATION +#else +# define HT_ALLOW_COW_VIOLATION(ht) +#endif + +#define HT_ITERATORS_COUNT(ht) (ht)->u.v.nIteratorsCount +#define HT_ITERATORS_OVERFLOW(ht) (HT_ITERATORS_COUNT(ht) == 0xff) +#define HT_HAS_ITERATORS(ht) (HT_ITERATORS_COUNT(ht) != 0) + +#define HT_SET_ITERATORS_COUNT(ht, iters) \ + do { HT_ITERATORS_COUNT(ht) = (iters); } while (0) +#define HT_INC_ITERATORS_COUNT(ht) \ + HT_SET_ITERATORS_COUNT(ht, HT_ITERATORS_COUNT(ht) + 1) +#define HT_DEC_ITERATORS_COUNT(ht) \ + HT_SET_ITERATORS_COUNT(ht, HT_ITERATORS_COUNT(ht) - 1) + +extern ZEND_API const HashTable zend_empty_array; + +#define ZVAL_EMPTY_ARRAY(z) do { \ + zval *__z = (z); \ + Z_ARR_P(__z) = (zend_array*)&zend_empty_array; \ + Z_TYPE_INFO_P(__z) = IS_ARRAY; \ + } while (0) + + +typedef struct _zend_hash_key { + zend_ulong h; + zend_string *key; +} zend_hash_key; + +typedef bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_data, zend_hash_key *hash_key, void *pParam); + +BEGIN_EXTERN_C() + +/* startup/shutdown */ +ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent); +ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht); +ZEND_API void ZEND_FASTCALL zend_hash_clean(HashTable *ht); + +#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \ + _zend_hash_init((ht), (nSize), (pDestructor), (persistent)) + +ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, bool packed); +ZEND_API void ZEND_FASTCALL zend_hash_real_init_packed(HashTable *ht); +ZEND_API void ZEND_FASTCALL zend_hash_real_init_mixed(HashTable *ht); +ZEND_API void ZEND_FASTCALL zend_hash_packed_to_hash(HashTable *ht); +ZEND_API void ZEND_FASTCALL zend_hash_to_packed(HashTable *ht); +ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool packed); +ZEND_API void ZEND_FASTCALL zend_hash_discard(HashTable *ht, uint32_t nNumUsed); +ZEND_API void ZEND_FASTCALL zend_hash_packed_grow(HashTable *ht); + +/* additions/updates/changes */ +ZEND_API zval* ZEND_FASTCALL zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, uint32_t flag); +ZEND_API zval* ZEND_FASTCALL zend_hash_update(HashTable *ht, zend_string *key,zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_update_ind(HashTable *ht, zend_string *key,zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_add(HashTable *ht, zend_string *key,zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_add_new(HashTable *ht, zend_string *key,zval *pData); + +ZEND_API zval* ZEND_FASTCALL zend_hash_str_add_or_update(HashTable *ht, const char *key, size_t len, zval *pData, uint32_t flag); +ZEND_API zval* ZEND_FASTCALL zend_hash_str_update(HashTable *ht, const char *key, size_t len, zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_str_update_ind(HashTable *ht, const char *key, size_t len, zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_str_add(HashTable *ht, const char *key, size_t len, zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_str_add_new(HashTable *ht, const char *key, size_t len, zval *pData); + +ZEND_API zval* ZEND_FASTCALL zend_hash_index_add_or_update(HashTable *ht, zend_ulong h, zval *pData, uint32_t flag); +ZEND_API zval* ZEND_FASTCALL zend_hash_index_add(HashTable *ht, zend_ulong h, zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_index_add_new(HashTable *ht, zend_ulong h, zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_next_index_insert(HashTable *ht, zval *pData); +ZEND_API zval* ZEND_FASTCALL zend_hash_next_index_insert_new(HashTable *ht, zval *pData); + +ZEND_API zval* ZEND_FASTCALL zend_hash_index_add_empty_element(HashTable *ht, zend_ulong h); +ZEND_API zval* ZEND_FASTCALL zend_hash_add_empty_element(HashTable *ht, zend_string *key); +ZEND_API zval* ZEND_FASTCALL zend_hash_str_add_empty_element(HashTable *ht, const char *key, size_t len); + +ZEND_API zval* ZEND_FASTCALL zend_hash_set_bucket_key(HashTable *ht, Bucket *p, zend_string *key); + +#define ZEND_HASH_APPLY_KEEP 0 +#define ZEND_HASH_APPLY_REMOVE 1<<0 +#define ZEND_HASH_APPLY_STOP 1<<1 + +typedef int (*apply_func_t)(zval *pDest); +typedef int (*apply_func_arg_t)(zval *pDest, void *argument); +typedef int (*apply_func_args_t)(zval *pDest, int num_args, va_list args, zend_hash_key *hash_key); + +ZEND_API void ZEND_FASTCALL zend_hash_graceful_destroy(HashTable *ht); +ZEND_API void ZEND_FASTCALL zend_hash_graceful_reverse_destroy(HashTable *ht); +ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_func); +ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *); +ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...); + +/* This function should be used with special care (in other words, + * it should usually not be used). When used with the ZEND_HASH_APPLY_STOP + * return value, it assumes things about the order of the elements in the hash. + * Also, it does not provide the same kind of reentrancy protection that + * the standard apply functions do. + */ +ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func); + + +/* Deletes */ +ZEND_API zend_result ZEND_FASTCALL zend_hash_del(HashTable *ht, zend_string *key); +ZEND_API zend_result ZEND_FASTCALL zend_hash_del_ind(HashTable *ht, zend_string *key); +ZEND_API zend_result ZEND_FASTCALL zend_hash_str_del(HashTable *ht, const char *key, size_t len); +ZEND_API zend_result ZEND_FASTCALL zend_hash_str_del_ind(HashTable *ht, const char *key, size_t len); +ZEND_API zend_result ZEND_FASTCALL zend_hash_index_del(HashTable *ht, zend_ulong h); +ZEND_API void ZEND_FASTCALL zend_hash_del_bucket(HashTable *ht, Bucket *p); +ZEND_API void ZEND_FASTCALL zend_hash_packed_del_val(HashTable *ht, zval *zv); + +/* Data retrieval */ +ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key); +ZEND_API zval* ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char *key, size_t len); +ZEND_API zval* ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h); +ZEND_API zval* ZEND_FASTCALL _zend_hash_index_find(const HashTable *ht, zend_ulong h); + +/* The same as zend_hash_find(), but hash value of the key must be already calculated. */ +ZEND_API zval* ZEND_FASTCALL zend_hash_find_known_hash(const HashTable *ht, const zend_string *key); + +static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_string *key, bool known_hash) +{ + if (known_hash) { + return zend_hash_find_known_hash(ht, key); + } else { + return zend_hash_find(ht, key); + } +} + +#define ZEND_HASH_INDEX_FIND(_ht, _h, _ret, _not_found) do { \ + if (EXPECTED(HT_IS_PACKED(_ht))) { \ + if (EXPECTED((zend_ulong)(_h) < (zend_ulong)(_ht)->nNumUsed)) { \ + _ret = &_ht->arPacked[_h]; \ + if (UNEXPECTED(Z_TYPE_P(_ret) == IS_UNDEF)) { \ + goto _not_found; \ + } \ + } else { \ + goto _not_found; \ + } \ + } else { \ + _ret = _zend_hash_index_find(_ht, _h); \ + if (UNEXPECTED(_ret == NULL)) { \ + goto _not_found; \ + } \ + } \ + } while (0) + + +/* Find or add NULL, if doesn't exist */ +ZEND_API zval* ZEND_FASTCALL zend_hash_lookup(HashTable *ht, zend_string *key); +ZEND_API zval* ZEND_FASTCALL zend_hash_index_lookup(HashTable *ht, zend_ulong h); + +#define ZEND_HASH_INDEX_LOOKUP(_ht, _h, _ret) do { \ + if (EXPECTED(HT_IS_PACKED(_ht))) { \ + if (EXPECTED((zend_ulong)(_h) < (zend_ulong)(_ht)->nNumUsed)) { \ + _ret = &_ht->arPacked[_h]; \ + if (EXPECTED(Z_TYPE_P(_ret) != IS_UNDEF)) { \ + break; \ + } \ + } \ + } \ + _ret = zend_hash_index_lookup(_ht, _h); \ + } while (0) + +/* Misc */ +static zend_always_inline bool zend_hash_exists(const HashTable *ht, zend_string *key) +{ + return zend_hash_find(ht, key) != NULL; +} + +static zend_always_inline bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len) +{ + return zend_hash_str_find(ht, str, len) != NULL; +} + +static zend_always_inline bool zend_hash_index_exists(const HashTable *ht, zend_ulong h) +{ + return zend_hash_index_find(ht, h) != NULL; +} + +/* traversing */ +ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *ht); + +ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos); +ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos); +ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, const HashPosition *pos); +ZEND_API void ZEND_FASTCALL zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, const HashPosition *pos); +ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos); +ZEND_API zval* ZEND_FASTCALL zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos); +ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos); +ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos); + +static zend_always_inline zend_result zend_hash_has_more_elements_ex(HashTable *ht, HashPosition *pos) { + return (zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTENT ? FAILURE : SUCCESS); +} +static zend_always_inline zend_result zend_hash_has_more_elements(HashTable *ht) { + return zend_hash_has_more_elements_ex(ht, &ht->nInternalPointer); +} +static zend_always_inline zend_result zend_hash_move_forward(HashTable *ht) { + return zend_hash_move_forward_ex(ht, &ht->nInternalPointer); +} +static zend_always_inline zend_result zend_hash_move_backwards(HashTable *ht) { + return zend_hash_move_backwards_ex(ht, &ht->nInternalPointer); +} +static zend_always_inline int zend_hash_get_current_key(const HashTable *ht, zend_string **str_index, zend_ulong *num_index) { + return zend_hash_get_current_key_ex(ht, str_index, num_index, &ht->nInternalPointer); +} +static zend_always_inline void zend_hash_get_current_key_zval(const HashTable *ht, zval *key) { + zend_hash_get_current_key_zval_ex(ht, key, &ht->nInternalPointer); +} +static zend_always_inline int zend_hash_get_current_key_type(HashTable *ht) { + return zend_hash_get_current_key_type_ex(ht, &ht->nInternalPointer); +} +static zend_always_inline zval* zend_hash_get_current_data(HashTable *ht) { + return zend_hash_get_current_data_ex(ht, &ht->nInternalPointer); +} +static zend_always_inline void zend_hash_internal_pointer_reset(HashTable *ht) { + zend_hash_internal_pointer_reset_ex(ht, &ht->nInternalPointer); +} +static zend_always_inline void zend_hash_internal_pointer_end(HashTable *ht) { + zend_hash_internal_pointer_end_ex(ht, &ht->nInternalPointer); +} + +/* Copying, merging and sorting */ +ZEND_API void ZEND_FASTCALL zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor); +ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite); +ZEND_API void ZEND_FASTCALL zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam); +ZEND_API void zend_hash_bucket_swap(Bucket *p, Bucket *q); +ZEND_API void zend_hash_bucket_renum_swap(Bucket *p, Bucket *q); +ZEND_API void zend_hash_bucket_packed_swap(Bucket *p, Bucket *q); + +typedef int (*bucket_compare_func_t)(Bucket *a, Bucket *b); +ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, bool ordered); +ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, bool renumber); +ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag); + +static zend_always_inline void ZEND_FASTCALL zend_hash_sort(HashTable *ht, bucket_compare_func_t compare_func, bool renumber) { + zend_hash_sort_ex(ht, zend_sort, compare_func, renumber); +} + +static zend_always_inline uint32_t zend_hash_num_elements(const HashTable *ht) { + return ht->nNumOfElements; +} + +static zend_always_inline zend_long zend_hash_next_free_element(const HashTable *ht) { + return ht->nNextFreeElement; +} + +ZEND_API void ZEND_FASTCALL zend_hash_rehash(HashTable *ht); + +#if !ZEND_DEBUG && defined(HAVE_BUILTIN_CONSTANT_P) +# define zend_new_array(size) \ + (__builtin_constant_p(size) ? \ + ((((uint32_t)(size)) <= HT_MIN_SIZE) ? \ + _zend_new_array_0() \ + : \ + _zend_new_array((size)) \ + ) \ + : \ + _zend_new_array((size)) \ + ) +#else +# define zend_new_array(size) \ + _zend_new_array(size) +#endif + +ZEND_API HashTable* ZEND_FASTCALL _zend_new_array_0(void); +ZEND_API HashTable* ZEND_FASTCALL _zend_new_array(uint32_t size); +ZEND_API HashTable* ZEND_FASTCALL zend_new_pair(zval *val1, zval *val2); +ZEND_API uint32_t zend_array_count(HashTable *ht); +ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source); +ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht); +ZEND_API HashTable* zend_array_to_list(HashTable *source); +ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht); +ZEND_API HashTable* ZEND_FASTCALL zend_symtable_to_proptable(HashTable *ht); +ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, bool always_duplicate); + +ZEND_API bool ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx); + +ZEND_API uint32_t ZEND_FASTCALL zend_hash_iterator_add(HashTable *ht, HashPosition pos); +ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht); +ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array); +ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx); +ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterators_lower_pos(HashTable *ht, HashPosition start); +ZEND_API void ZEND_FASTCALL _zend_hash_iterators_update(HashTable *ht, HashPosition from, HashPosition to); +ZEND_API void ZEND_FASTCALL zend_hash_iterators_advance(HashTable *ht, HashPosition step); + +static zend_always_inline void zend_hash_iterators_update(HashTable *ht, HashPosition from, HashPosition to) +{ + if (UNEXPECTED(HT_HAS_ITERATORS(ht))) { + _zend_hash_iterators_update(ht, from, to); + } +} + +/* For regular arrays (non-persistent, storing zvals). */ +static zend_always_inline void zend_array_release(zend_array *array) +{ + if (!(GC_FLAGS(array) & IS_ARRAY_IMMUTABLE)) { + if (GC_DELREF(array) == 0) { + zend_array_destroy(array); + } + } +} + +/* For general hashes (possibly persistent, storing any kind of value). */ +static zend_always_inline void zend_hash_release(zend_array *array) +{ + if (!(GC_FLAGS(array) & IS_ARRAY_IMMUTABLE)) { + if (GC_DELREF(array) == 0) { + zend_hash_destroy(array); + pefree(array, GC_FLAGS(array) & IS_ARRAY_PERSISTENT); + } + } +} + +END_EXTERN_C() + +#define ZEND_INIT_SYMTABLE(ht) \ + ZEND_INIT_SYMTABLE_EX(ht, 8, 0) + +#define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \ + zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) + +static zend_always_inline bool _zend_handle_numeric_str(const char *key, size_t length, zend_ulong *idx) +{ + const char *tmp = key; + + if (EXPECTED(*tmp > '9')) { + return 0; + } else if (*tmp < '0') { + if (*tmp != '-') { + return 0; + } + tmp++; + if (*tmp > '9' || *tmp < '0') { + return 0; + } + } + return _zend_handle_numeric_str_ex(key, length, idx); +} + +#define ZEND_HANDLE_NUMERIC_STR(key, length, idx) \ + _zend_handle_numeric_str(key, length, &idx) + +#define ZEND_HANDLE_NUMERIC(key, idx) \ + ZEND_HANDLE_NUMERIC_STR(ZSTR_VAL(key), ZSTR_LEN(key), idx) + + +static zend_always_inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key) +{ + zval *zv; + + zv = zend_hash_find(ht, key); + return (zv && Z_TYPE_P(zv) == IS_INDIRECT) ? + ((Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF) ? Z_INDIRECT_P(zv) : NULL) : zv; +} + + +static zend_always_inline zval *zend_hash_find_ex_ind(const HashTable *ht, zend_string *key, bool known_hash) +{ + zval *zv; + + zv = zend_hash_find_ex(ht, key, known_hash); + return (zv && Z_TYPE_P(zv) == IS_INDIRECT) ? + ((Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF) ? Z_INDIRECT_P(zv) : NULL) : zv; +} + + +static zend_always_inline bool zend_hash_exists_ind(const HashTable *ht, zend_string *key) +{ + zval *zv; + + zv = zend_hash_find(ht, key); + return zv && (Z_TYPE_P(zv) != IS_INDIRECT || + Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF); +} + + +static zend_always_inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, size_t len) +{ + zval *zv; + + zv = zend_hash_str_find(ht, str, len); + return (zv && Z_TYPE_P(zv) == IS_INDIRECT) ? + ((Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF) ? Z_INDIRECT_P(zv) : NULL) : zv; +} + + +static zend_always_inline bool zend_hash_str_exists_ind(const HashTable *ht, const char *str, size_t len) +{ + zval *zv; + + zv = zend_hash_str_find(ht, str, len); + return zv && (Z_TYPE_P(zv) != IS_INDIRECT || + Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF); +} + +static zend_always_inline zval *zend_symtable_add_new(HashTable *ht, zend_string *key, zval *pData) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_add_new(ht, idx, pData); + } else { + return zend_hash_add_new(ht, key, pData); + } +} + +static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_update(ht, idx, pData); + } else { + return zend_hash_update(ht, key, pData); + } +} + + +static zend_always_inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zval *pData) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_update(ht, idx, pData); + } else { + return zend_hash_update_ind(ht, key, pData); + } +} + + +static zend_always_inline zend_result zend_symtable_del(HashTable *ht, zend_string *key) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_del(ht, idx); + } else { + return zend_hash_del(ht, key); + } +} + + +static zend_always_inline zend_result zend_symtable_del_ind(HashTable *ht, zend_string *key) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_del(ht, idx); + } else { + return zend_hash_del_ind(ht, key); + } +} + + +static zend_always_inline zval *zend_symtable_find(const HashTable *ht, zend_string *key) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_find(ht, idx); + } else { + return zend_hash_find(ht, key); + } +} + + +static zend_always_inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_find(ht, idx); + } else { + return zend_hash_find_ind(ht, key); + } +} + + +static zend_always_inline bool zend_symtable_exists(HashTable *ht, zend_string *key) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_exists(ht, idx); + } else { + return zend_hash_exists(ht, key); + } +} + + +static zend_always_inline bool zend_symtable_exists_ind(HashTable *ht, zend_string *key) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC(key, idx)) { + return zend_hash_index_exists(ht, idx); + } else { + return zend_hash_exists_ind(ht, key); + } +} + + +static zend_always_inline zval *zend_symtable_str_update(HashTable *ht, const char *str, size_t len, zval *pData) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) { + return zend_hash_index_update(ht, idx, pData); + } else { + return zend_hash_str_update(ht, str, len, pData); + } +} + + +static zend_always_inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str, size_t len, zval *pData) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) { + return zend_hash_index_update(ht, idx, pData); + } else { + return zend_hash_str_update_ind(ht, str, len, pData); + } +} + + +static zend_always_inline zend_result zend_symtable_str_del(HashTable *ht, const char *str, size_t len) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) { + return zend_hash_index_del(ht, idx); + } else { + return zend_hash_str_del(ht, str, len); + } +} + + +static zend_always_inline zend_result zend_symtable_str_del_ind(HashTable *ht, const char *str, size_t len) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) { + return zend_hash_index_del(ht, idx); + } else { + return zend_hash_str_del_ind(ht, str, len); + } +} + + +static zend_always_inline zval *zend_symtable_str_find(HashTable *ht, const char *str, size_t len) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) { + return zend_hash_index_find(ht, idx); + } else { + return zend_hash_str_find(ht, str, len); + } +} + + +static zend_always_inline bool zend_symtable_str_exists(HashTable *ht, const char *str, size_t len) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) { + return zend_hash_index_exists(ht, idx); + } else { + return zend_hash_str_exists(ht, str, len); + } +} + +static zend_always_inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_add(ht, key, &tmp); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +static zend_always_inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_add_new(ht, key, &tmp); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +static zend_always_inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, size_t len, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_str_add(ht, str, len, &tmp); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +static zend_always_inline void *zend_hash_str_add_new_ptr(HashTable *ht, const char *str, size_t len, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_str_add_new(ht, str, len, &tmp); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +static zend_always_inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_update(ht, key, &tmp); + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); +} + +static zend_always_inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, size_t len, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_str_update(ht, str, len, &tmp); + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); +} + +static zend_always_inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pData, size_t size) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, NULL); + if ((zv = zend_hash_add(ht, key, &tmp))) { + Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(Z_PTR_P(zv), pData, size); + return Z_PTR_P(zv); + } + return NULL; +} + +static zend_always_inline void *zend_hash_add_new_mem(HashTable *ht, zend_string *key, void *pData, size_t size) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, NULL); + if ((zv = zend_hash_add_new(ht, key, &tmp))) { + Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(Z_PTR_P(zv), pData, size); + return Z_PTR_P(zv); + } + return NULL; +} + +static zend_always_inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, size_t len, void *pData, size_t size) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, NULL); + if ((zv = zend_hash_str_add(ht, str, len, &tmp))) { + Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(Z_PTR_P(zv), pData, size); + return Z_PTR_P(zv); + } + return NULL; +} + +static zend_always_inline void *zend_hash_str_add_new_mem(HashTable *ht, const char *str, size_t len, void *pData, size_t size) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, NULL); + if ((zv = zend_hash_str_add_new(ht, str, len, &tmp))) { + Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(Z_PTR_P(zv), pData, size); + return Z_PTR_P(zv); + } + return NULL; +} + +static zend_always_inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void *pData, size_t size) +{ + void *p; + + p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(p, pData, size); + return zend_hash_update_ptr(ht, key, p); +} + +static zend_always_inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, size_t len, void *pData, size_t size) +{ + void *p; + + p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(p, pData, size); + return zend_hash_str_update_ptr(ht, str, len, p); +} + +static zend_always_inline void *zend_hash_index_add_ptr(HashTable *ht, zend_ulong h, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_index_add(ht, h, &tmp); + return zv ? Z_PTR_P(zv) : NULL; +} + +static zend_always_inline void *zend_hash_index_add_new_ptr(HashTable *ht, zend_ulong h, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_index_add_new(ht, h, &tmp); + return zv ? Z_PTR_P(zv) : NULL; +} + +static zend_always_inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_index_update(ht, h, &tmp); + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); +} + +static zend_always_inline void *zend_hash_index_add_mem(HashTable *ht, zend_ulong h, void *pData, size_t size) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, NULL); + if ((zv = zend_hash_index_add(ht, h, &tmp))) { + Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(Z_PTR_P(zv), pData, size); + return Z_PTR_P(zv); + } + return NULL; +} + +static zend_always_inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_next_index_insert(ht, &tmp); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +static zend_always_inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void *pData, size_t size) +{ + void *p; + + p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(p, pData, size); + return zend_hash_index_update_ptr(ht, h, p); +} + +static zend_always_inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData, size_t size) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, NULL); + if ((zv = zend_hash_next_index_insert(ht, &tmp))) { + Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); + memcpy(Z_PTR_P(zv), pData, size); + return Z_PTR_P(zv); + } + return NULL; +} + +static zend_always_inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key) +{ + zval *zv; + + zv = zend_hash_find(ht, key); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +static zend_always_inline void *zend_hash_find_ex_ptr(const HashTable *ht, zend_string *key, bool known_hash) +{ + zval *zv; + + zv = zend_hash_find_ex(ht, key, known_hash); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +static zend_always_inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str, size_t len) +{ + zval *zv; + + zv = zend_hash_str_find(ht, str, len); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +/* Will lowercase the str; use only if you don't need the lowercased string for + * anything else. If you have a lowered string, use zend_hash_str_find_ptr. */ +ZEND_API void *zend_hash_str_find_ptr_lc(const HashTable *ht, const char *str, size_t len); + +/* Will lowercase the str; use only if you don't need the lowercased string for + * anything else. If you have a lowered string, use zend_hash_find_ptr. */ +ZEND_API void *zend_hash_find_ptr_lc(const HashTable *ht, zend_string *key); + +static zend_always_inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h) +{ + zval *zv; + + zv = zend_hash_index_find(ht, h); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +static zend_always_inline zval *zend_hash_index_find_deref(HashTable *ht, zend_ulong h) +{ + zval *zv = zend_hash_index_find(ht, h); + if (zv) { + ZVAL_DEREF(zv); + } + return zv; +} + +static zend_always_inline zval *zend_hash_find_deref(HashTable *ht, zend_string *str) +{ + zval *zv = zend_hash_find(ht, str); + if (zv) { + ZVAL_DEREF(zv); + } + return zv; +} + +static zend_always_inline zval *zend_hash_str_find_deref(HashTable *ht, const char *str, size_t len) +{ + zval *zv = zend_hash_str_find(ht, str, len); + if (zv) { + ZVAL_DEREF(zv); + } + return zv; +} + +static zend_always_inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, size_t len) +{ + zend_ulong idx; + + if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) { + return zend_hash_index_find_ptr(ht, idx); + } else { + return zend_hash_str_find_ptr(ht, str, len); + } +} + +static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPosition *pos) +{ + zval *zv; + + zv = zend_hash_get_current_data_ex(ht, pos); + if (zv) { + ZEND_ASSUME(Z_PTR_P(zv)); + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +#define zend_hash_get_current_data_ptr(ht) \ + zend_hash_get_current_data_ptr_ex(ht, &(ht)->nInternalPointer) + +/* Common hash/packed array iterators */ +#if 0 +# define ZEND_HASH_ELEMENT_SIZE(__ht) \ + (HT_IS_PACKED(__ht) ? sizeof(zval) : sizeof(Bucket)) +#else /* optimized version */ +# define ZEND_HASH_ELEMENT_SIZE(__ht) \ + (sizeof(zval) + (~HT_FLAGS(__ht) & HASH_FLAG_PACKED) * ((sizeof(Bucket)-sizeof(zval))/HASH_FLAG_PACKED)) +#endif + +#define ZEND_HASH_ELEMENT_EX(__ht, _idx, _size) \ + ((zval*)(((char*)(__ht)->arPacked) + ((_idx) * (_size)))) + +#define ZEND_HASH_ELEMENT(__ht, _idx) \ + ZEND_HASH_ELEMENT_EX(__ht, _idx, ZEND_HASH_ELEMENT_SIZE(__ht)) + +#define ZEND_HASH_NEXT_ELEMENT(_el, _size) \ + ((zval*)(((char*)(_el)) + (_size))) + +#define ZEND_HASH_PREV_ELEMENT(_el, _size) \ + ((zval*)(((char*)(_el)) - (_size))) + +#define _ZEND_HASH_FOREACH_VAL(_ht) do { \ + HashTable *__ht = (_ht); \ + uint32_t _count = __ht->nNumUsed; \ + size_t _size = ZEND_HASH_ELEMENT_SIZE(__ht); \ + zval *_z = __ht->arPacked; \ + for (; _count > 0; _z = ZEND_HASH_NEXT_ELEMENT(_z, _size), _count--) { \ + if (UNEXPECTED(Z_TYPE_P(_z) == IS_UNDEF)) continue; + +#define _ZEND_HASH_REVERSE_FOREACH_VAL(_ht) do { \ + HashTable *__ht = (_ht); \ + uint32_t _idx = __ht->nNumUsed; \ + size_t _size = ZEND_HASH_ELEMENT_SIZE(__ht); \ + zval *_z = ZEND_HASH_ELEMENT_EX(__ht, _idx, _size); \ + for (;_idx > 0; _idx--) { \ + _z = ZEND_HASH_PREV_ELEMENT(_z, _size); \ + if (UNEXPECTED(Z_TYPE_P(_z) == IS_UNDEF)) continue; + +#define ZEND_HASH_FOREACH_FROM(_ht, indirect, _from) do { \ + HashTable *__ht = (_ht); \ + zend_ulong __h; \ + zend_string *__key = NULL; \ + uint32_t _idx = (_from); \ + size_t _size = ZEND_HASH_ELEMENT_SIZE(__ht); \ + zval *__z = ZEND_HASH_ELEMENT_EX(__ht, _idx, _size); \ + uint32_t _count = __ht->nNumUsed - _idx; \ + for (;_count > 0; _count--) { \ + zval *_z = __z; \ + if (HT_IS_PACKED(__ht)) { \ + __z++; \ + __h = _idx; \ + _idx++; \ + } else { \ + Bucket *_p = (Bucket*)__z; \ + __z = &(_p + 1)->val; \ + __h = _p->h; \ + __key = _p->key; \ + if (indirect && Z_TYPE_P(_z) == IS_INDIRECT) { \ + _z = Z_INDIRECT_P(_z); \ + } \ + } \ + (void) __h; (void) __key; (void) _idx; \ + if (UNEXPECTED(Z_TYPE_P(_z) == IS_UNDEF)) continue; + +#define ZEND_HASH_FOREACH(_ht, indirect) ZEND_HASH_FOREACH_FROM(_ht, indirect, 0) + +#define ZEND_HASH_REVERSE_FOREACH(_ht, indirect) do { \ + HashTable *__ht = (_ht); \ + uint32_t _idx = __ht->nNumUsed; \ + zval *_z; \ + zend_ulong __h; \ + zend_string *__key = NULL; \ + size_t _size = ZEND_HASH_ELEMENT_SIZE(__ht); \ + zval *__z = ZEND_HASH_ELEMENT_EX(__ht, _idx, _size); \ + for (;_idx > 0; _idx--) { \ + if (HT_IS_PACKED(__ht)) { \ + __z--; \ + _z = __z; \ + __h = _idx - 1; \ + } else { \ + Bucket *_p = (Bucket*)__z; \ + _p--; \ + __z = &_p->val; \ + _z = __z; \ + __h = _p->h; \ + __key = _p->key; \ + if (indirect && Z_TYPE_P(_z) == IS_INDIRECT) { \ + _z = Z_INDIRECT_P(_z); \ + } \ + } \ + (void) __h; (void) __key; (void) __z; \ + if (UNEXPECTED(Z_TYPE_P(_z) == IS_UNDEF)) continue; + +#define ZEND_HASH_FOREACH_END() \ + } \ + } while (0) + +#define ZEND_HASH_FOREACH_END_DEL() \ + ZEND_HASH_MAP_FOREACH_END_DEL() + +#define ZEND_HASH_FOREACH_BUCKET(ht, _bucket) \ + ZEND_HASH_MAP_FOREACH_BUCKET(ht, _bucket) + +#define ZEND_HASH_FOREACH_BUCKET_FROM(ht, _bucket, _from) \ + ZEND_HASH_MAP_FOREACH_BUCKET_FROM(ht, _bucket, _from) + +#define ZEND_HASH_REVERSE_FOREACH_BUCKET(ht, _bucket) \ + ZEND_HASH_MAP_REVERSE_FOREACH_BUCKET(ht, _bucket) + +#define ZEND_HASH_FOREACH_VAL(ht, _val) \ + _ZEND_HASH_FOREACH_VAL(ht); \ + _val = _z; + +#define ZEND_HASH_REVERSE_FOREACH_VAL(ht, _val) \ + _ZEND_HASH_REVERSE_FOREACH_VAL(ht); \ + _val = _z; + +#define ZEND_HASH_FOREACH_VAL_IND(ht, _val) \ + ZEND_HASH_FOREACH(ht, 1); \ + _val = _z; + +#define ZEND_HASH_REVERSE_FOREACH_VAL_IND(ht, _val) \ + ZEND_HASH_REVERSE_FOREACH(ht, 1); \ + _val = _z; + +#define ZEND_HASH_FOREACH_PTR(ht, _ptr) \ + _ZEND_HASH_FOREACH_VAL(ht); \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_FOREACH_PTR_FROM(ht, _ptr, _from) \ + ZEND_HASH_FOREACH_FROM(ht, 0, _from); \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_REVERSE_FOREACH_PTR(ht, _ptr) \ + _ZEND_HASH_REVERSE_FOREACH_VAL(ht); \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_FOREACH_NUM_KEY(ht, _h) \ + ZEND_HASH_FOREACH(ht, 0); \ + _h = __h; + +#define ZEND_HASH_REVERSE_FOREACH_NUM_KEY(ht, _h) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _h = __h; + +#define ZEND_HASH_FOREACH_STR_KEY(ht, _key) \ + ZEND_HASH_FOREACH(ht, 0); \ + _key = __key; + +#define ZEND_HASH_REVERSE_FOREACH_STR_KEY(ht, _key) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _key = __key; + +#define ZEND_HASH_FOREACH_KEY(ht, _h, _key) \ + ZEND_HASH_FOREACH(ht, 0); \ + _h = __h; \ + _key = __key; + +#define ZEND_HASH_REVERSE_FOREACH_KEY(ht, _h, _key) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _h = __h; \ + _key = __key; + +#define ZEND_HASH_FOREACH_NUM_KEY_VAL(ht, _h, _val) \ + ZEND_HASH_FOREACH(ht, 0); \ + _h = __h; \ + _val = _z; + +#define ZEND_HASH_REVERSE_FOREACH_NUM_KEY_VAL(ht, _h, _val) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _h = __h; \ + _val = _z; + +#define ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val) \ + ZEND_HASH_FOREACH(ht, 0); \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_FOREACH_STR_KEY_VAL_FROM(ht, _key, _val, _from) \ + ZEND_HASH_FOREACH_FROM(ht, 0, _from); \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_REVERSE_FOREACH_STR_KEY_VAL(ht, _key, _val) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_FOREACH_KEY_VAL(ht, _h, _key, _val) \ + ZEND_HASH_FOREACH(ht, 0); \ + _h = __h; \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_REVERSE_FOREACH_KEY_VAL(ht, _h, _key, _val) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _h = __h; \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \ + ZEND_HASH_FOREACH(ht, 1); \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_REVERSE_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \ + ZEND_HASH_REVERSE_FOREACH(ht, 1); \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \ + ZEND_HASH_FOREACH(ht, 1); \ + _h = __h; \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_REVERSE_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \ + ZEND_HASH_REVERSE_FOREACH(ht, 1); \ + _h = __h; \ + _key = __key; \ + _val = _z; + +#define ZEND_HASH_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \ + ZEND_HASH_FOREACH(ht, 0); \ + _h = __h; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_REVERSE_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _h = __h; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \ + ZEND_HASH_FOREACH(ht, 0); \ + _key = __key; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_REVERSE_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _key = __key; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \ + ZEND_HASH_FOREACH(ht, 0); \ + _h = __h; \ + _key = __key; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_REVERSE_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \ + ZEND_HASH_REVERSE_FOREACH(ht, 0); \ + _h = __h; \ + _key = __key; \ + _ptr = Z_PTR_P(_z); + +/* Hash array iterators */ +#define ZEND_HASH_MAP_FOREACH_FROM(_ht, indirect, _from) do { \ + HashTable *__ht = (_ht); \ + Bucket *_p = __ht->arData + (_from); \ + Bucket *_end = __ht->arData + __ht->nNumUsed; \ + ZEND_ASSERT(!HT_IS_PACKED(__ht)); \ + for (; _p != _end; _p++) { \ + zval *_z = &_p->val; \ + if (indirect && Z_TYPE_P(_z) == IS_INDIRECT) { \ + _z = Z_INDIRECT_P(_z); \ + } \ + if (UNEXPECTED(Z_TYPE_P(_z) == IS_UNDEF)) continue; + +#define ZEND_HASH_MAP_FOREACH(_ht, indirect) ZEND_HASH_MAP_FOREACH_FROM(_ht, indirect, 0) + +#define ZEND_HASH_MAP_REVERSE_FOREACH(_ht, indirect) do { \ + HashTable *__ht = (_ht); \ + uint32_t _idx = __ht->nNumUsed; \ + Bucket *_p = __ht->arData + _idx; \ + zval *_z; \ + ZEND_ASSERT(!HT_IS_PACKED(__ht)); \ + for (_idx = __ht->nNumUsed; _idx > 0; _idx--) { \ + _p--; \ + _z = &_p->val; \ + if (indirect && Z_TYPE_P(_z) == IS_INDIRECT) { \ + _z = Z_INDIRECT_P(_z); \ + } \ + if (UNEXPECTED(Z_TYPE_P(_z) == IS_UNDEF)) continue; + +#define ZEND_HASH_MAP_FOREACH_END_DEL() \ + ZEND_ASSERT(!HT_IS_PACKED(__ht)); \ + __ht->nNumOfElements--; \ + do { \ + uint32_t j = HT_IDX_TO_HASH(_idx - 1); \ + uint32_t nIndex = _p->h | __ht->nTableMask; \ + uint32_t i = HT_HASH(__ht, nIndex); \ + if (UNEXPECTED(j != i)) { \ + Bucket *prev = HT_HASH_TO_BUCKET(__ht, i); \ + while (Z_NEXT(prev->val) != j) { \ + i = Z_NEXT(prev->val); \ + prev = HT_HASH_TO_BUCKET(__ht, i); \ + } \ + Z_NEXT(prev->val) = Z_NEXT(_p->val); \ + } else { \ + HT_HASH(__ht, nIndex) = Z_NEXT(_p->val); \ + } \ + } while (0); \ + } \ + __ht->nNumUsed = _idx; \ + } while (0) + +#define ZEND_HASH_MAP_FOREACH_BUCKET(ht, _bucket) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _bucket = _p; + +#define ZEND_HASH_MAP_FOREACH_BUCKET_FROM(ht, _bucket, _from) \ + ZEND_HASH_MAP_FOREACH_FROM(ht, 0, _from); \ + _bucket = _p; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_BUCKET(ht, _bucket) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _bucket = _p; + +#define ZEND_HASH_MAP_FOREACH_VAL(ht, _val) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _val = _z; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_VAL(ht, _val) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _val = _z; + +#define ZEND_HASH_MAP_FOREACH_VAL_IND(ht, _val) \ + ZEND_HASH_MAP_FOREACH(ht, 1); \ + _val = _z; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_VAL_IND(ht, _val) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 1); \ + _val = _z; + +#define ZEND_HASH_MAP_FOREACH_PTR(ht, _ptr) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_MAP_FOREACH_PTR_FROM(ht, _ptr, _from) \ + ZEND_HASH_MAP_FOREACH_FROM(ht, 0, _from); \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_MAP_REVERSE_FOREACH_PTR(ht, _ptr) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_MAP_FOREACH_NUM_KEY(ht, _h) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _h = _p->h; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_NUM_KEY(ht, _h) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _h = _p->h; + +#define ZEND_HASH_MAP_FOREACH_STR_KEY(ht, _key) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _key = _p->key; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY(ht, _key) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _key = _p->key; + +#define ZEND_HASH_MAP_FOREACH_KEY(ht, _h, _key) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _h = _p->h; \ + _key = _p->key; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_KEY(ht, _h, _key) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _h = _p->h; \ + _key = _p->key; + +#define ZEND_HASH_MAP_FOREACH_NUM_KEY_VAL(ht, _h, _val) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _h = _p->h; \ + _val = _z; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_NUM_KEY_VAL(ht, _h, _val) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _h = _p->h; \ + _val = _z; + +#define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(ht, _key, _val) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_FROM(ht, _key, _val, _from) \ + ZEND_HASH_MAP_FOREACH_FROM(ht, 0, _from); \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_VAL(ht, _key, _val) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_FOREACH_KEY_VAL(ht, _h, _key, _val) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _h = _p->h; \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_KEY_VAL(ht, _h, _key, _val) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _h = _p->h; \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \ + ZEND_HASH_MAP_FOREACH(ht, 1); \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 1); \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \ + ZEND_HASH_MAP_FOREACH(ht, 1); \ + _h = _p->h; \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_REVERSE_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 1); \ + _h = _p->h; \ + _key = _p->key; \ + _val = _z; + +#define ZEND_HASH_MAP_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _h = _p->h; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_MAP_REVERSE_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _h = _p->h; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _key = _p->key; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _key = _p->key; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_MAP_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \ + ZEND_HASH_MAP_FOREACH(ht, 0); \ + _h = _p->h; \ + _key = _p->key; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_MAP_REVERSE_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \ + ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \ + _h = _p->h; \ + _key = _p->key; \ + _ptr = Z_PTR_P(_z); + +/* Packed array iterators */ +#define ZEND_HASH_PACKED_FOREACH_FROM(_ht, _from) do { \ + HashTable *__ht = (_ht); \ + zend_ulong _idx = (_from); \ + zval *_z = __ht->arPacked + (_from); \ + zval *_end = __ht->arPacked + __ht->nNumUsed; \ + ZEND_ASSERT(HT_IS_PACKED(__ht)); \ + for (;_z != _end; _z++, _idx++) { \ + (void) _idx; \ + if (UNEXPECTED(Z_TYPE_P(_z) == IS_UNDEF)) continue; + +#define ZEND_HASH_PACKED_FOREACH(_ht) ZEND_HASH_PACKED_FOREACH_FROM(_ht, 0) + +#define ZEND_HASH_PACKED_REVERSE_FOREACH(_ht) do { \ + HashTable *__ht = (_ht); \ + zend_ulong _idx = __ht->nNumUsed; \ + zval *_z = __ht->arPacked + _idx; \ + ZEND_ASSERT(HT_IS_PACKED(__ht)); \ + while (_idx > 0) { \ + _z--; \ + _idx--; \ + (void) _idx; \ + if (UNEXPECTED(Z_TYPE_P(_z) == IS_UNDEF)) continue; + +#define ZEND_HASH_PACKED_FOREACH_VAL(ht, _val) \ + ZEND_HASH_PACKED_FOREACH(ht); \ + _val = _z; + +#define ZEND_HASH_PACKED_REVERSE_FOREACH_VAL(ht, _val) \ + ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \ + _val = _z; + +#define ZEND_HASH_PACKED_FOREACH_PTR(ht, _ptr) \ + ZEND_HASH_PACKED_FOREACH(ht); \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_PACKED_REVERSE_FOREACH_PTR(ht, _ptr) \ + ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_PACKED_FOREACH_KEY(ht, _h) \ + ZEND_HASH_PACKED_FOREACH(ht); \ + _h = _idx; + +#define ZEND_HASH_PACKED_REVERSE_FOREACH_KEY(ht, _h) \ + ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \ + _h = _idx; + +#define ZEND_HASH_PACKED_FOREACH_KEY_VAL(ht, _h, _val) \ + ZEND_HASH_PACKED_FOREACH(ht); \ + _h = _idx; \ + _val = _z; + +#define ZEND_HASH_PACKED_REVERSE_FOREACH_KEY_VAL(ht, _h, _val) \ + ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \ + _h = _idx; \ + _val = _z; + +#define ZEND_HASH_PACKED_FOREACH_KEY_PTR(ht, _h, _ptr) \ + ZEND_HASH_PACKED_FOREACH(ht); \ + _h = _idx; \ + _ptr = Z_PTR_P(_z); + +#define ZEND_HASH_PACKED_REVERSE_FOREACH_KEY_PTR(ht, _h, _ptr) \ + ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \ + _h = _idx; \ + _ptr = Z_PTR_P(_z); + +/* The following macros are useful to insert a sequence of new elements + * of packed array. They may be used instead of series of + * zend_hash_next_index_insert_new() + * (HashTable must have enough free buckets). + */ +#define ZEND_HASH_FILL_PACKED(ht) do { \ + HashTable *__fill_ht = (ht); \ + zval *__fill_val = __fill_ht->arPacked + __fill_ht->nNumUsed; \ + uint32_t __fill_idx = __fill_ht->nNumUsed; \ + ZEND_ASSERT(HT_IS_PACKED(__fill_ht)); + +#define ZEND_HASH_FILL_GROW() do { \ + if (UNEXPECTED(__fill_idx >= __fill_ht->nTableSize)) { \ + __fill_ht->nNumOfElements += __fill_idx - __fill_ht->nNumUsed; \ + __fill_ht->nNumUsed = __fill_idx; \ + __fill_ht->nNextFreeElement = __fill_idx; \ + zend_hash_packed_grow(__fill_ht); \ + __fill_val = __fill_ht->arPacked + __fill_idx; \ + } \ + } while (0); + +#define ZEND_HASH_FILL_SET(_val) \ + ZVAL_COPY_VALUE(__fill_val, _val) + +#define ZEND_HASH_FILL_SET_NULL() \ + ZVAL_NULL(__fill_val) + +#define ZEND_HASH_FILL_SET_LONG(_val) \ + ZVAL_LONG(__fill_val, _val) + +#define ZEND_HASH_FILL_SET_DOUBLE(_val) \ + ZVAL_DOUBLE(__fill_val, _val) + +#define ZEND_HASH_FILL_SET_STR(_val) \ + ZVAL_STR(__fill_val, _val) + +#define ZEND_HASH_FILL_SET_STR_COPY(_val) \ + ZVAL_STR_COPY(__fill_val, _val) + +#define ZEND_HASH_FILL_SET_INTERNED_STR(_val) \ + ZVAL_INTERNED_STR(__fill_val, _val) + +#define ZEND_HASH_FILL_NEXT() do {\ + __fill_val++; \ + __fill_idx++; \ + } while (0) + +#define ZEND_HASH_FILL_ADD(_val) do { \ + ZEND_HASH_FILL_SET(_val); \ + ZEND_HASH_FILL_NEXT(); \ + } while (0) + +#define ZEND_HASH_FILL_FINISH() do { \ + __fill_ht->nNumOfElements += __fill_idx - __fill_ht->nNumUsed; \ + __fill_ht->nNumUsed = __fill_idx; \ + __fill_ht->nNextFreeElement = __fill_idx; \ + __fill_ht->nInternalPointer = 0; \ + } while (0) + +#define ZEND_HASH_FILL_END() \ + ZEND_HASH_FILL_FINISH(); \ + } while (0) + +/* Check if an array is a list */ +static zend_always_inline bool zend_array_is_list(zend_array *array) +{ + zend_ulong expected_idx = 0; + zend_ulong num_idx; + zend_string* str_idx; + /* Empty arrays are lists */ + if (zend_hash_num_elements(array) == 0) { + return 1; + } + + /* Packed arrays are lists */ + if (HT_IS_PACKED(array)) { + if (HT_IS_WITHOUT_HOLES(array)) { + return 1; + } + /* Check if the list could theoretically be repacked */ + ZEND_HASH_PACKED_FOREACH_KEY(array, num_idx) { + if (num_idx != expected_idx++) { + return 0; + } + } ZEND_HASH_FOREACH_END(); + } else { + /* Check if the list could theoretically be repacked */ + ZEND_HASH_MAP_FOREACH_KEY(array, num_idx, str_idx) { + if (str_idx != NULL || num_idx != expected_idx++) { + return 0; + } + } ZEND_HASH_FOREACH_END(); + } + + return 1; +} + + +static zend_always_inline zval *_zend_hash_append_ex(HashTable *ht, zend_string *key, zval *zv, bool interned) +{ + uint32_t idx = ht->nNumUsed++; + uint32_t nIndex; + Bucket *p = ht->arData + idx; + + ZVAL_COPY_VALUE(&p->val, zv); + if (!interned && !ZSTR_IS_INTERNED(key)) { + HT_FLAGS(ht) &= ~HASH_FLAG_STATIC_KEYS; + zend_string_addref(key); + zend_string_hash_val(key); + } + p->key = key; + p->h = ZSTR_H(key); + nIndex = (uint32_t)p->h | ht->nTableMask; + Z_NEXT(p->val) = HT_HASH(ht, nIndex); + HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); + ht->nNumOfElements++; + return &p->val; +} + +static zend_always_inline zval *_zend_hash_append(HashTable *ht, zend_string *key, zval *zv) +{ + return _zend_hash_append_ex(ht, key, zv, 0); +} + +static zend_always_inline zval *_zend_hash_append_ptr_ex(HashTable *ht, zend_string *key, void *ptr, bool interned) +{ + uint32_t idx = ht->nNumUsed++; + uint32_t nIndex; + Bucket *p = ht->arData + idx; + + ZVAL_PTR(&p->val, ptr); + if (!interned && !ZSTR_IS_INTERNED(key)) { + HT_FLAGS(ht) &= ~HASH_FLAG_STATIC_KEYS; + zend_string_addref(key); + zend_string_hash_val(key); + } + p->key = key; + p->h = ZSTR_H(key); + nIndex = (uint32_t)p->h | ht->nTableMask; + Z_NEXT(p->val) = HT_HASH(ht, nIndex); + HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); + ht->nNumOfElements++; + return &p->val; +} + +static zend_always_inline zval *_zend_hash_append_ptr(HashTable *ht, zend_string *key, void *ptr) +{ + return _zend_hash_append_ptr_ex(ht, key, ptr, 0); +} + +static zend_always_inline void _zend_hash_append_ind(HashTable *ht, zend_string *key, zval *ptr) +{ + uint32_t idx = ht->nNumUsed++; + uint32_t nIndex; + Bucket *p = ht->arData + idx; + + ZVAL_INDIRECT(&p->val, ptr); + if (!ZSTR_IS_INTERNED(key)) { + HT_FLAGS(ht) &= ~HASH_FLAG_STATIC_KEYS; + zend_string_addref(key); + zend_string_hash_val(key); + } + p->key = key; + p->h = ZSTR_H(key); + nIndex = (uint32_t)p->h | ht->nTableMask; + Z_NEXT(p->val) = HT_HASH(ht, nIndex); + HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); + ht->nNumOfElements++; +} + +#endif /* ZEND_HASH_H */ diff --git a/include/php/Zend/zend_highlight.h b/include/php/Zend/zend_highlight.h new file mode 100644 index 0000000..e54a339 --- /dev/null +++ b/include/php/Zend/zend_highlight.h @@ -0,0 +1,50 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_HIGHLIGHT_H +#define ZEND_HIGHLIGHT_H + +#define HL_COMMENT_COLOR "#FF8000" /* orange */ +#define HL_DEFAULT_COLOR "#0000BB" /* blue */ +#define HL_HTML_COLOR "#000000" /* black */ +#define HL_STRING_COLOR "#DD0000" /* red */ +#define HL_KEYWORD_COLOR "#007700" /* green */ + + +typedef struct _zend_syntax_highlighter_ini { + char *highlight_html; + char *highlight_comment; + char *highlight_default; + char *highlight_string; + char *highlight_keyword; +} zend_syntax_highlighter_ini; + + +BEGIN_EXTERN_C() +ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini); +ZEND_API void zend_strip(void); +ZEND_API zend_result highlight_file(const char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini); +ZEND_API void highlight_string(zend_string *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, const char *str_name); +ZEND_API void zend_html_putc(char c); +ZEND_API void zend_html_puts(const char *s, size_t len); +END_EXTERN_C() + +extern zend_syntax_highlighter_ini syntax_highlighter_ini; + +#endif diff --git a/include/php/Zend/zend_hrtime.h b/include/php/Zend/zend_hrtime.h new file mode 100644 index 0000000..6bba076 --- /dev/null +++ b/include/php/Zend/zend_hrtime.h @@ -0,0 +1,107 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Niklas Keller | + | Author: Anatol Belski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_HRTIME_H +#define ZEND_HRTIME_H + +#include "zend_portability.h" +#include "zend_types.h" + +#ifdef HAVE_UNISTD_H +# include +#endif +#ifndef PHP_WIN32 +# include +#endif + +/* This file reuses code parts from the cross-platform timer library + Public Domain - 2011 Mattias Jansson / Rampant Pixels */ + +#define ZEND_HRTIME_PLATFORM_POSIX 0 +#define ZEND_HRTIME_PLATFORM_WINDOWS 0 +#define ZEND_HRTIME_PLATFORM_APPLE 0 +#define ZEND_HRTIME_PLATFORM_HPUX 0 +#define ZEND_HRTIME_PLATFORM_AIX 0 + +#if defined(_POSIX_TIMERS) && ((_POSIX_TIMERS > 0) || defined(__OpenBSD__)) && defined(_POSIX_MONOTONIC_CLOCK) && defined(CLOCK_MONOTONIC) +# undef ZEND_HRTIME_PLATFORM_POSIX +# define ZEND_HRTIME_PLATFORM_POSIX 1 +#elif defined(_WIN32) || defined(_WIN64) +# undef ZEND_HRTIME_PLATFORM_WINDOWS +# define ZEND_HRTIME_PLATFORM_WINDOWS 1 +#elif defined(__APPLE__) +# undef ZEND_HRTIME_PLATFORM_APPLE +# define ZEND_HRTIME_PLATFORM_APPLE 1 +#elif (defined(__hpux) || defined(hpux)) || ((defined(__sun__) || defined(__sun) || defined(sun)) && (defined(__SVR4) || defined(__svr4__))) +# undef ZEND_HRTIME_PLATFORM_HPUX +# define ZEND_HRTIME_PLATFORM_HPUX 1 +#elif defined(_AIX) +# undef ZEND_HRTIME_PLATFORM_AIX +# define ZEND_HRTIME_PLATFORM_AIX 1 +#endif + +#define ZEND_HRTIME_AVAILABLE (ZEND_HRTIME_PLATFORM_POSIX || ZEND_HRTIME_PLATFORM_WINDOWS || ZEND_HRTIME_PLATFORM_APPLE || ZEND_HRTIME_PLATFORM_HPUX || ZEND_HRTIME_PLATFORM_AIX) + +BEGIN_EXTERN_C() + +#if ZEND_HRTIME_PLATFORM_WINDOWS + +extern double zend_hrtime_timer_scale; + +#elif ZEND_HRTIME_PLATFORM_APPLE + +# include +# include +extern mach_timebase_info_data_t zend_hrtime_timerlib_info; + +#endif + +#define ZEND_NANO_IN_SEC UINT64_C(1000000000) + +typedef uint64_t zend_hrtime_t; + +void zend_startup_hrtime(void); + +static zend_always_inline zend_hrtime_t zend_hrtime(void) +{ +#if ZEND_HRTIME_PLATFORM_WINDOWS + LARGE_INTEGER lt = {0}; + QueryPerformanceCounter(<); + return (zend_hrtime_t)((zend_hrtime_t)lt.QuadPart * zend_hrtime_timer_scale); +#elif ZEND_HRTIME_PLATFORM_APPLE + return (zend_hrtime_t)mach_absolute_time() * zend_hrtime_timerlib_info.numer / zend_hrtime_timerlib_info.denom; +#elif ZEND_HRTIME_PLATFORM_POSIX + struct timespec ts = { .tv_sec = 0, .tv_nsec = 0 }; + if (EXPECTED(0 == clock_gettime(CLOCK_MONOTONIC, &ts))) { + return ((zend_hrtime_t) ts.tv_sec * (zend_hrtime_t)ZEND_NANO_IN_SEC) + ts.tv_nsec; + } + return 0; +#elif ZEND_HRTIME_PLATFORM_HPUX + return (zend_hrtime_t) gethrtime(); +#elif ZEND_HRTIME_PLATFORM_AIX + timebasestruct_t t; + read_wall_time(&t, TIMEBASE_SZ); + time_base_to_time(&t, TIMEBASE_SZ); + return (zend_hrtime_t) t.tb_high * (zend_hrtime_t)NANO_IN_SEC + t.tb_low; +#else + return 0; +#endif +} + +END_EXTERN_C() + +#endif /* ZEND_HRTIME_H */ diff --git a/include/php/Zend/zend_inheritance.h b/include/php/Zend/zend_inheritance.h new file mode 100644 index 0000000..96ead3b --- /dev/null +++ b/include/php/Zend/zend_inheritance.h @@ -0,0 +1,47 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_INHERITANCE_H +#define ZEND_INHERITANCE_H + +#include "zend.h" + +BEGIN_EXTERN_C() + +ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface); +ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, bool checked); + +static zend_always_inline void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce) { + zend_do_inheritance_ex(ce, parent_ce, 0); +} + +ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_name, zend_string *key); + +void zend_verify_abstract_class(zend_class_entry *ce); +void zend_build_properties_info_table(zend_class_entry *ce); +ZEND_API zend_class_entry *zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding); + +void zend_inheritance_check_override(zend_class_entry *ce); + +ZEND_API extern zend_class_entry* (*zend_inheritance_cache_get)(zend_class_entry *ce, zend_class_entry *parent, zend_class_entry **traits_and_interfaces); +ZEND_API extern zend_class_entry* (*zend_inheritance_cache_add)(zend_class_entry *ce, zend_class_entry *proto, zend_class_entry *parent, zend_class_entry **traits_and_interfaces, HashTable *dependencies); + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_ini.h b/include/php/Zend/zend_ini.h new file mode 100644 index 0000000..6ca5658 --- /dev/null +++ b/include/php/Zend/zend_ini.h @@ -0,0 +1,259 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Author: Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_INI_H +#define ZEND_INI_H + +#define ZEND_INI_USER (1<<0) +#define ZEND_INI_PERDIR (1<<1) +#define ZEND_INI_SYSTEM (1<<2) + +#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM) + +#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage) +#define ZEND_INI_DISP(name) ZEND_COLD void name(zend_ini_entry *ini_entry, int type) + +typedef struct _zend_ini_entry_def { + const char *name; + ZEND_INI_MH((*on_modify)); + void *mh_arg1; + void *mh_arg2; + void *mh_arg3; + const char *value; + void (*displayer)(zend_ini_entry *ini_entry, int type); + + uint32_t value_length; + uint16_t name_length; + uint8_t modifiable; +} zend_ini_entry_def; + +struct _zend_ini_entry { + zend_string *name; + ZEND_INI_MH((*on_modify)); + void *mh_arg1; + void *mh_arg2; + void *mh_arg3; + zend_string *value; + zend_string *orig_value; + void (*displayer)(zend_ini_entry *ini_entry, int type); + + int module_number; + + uint8_t modifiable; + uint8_t orig_modifiable; + uint8_t modified; + +}; + +BEGIN_EXTERN_C() +ZEND_API void zend_ini_startup(void); +ZEND_API void zend_ini_shutdown(void); +ZEND_API void zend_ini_global_shutdown(void); +ZEND_API void zend_ini_deactivate(void); +ZEND_API void zend_ini_dtor(HashTable *ini_directives); + +ZEND_API void zend_copy_ini_directives(void); + +ZEND_API void zend_ini_sort_entries(void); + +ZEND_API zend_result zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int module_number); +ZEND_API zend_result zend_register_ini_entries_ex(const zend_ini_entry_def *ini_entry, int module_number, int module_type); +ZEND_API void zend_unregister_ini_entries(int module_number); +ZEND_API void zend_unregister_ini_entries_ex(int module_number, int module_type); +ZEND_API void zend_ini_refresh_caches(int stage); +ZEND_API zend_result zend_alter_ini_entry(zend_string *name, zend_string *new_value, int modify_type, int stage); +ZEND_API zend_result zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value, int modify_type, int stage, bool force_change); +ZEND_API zend_result zend_alter_ini_entry_chars(zend_string *name, const char *value, size_t value_length, int modify_type, int stage); +ZEND_API zend_result zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change); +ZEND_API zend_result zend_restore_ini_entry(zend_string *name, int stage); +ZEND_API void display_ini_entries(zend_module_entry *module); + +ZEND_API zend_long zend_ini_long(const char *name, size_t name_length, int orig); +ZEND_API double zend_ini_double(const char *name, size_t name_length, int orig); +ZEND_API char *zend_ini_string(const char *name, size_t name_length, int orig); +ZEND_API char *zend_ini_string_ex(const char *name, size_t name_length, int orig, bool *exists); +ZEND_API zend_string *zend_ini_str(const char *name, size_t name_length, bool orig); +ZEND_API zend_string *zend_ini_str_ex(const char *name, size_t name_length, bool orig, bool *exists); +ZEND_API zend_string *zend_ini_get_value(zend_string *name); +ZEND_API bool zend_ini_parse_bool(zend_string *str); + +/** + * Parses an ini quantity + * + * The value parameter must be a string in the form + * + * sign? digits ws* multiplier? + * + * with + * + * sign: [+-] + * digit: [0-9] + * digits: digit+ + * ws: [ \t\n\r\v\f] + * multiplier: [KMG] + * + * Leading and trailing whitespaces are ignored. + * + * If the string is empty or consists only of only whitespaces, 0 is returned. + * + * Digits is parsed as decimal unless the first digit is '0', in which case + * digits is parsed as octal. + * + * The multiplier is case-insensitive. K, M, and G multiply the quantity by + * 2**10, 2**20, and 2**30, respectively. + * + * For backwards compatibility, ill-formatted values are handled as follows: + * - No leading digits: value is treated as '0' + * - Invalid multiplier: multiplier is ignored + * - Invalid characters between digits and multiplier: invalid characters are + * ignored + * - Integer overflow: The result of the overflow is returned + * + * In any of these cases an error string is stored in *errstr (caller must + * release it), otherwise *errstr is set to NULL. + */ +ZEND_API zend_long zend_ini_parse_quantity(zend_string *value, zend_string **errstr); + +/** + * Unsigned variant of zend_ini_parse_quantity + */ +ZEND_API zend_ulong zend_ini_parse_uquantity(zend_string *value, zend_string **errstr); + +ZEND_API zend_long zend_ini_parse_quantity_warn(zend_string *value, zend_string *setting); + +ZEND_API zend_ulong zend_ini_parse_uquantity_warn(zend_string *value, zend_string *setting); + +ZEND_API zend_result zend_ini_register_displayer(const char *name, uint32_t name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)); + +ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb); +ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb); +ZEND_API ZEND_INI_DISP(display_link_numbers); +END_EXTERN_C() + +#define ZEND_INI_BEGIN() static const zend_ini_entry_def ini_entries[] = { +#define ZEND_INI_END() { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} }; + +#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \ + { name, on_modify, arg1, arg2, arg3, default_value, displayer, sizeof(default_value)-1, sizeof(name)-1, modifiable }, + +#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \ + ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL) + +#define ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, displayer) \ + ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL, displayer) + +#define ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, arg1, arg2) \ + ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL) + +#define ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, displayer) \ + ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, NULL, NULL, displayer) + +#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1) \ + ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL) + +#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer) \ + ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer) + +#define ZEND_INI_ENTRY(name, default_value, modifiable, on_modify) \ + ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, NULL) + +#ifdef ZTS +#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ + ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id) +#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \ + ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer) +#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ + ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb) +#else +#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ + ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr) +#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \ + ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer) +#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ + ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb) +#endif + +#define INI_INT(name) zend_ini_long((name), strlen(name), 0) +#define INI_FLT(name) zend_ini_double((name), strlen(name), 0) +#define INI_STR(name) zend_ini_string_ex((name), strlen(name), 0, NULL) +#define INI_BOOL(name) ((bool) INI_INT(name)) + +#define INI_ORIG_INT(name) zend_ini_long((name), strlen(name), 1) +#define INI_ORIG_FLT(name) zend_ini_double((name), strlen(name), 1) +#define INI_ORIG_STR(name) zend_ini_string((name), strlen(name), 1) +#define INI_ORIG_BOOL(name) ((bool) INI_ORIG_INT(name)) + +#define REGISTER_INI_ENTRIES() zend_register_ini_entries_ex(ini_entries, module_number, type) +#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries_ex(module_number, type) +#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module) + +#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), strlen(name), displayer) +#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb) + +/* Standard message handlers */ +BEGIN_EXTERN_C() +ZEND_API ZEND_INI_MH(OnUpdateBool); +ZEND_API ZEND_INI_MH(OnUpdateLong); +ZEND_API ZEND_INI_MH(OnUpdateLongGEZero); +ZEND_API ZEND_INI_MH(OnUpdateReal); +/* char* versions */ +ZEND_API ZEND_INI_MH(OnUpdateString); +ZEND_API ZEND_INI_MH(OnUpdateStringUnempty); +/* zend_string* versions */ +ZEND_API ZEND_INI_MH(OnUpdateStr); +ZEND_API ZEND_INI_MH(OnUpdateStrNotEmpty); +END_EXTERN_C() + +#define ZEND_INI_DISPLAY_ORIG 1 +#define ZEND_INI_DISPLAY_ACTIVE 2 + +#define ZEND_INI_STAGE_STARTUP (1<<0) +#define ZEND_INI_STAGE_SHUTDOWN (1<<1) +#define ZEND_INI_STAGE_ACTIVATE (1<<2) +#define ZEND_INI_STAGE_DEACTIVATE (1<<3) +#define ZEND_INI_STAGE_RUNTIME (1<<4) +#define ZEND_INI_STAGE_HTACCESS (1<<5) + +#define ZEND_INI_STAGE_IN_REQUEST (ZEND_INI_STAGE_ACTIVATE|ZEND_INI_STAGE_DEACTIVATE|ZEND_INI_STAGE_RUNTIME|ZEND_INI_STAGE_HTACCESS) + +/* INI parsing engine */ +typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg); +BEGIN_EXTERN_C() +ZEND_API zend_result zend_parse_ini_file(zend_file_handle *fh, bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg); +ZEND_API zend_result zend_parse_ini_string(const char *str, bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg); +END_EXTERN_C() + +/* INI entries */ +#define ZEND_INI_PARSER_ENTRY 1 /* Normal entry: foo = bar */ +#define ZEND_INI_PARSER_SECTION 2 /* Section: [foobar] */ +#define ZEND_INI_PARSER_POP_ENTRY 3 /* Offset entry: foo[] = bar */ + +typedef struct _zend_ini_parser_param { + zend_ini_parser_cb_t ini_parser_cb; + void *arg; +} zend_ini_parser_param; + +#ifndef ZTS +# define ZEND_INI_GET_BASE() ((char *) mh_arg2) +#else +# define ZEND_INI_GET_BASE() ((char *) ts_resource(*((int *) mh_arg2))) +#endif + +#define ZEND_INI_GET_ADDR() (ZEND_INI_GET_BASE() + (size_t) mh_arg1) + +#endif /* ZEND_INI_H */ diff --git a/include/php/Zend/zend_ini_parser.h b/include/php/Zend/zend_ini_parser.h new file mode 100644 index 0000000..de8a178 --- /dev/null +++ b/include/php/Zend/zend_ini_parser.h @@ -0,0 +1,98 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_INI_MNT_C_USERS_WRENG_PHP_SRC_ZEND_ZEND_INI_PARSER_H_INCLUDED +# define YY_INI_MNT_C_USERS_WRENG_PHP_SRC_ZEND_ZEND_INI_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef INI_DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define INI_DEBUG 1 +# else +# define INI_DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define INI_DEBUG 0 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined INI_DEBUG */ +#if INI_DEBUG +extern int ini_debug; +#endif + +/* Token kinds. */ +#ifndef INI_TOKENTYPE +# define INI_TOKENTYPE + enum ini_tokentype + { + INI_EMPTY = -2, + END = 0, /* "end of file" */ + INI_error = 256, /* error */ + INI_UNDEF = 257, /* "invalid token" */ + TC_SECTION = 258, /* TC_SECTION */ + TC_RAW = 259, /* TC_RAW */ + TC_CONSTANT = 260, /* TC_CONSTANT */ + TC_NUMBER = 261, /* TC_NUMBER */ + TC_STRING = 262, /* TC_STRING */ + TC_WHITESPACE = 263, /* TC_WHITESPACE */ + TC_LABEL = 264, /* TC_LABEL */ + TC_OFFSET = 265, /* TC_OFFSET */ + TC_DOLLAR_CURLY = 266, /* TC_DOLLAR_CURLY */ + TC_VARNAME = 267, /* TC_VARNAME */ + TC_QUOTED_STRING = 268, /* TC_QUOTED_STRING */ + TC_FALLBACK = 269, /* TC_FALLBACK */ + BOOL_TRUE = 270, /* BOOL_TRUE */ + BOOL_FALSE = 271, /* BOOL_FALSE */ + NULL_NULL = 272, /* NULL_NULL */ + END_OF_LINE = 273 /* END_OF_LINE */ + }; + typedef enum ini_tokentype ini_token_kind_t; +#endif + +/* Value type. */ +#if ! defined INI_STYPE && ! defined INI_STYPE_IS_DECLARED +typedef zval INI_STYPE; +# define INI_STYPE_IS_TRIVIAL 1 +# define INI_STYPE_IS_DECLARED 1 +#endif + + + + +int ini_parse (void); + + +#endif /* !YY_INI_MNT_C_USERS_WRENG_PHP_SRC_ZEND_ZEND_INI_PARSER_H_INCLUDED */ diff --git a/include/php/Zend/zend_ini_scanner.h b/include/php/Zend/zend_ini_scanner.h new file mode 100644 index 0000000..f0cfac2 --- /dev/null +++ b/include/php/Zend/zend_ini_scanner.h @@ -0,0 +1,37 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef _ZEND_INI_SCANNER_H +#define _ZEND_INI_SCANNER_H + +/* Scanner modes */ +#define ZEND_INI_SCANNER_NORMAL 0 /* Normal mode. [DEFAULT] */ +#define ZEND_INI_SCANNER_RAW 1 /* Raw mode. Option values are not parsed */ +#define ZEND_INI_SCANNER_TYPED 2 /* Typed mode. */ + +BEGIN_EXTERN_C() +ZEND_COLD int zend_ini_scanner_get_lineno(void); +ZEND_COLD const char *zend_ini_scanner_get_filename(void); +zend_result zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode); +zend_result zend_ini_prepare_string_for_scanning(const char *str, int scanner_mode); +int ini_lex(zval *ini_lval); +void shutdown_ini_scanner(void); +END_EXTERN_C() + +#endif /* _ZEND_INI_SCANNER_H */ diff --git a/include/php/Zend/zend_ini_scanner_defs.h b/include/php/Zend/zend_ini_scanner_defs.h new file mode 100644 index 0000000..528b34b --- /dev/null +++ b/include/php/Zend/zend_ini_scanner_defs.h @@ -0,0 +1,13 @@ +/* Generated by re2c 2.1.1 */ + +enum YYCONDTYPE { + yycINITIAL, + yycST_OFFSET, + yycST_SECTION_VALUE, + yycST_VALUE, + yycST_SECTION_RAW, + yycST_DOUBLE_QUOTES, + yycST_VAR_FALLBACK, + yycST_VARNAME, + yycST_RAW, +}; diff --git a/include/php/Zend/zend_interfaces.h b/include/php/Zend/zend_interfaces.h new file mode 100644 index 0000000..883e482 --- /dev/null +++ b/include/php/Zend/zend_interfaces.h @@ -0,0 +1,81 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_INTERFACES_H +#define ZEND_INTERFACES_H + +#include "zend.h" +#include "zend_API.h" + +BEGIN_EXTERN_C() + +extern ZEND_API zend_class_entry *zend_ce_traversable; +extern ZEND_API zend_class_entry *zend_ce_aggregate; +extern ZEND_API zend_class_entry *zend_ce_iterator; +extern ZEND_API zend_class_entry *zend_ce_arrayaccess; +extern ZEND_API zend_class_entry *zend_ce_serializable; +extern ZEND_API zend_class_entry *zend_ce_countable; +extern ZEND_API zend_class_entry *zend_ce_stringable; + +typedef struct _zend_user_iterator { + zend_object_iterator it; + zend_class_entry *ce; + zval value; +} zend_user_iterator; + +ZEND_API zval* zend_call_method(zend_object *object, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval, uint32_t param_count, zval* arg1, zval* arg2); + +static zend_always_inline zval* zend_call_method_with_0_params(zend_object *object, zend_class_entry *obj_ce, + zend_function **fn_proxy, const char *function_name, zval *retval) +{ + return zend_call_method(object, obj_ce, fn_proxy, function_name, strlen(function_name), retval, 0, NULL, NULL); +} + +static zend_always_inline zval* zend_call_method_with_1_params(zend_object *object, zend_class_entry *obj_ce, + zend_function **fn_proxy, const char *function_name, zval *retval, zval* arg1) +{ + return zend_call_method(object, obj_ce, fn_proxy, function_name, strlen(function_name), retval, 1, arg1, NULL); +} + +static zend_always_inline zval* zend_call_method_with_2_params(zend_object *object, zend_class_entry *obj_ce, + zend_function **fn_proxy, const char *function_name, zval *retval, zval* arg1, zval* arg2) +{ + return zend_call_method(object, obj_ce, fn_proxy, function_name, strlen(function_name), retval, 2, arg1, arg2); +} + +ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter); +ZEND_API zend_result zend_user_it_valid(zend_object_iterator *_iter); +ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key); +ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter); +ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter); +ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter); +ZEND_API HashTable *zend_user_it_get_gc(zend_object_iterator *_iter, zval **table, int *n); + +ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *iterator); +ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref); + +ZEND_API void zend_register_interfaces(void); + +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data); +ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data); + +ZEND_API zend_result zend_create_internal_iterator_zval(zval *return_value, zval *obj); + +END_EXTERN_C() + +#endif /* ZEND_INTERFACES_H */ diff --git a/include/php/Zend/zend_interfaces_arginfo.h b/include/php/Zend/zend_interfaces_arginfo.h new file mode 100644 index 0000000..8937d67 --- /dev/null +++ b/include/php/Zend/zend_interfaces_arginfo.h @@ -0,0 +1,215 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: a9c915c11e5989d8c7cf2d704ada09ca765670c3 */ + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_IteratorAggregate_getIterator, 0, 0, Traversable, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Iterator_current, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Iterator_next, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Iterator_key arginfo_class_Iterator_current + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Iterator_valid, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Iterator_rewind arginfo_class_Iterator_next + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ArrayAccess_offsetExists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ArrayAccess_offsetGet, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ArrayAccess_offsetSet, 0, 2, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ArrayAccess_offsetUnset, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Serializable_serialize, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Serializable_unserialize, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Countable_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Stringable___toString, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_InternalIterator___construct arginfo_class_Serializable_serialize + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_InternalIterator_current, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_InternalIterator_key arginfo_class_InternalIterator_current + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_InternalIterator_next, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_InternalIterator_valid, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_InternalIterator_rewind arginfo_class_InternalIterator_next + + +ZEND_METHOD(InternalIterator, __construct); +ZEND_METHOD(InternalIterator, current); +ZEND_METHOD(InternalIterator, key); +ZEND_METHOD(InternalIterator, next); +ZEND_METHOD(InternalIterator, valid); +ZEND_METHOD(InternalIterator, rewind); + + +static const zend_function_entry class_Traversable_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_IteratorAggregate_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(IteratorAggregate, getIterator, arginfo_class_IteratorAggregate_getIterator, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + + +static const zend_function_entry class_Iterator_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, current, arginfo_class_Iterator_current, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, next, arginfo_class_Iterator_next, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, key, arginfo_class_Iterator_key, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, valid, arginfo_class_Iterator_valid, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, rewind, arginfo_class_Iterator_rewind, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + + +static const zend_function_entry class_ArrayAccess_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(ArrayAccess, offsetExists, arginfo_class_ArrayAccess_offsetExists, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(ArrayAccess, offsetGet, arginfo_class_ArrayAccess_offsetGet, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(ArrayAccess, offsetSet, arginfo_class_ArrayAccess_offsetSet, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(ArrayAccess, offsetUnset, arginfo_class_ArrayAccess_offsetUnset, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + + +static const zend_function_entry class_Serializable_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(Serializable, serialize, arginfo_class_Serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_ABSTRACT_ME_WITH_FLAGS(Serializable, unserialize, arginfo_class_Serializable_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + + +static const zend_function_entry class_Countable_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(Countable, count, arginfo_class_Countable_count, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + + +static const zend_function_entry class_Stringable_methods[] = { + ZEND_ABSTRACT_ME_WITH_FLAGS(Stringable, __toString, arginfo_class_Stringable___toString, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT) + ZEND_FE_END +}; + + +static const zend_function_entry class_InternalIterator_methods[] = { + ZEND_ME(InternalIterator, __construct, arginfo_class_InternalIterator___construct, ZEND_ACC_PRIVATE) + ZEND_ME(InternalIterator, current, arginfo_class_InternalIterator_current, ZEND_ACC_PUBLIC) + ZEND_ME(InternalIterator, key, arginfo_class_InternalIterator_key, ZEND_ACC_PUBLIC) + ZEND_ME(InternalIterator, next, arginfo_class_InternalIterator_next, ZEND_ACC_PUBLIC) + ZEND_ME(InternalIterator, valid, arginfo_class_InternalIterator_valid, ZEND_ACC_PUBLIC) + ZEND_ME(InternalIterator, rewind, arginfo_class_InternalIterator_rewind, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static zend_class_entry *register_class_Traversable(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Traversable", class_Traversable_methods); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + +static zend_class_entry *register_class_IteratorAggregate(zend_class_entry *class_entry_Traversable) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "IteratorAggregate", class_IteratorAggregate_methods); + class_entry = zend_register_internal_interface(&ce); + zend_class_implements(class_entry, 1, class_entry_Traversable); + + return class_entry; +} + +static zend_class_entry *register_class_Iterator(zend_class_entry *class_entry_Traversable) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Iterator", class_Iterator_methods); + class_entry = zend_register_internal_interface(&ce); + zend_class_implements(class_entry, 1, class_entry_Traversable); + + return class_entry; +} + +static zend_class_entry *register_class_ArrayAccess(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ArrayAccess", class_ArrayAccess_methods); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + +static zend_class_entry *register_class_Serializable(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Serializable", class_Serializable_methods); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + +static zend_class_entry *register_class_Countable(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Countable", class_Countable_methods); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + +static zend_class_entry *register_class_Stringable(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Stringable", class_Stringable_methods); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + +static zend_class_entry *register_class_InternalIterator(zend_class_entry *class_entry_Iterator) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "InternalIterator", class_InternalIterator_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; + zend_class_implements(class_entry, 1, class_entry_Iterator); + + return class_entry; +} diff --git a/include/php/Zend/zend_istdiostream.h b/include/php/Zend/zend_istdiostream.h new file mode 100644 index 0000000..74470d2 --- /dev/null +++ b/include/php/Zend/zend_istdiostream.h @@ -0,0 +1,34 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef _ZEND_STDIOSTREAM +#define _ZEND_STDIOSTREAM + +#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM) +class istdiostream : public istream +{ +private: + stdiobuf _file; +public: + istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); } + stdiobuf* rdbuf()/* const */ { return &_file; } +}; +#endif + +#endif diff --git a/include/php/Zend/zend_iterators.h b/include/php/Zend/zend_iterators.h new file mode 100644 index 0000000..5e7451f --- /dev/null +++ b/include/php/Zend/zend_iterators.h @@ -0,0 +1,91 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + | Marcus Boerger | + +----------------------------------------------------------------------+ +*/ + +/* These iterators were designed to operate within the foreach() + * structures provided by the engine, but could be extended for use + * with other iterative engine opcodes. + * These methods have similar semantics to the zend_hash API functions + * with similar names. + * */ + +typedef struct _zend_object_iterator zend_object_iterator; + +typedef struct _zend_object_iterator_funcs { + /* release all resources associated with this iterator instance */ + void (*dtor)(zend_object_iterator *iter); + + /* check for end of iteration (FAILURE or SUCCESS if data is valid) */ + int (*valid)(zend_object_iterator *iter); + + /* fetch the item data for the current element */ + zval *(*get_current_data)(zend_object_iterator *iter); + + /* fetch the key for the current element (optional, may be NULL). The key + * should be written into the provided zval* using the ZVAL_* macros. If + * this handler is not provided auto-incrementing integer keys will be + * used. */ + void (*get_current_key)(zend_object_iterator *iter, zval *key); + + /* step forwards to next element */ + void (*move_forward)(zend_object_iterator *iter); + + /* rewind to start of data (optional, may be NULL) */ + void (*rewind)(zend_object_iterator *iter); + + /* invalidate current value/key (optional, may be NULL) */ + void (*invalidate_current)(zend_object_iterator *iter); + + /* Expose owned values to GC. + * This has the same semantics as the corresponding object handler. */ + HashTable *(*get_gc)(zend_object_iterator *iter, zval **table, int *n); +} zend_object_iterator_funcs; + +struct _zend_object_iterator { + zend_object std; + zval data; + const zend_object_iterator_funcs *funcs; + zend_ulong index; /* private to fe_reset/fe_fetch opcodes */ +}; + +typedef struct _zend_class_iterator_funcs { + zend_function *zf_new_iterator; + zend_function *zf_valid; + zend_function *zf_current; + zend_function *zf_key; + zend_function *zf_next; + zend_function *zf_rewind; +} zend_class_iterator_funcs; + +typedef struct _zend_class_arrayaccess_funcs { + zend_function *zf_offsetget; + zend_function *zf_offsetexists; + zend_function *zf_offsetset; + zend_function *zf_offsetunset; +} zend_class_arrayaccess_funcs; + +BEGIN_EXTERN_C() +/* given a zval, returns stuff that can be used to iterate it. */ +ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr); + +/* given an iterator, wrap it up as a zval for use by the engine opcodes */ +ZEND_API void zend_iterator_init(zend_object_iterator *iter); +ZEND_API void zend_iterator_dtor(zend_object_iterator *iter); + +ZEND_API void zend_register_iterator_wrapper(void); +END_EXTERN_C() diff --git a/include/php/Zend/zend_language_parser.h b/include/php/Zend/zend_language_parser.h new file mode 100644 index 0000000..6a11c70 --- /dev/null +++ b/include/php/Zend/zend_language_parser.h @@ -0,0 +1,237 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_ZEND_MNT_C_USERS_WRENG_PHP_SRC_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED +# define YY_ZEND_MNT_C_USERS_WRENG_PHP_SRC_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef ZENDDEBUG +# if defined YYDEBUG +#if YYDEBUG +# define ZENDDEBUG 1 +# else +# define ZENDDEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define ZENDDEBUG 0 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined ZENDDEBUG */ +#if ZENDDEBUG +extern int zenddebug; +#endif +/* "%code requires" blocks. */ +#line 41 "/mnt/c/Users/wreng/php-src/Zend/zend_language_parser.y" + +#include "zend_compile.h" + +#line 61 "/mnt/c/Users/wreng/php-src/Zend/zend_language_parser.h" + +/* Token kinds. */ +#ifndef ZENDTOKENTYPE +# define ZENDTOKENTYPE + enum zendtokentype + { + ZENDEMPTY = -2, + END = 0, /* "end of file" */ + ZENDerror = 256, /* error */ + ZENDUNDEF = 257, /* "invalid token" */ + PREC_ARROW_FUNCTION = 258, /* PREC_ARROW_FUNCTION */ + T_NOELSE = 259, /* T_NOELSE */ + T_LNUMBER = 260, /* "integer" */ + T_DNUMBER = 261, /* "floating-point number" */ + T_STRING = 262, /* "identifier" */ + T_NAME_FULLY_QUALIFIED = 263, /* "fully qualified name" */ + T_NAME_RELATIVE = 264, /* "namespace-relative name" */ + T_NAME_QUALIFIED = 265, /* "namespaced name" */ + T_VARIABLE = 266, /* "variable" */ + T_INLINE_HTML = 267, /* T_INLINE_HTML */ + T_ENCAPSED_AND_WHITESPACE = 268, /* "string content" */ + T_CONSTANT_ENCAPSED_STRING = 269, /* "quoted string" */ + T_STRING_VARNAME = 270, /* "variable name" */ + T_NUM_STRING = 271, /* "number" */ + T_INCLUDE = 272, /* "'include'" */ + T_INCLUDE_ONCE = 273, /* "'include_once'" */ + T_EVAL = 274, /* "'eval'" */ + T_REQUIRE = 275, /* "'require'" */ + T_REQUIRE_ONCE = 276, /* "'require_once'" */ + T_LOGICAL_OR = 277, /* "'or'" */ + T_LOGICAL_XOR = 278, /* "'xor'" */ + T_LOGICAL_AND = 279, /* "'and'" */ + T_PRINT = 280, /* "'print'" */ + T_YIELD = 281, /* "'yield'" */ + T_YIELD_FROM = 282, /* "'yield from'" */ + T_INSTANCEOF = 283, /* "'instanceof'" */ + T_NEW = 284, /* "'new'" */ + T_CLONE = 285, /* "'clone'" */ + T_EXIT = 286, /* "'exit'" */ + T_IF = 287, /* "'if'" */ + T_ELSEIF = 288, /* "'elseif'" */ + T_ELSE = 289, /* "'else'" */ + T_ENDIF = 290, /* "'endif'" */ + T_ECHO = 291, /* "'echo'" */ + T_DO = 292, /* "'do'" */ + T_WHILE = 293, /* "'while'" */ + T_ENDWHILE = 294, /* "'endwhile'" */ + T_FOR = 295, /* "'for'" */ + T_ENDFOR = 296, /* "'endfor'" */ + T_FOREACH = 297, /* "'foreach'" */ + T_ENDFOREACH = 298, /* "'endforeach'" */ + T_DECLARE = 299, /* "'declare'" */ + T_ENDDECLARE = 300, /* "'enddeclare'" */ + T_AS = 301, /* "'as'" */ + T_SWITCH = 302, /* "'switch'" */ + T_ENDSWITCH = 303, /* "'endswitch'" */ + T_CASE = 304, /* "'case'" */ + T_DEFAULT = 305, /* "'default'" */ + T_MATCH = 306, /* "'match'" */ + T_BREAK = 307, /* "'break'" */ + T_CONTINUE = 308, /* "'continue'" */ + T_GOTO = 309, /* "'goto'" */ + T_FUNCTION = 310, /* "'function'" */ + T_FN = 311, /* "'fn'" */ + T_CONST = 312, /* "'const'" */ + T_RETURN = 313, /* "'return'" */ + T_TRY = 314, /* "'try'" */ + T_CATCH = 315, /* "'catch'" */ + T_FINALLY = 316, /* "'finally'" */ + T_THROW = 317, /* "'throw'" */ + T_USE = 318, /* "'use'" */ + T_INSTEADOF = 319, /* "'insteadof'" */ + T_GLOBAL = 320, /* "'global'" */ + T_STATIC = 321, /* "'static'" */ + T_ABSTRACT = 322, /* "'abstract'" */ + T_FINAL = 323, /* "'final'" */ + T_PRIVATE = 324, /* "'private'" */ + T_PROTECTED = 325, /* "'protected'" */ + T_PUBLIC = 326, /* "'public'" */ + T_READONLY = 327, /* "'readonly'" */ + T_VAR = 328, /* "'var'" */ + T_UNSET = 329, /* "'unset'" */ + T_ISSET = 330, /* "'isset'" */ + T_EMPTY = 331, /* "'empty'" */ + T_HALT_COMPILER = 332, /* "'__halt_compiler'" */ + T_CLASS = 333, /* "'class'" */ + T_TRAIT = 334, /* "'trait'" */ + T_INTERFACE = 335, /* "'interface'" */ + T_ENUM = 336, /* "'enum'" */ + T_EXTENDS = 337, /* "'extends'" */ + T_IMPLEMENTS = 338, /* "'implements'" */ + T_NAMESPACE = 339, /* "'namespace'" */ + T_LIST = 340, /* "'list'" */ + T_ARRAY = 341, /* "'array'" */ + T_CALLABLE = 342, /* "'callable'" */ + T_LINE = 343, /* "'__LINE__'" */ + T_FILE = 344, /* "'__FILE__'" */ + T_DIR = 345, /* "'__DIR__'" */ + T_CLASS_C = 346, /* "'__CLASS__'" */ + T_TRAIT_C = 347, /* "'__TRAIT__'" */ + T_METHOD_C = 348, /* "'__METHOD__'" */ + T_FUNC_C = 349, /* "'__FUNCTION__'" */ + T_NS_C = 350, /* "'__NAMESPACE__'" */ + T_ATTRIBUTE = 351, /* "'#['" */ + T_PLUS_EQUAL = 352, /* "'+='" */ + T_MINUS_EQUAL = 353, /* "'-='" */ + T_MUL_EQUAL = 354, /* "'*='" */ + T_DIV_EQUAL = 355, /* "'/='" */ + T_CONCAT_EQUAL = 356, /* "'.='" */ + T_MOD_EQUAL = 357, /* "'%='" */ + T_AND_EQUAL = 358, /* "'&='" */ + T_OR_EQUAL = 359, /* "'|='" */ + T_XOR_EQUAL = 360, /* "'^='" */ + T_SL_EQUAL = 361, /* "'<<='" */ + T_SR_EQUAL = 362, /* "'>>='" */ + T_COALESCE_EQUAL = 363, /* "'??='" */ + T_BOOLEAN_OR = 364, /* "'||'" */ + T_BOOLEAN_AND = 365, /* "'&&'" */ + T_IS_EQUAL = 366, /* "'=='" */ + T_IS_NOT_EQUAL = 367, /* "'!='" */ + T_IS_IDENTICAL = 368, /* "'==='" */ + T_IS_NOT_IDENTICAL = 369, /* "'!=='" */ + T_IS_SMALLER_OR_EQUAL = 370, /* "'<='" */ + T_IS_GREATER_OR_EQUAL = 371, /* "'>='" */ + T_SPACESHIP = 372, /* "'<=>'" */ + T_SL = 373, /* "'<<'" */ + T_SR = 374, /* "'>>'" */ + T_INC = 375, /* "'++'" */ + T_DEC = 376, /* "'--'" */ + T_INT_CAST = 377, /* "'(int)'" */ + T_DOUBLE_CAST = 378, /* "'(double)'" */ + T_STRING_CAST = 379, /* "'(string)'" */ + T_ARRAY_CAST = 380, /* "'(array)'" */ + T_OBJECT_CAST = 381, /* "'(object)'" */ + T_BOOL_CAST = 382, /* "'(bool)'" */ + T_UNSET_CAST = 383, /* "'(unset)'" */ + T_OBJECT_OPERATOR = 384, /* "'->'" */ + T_NULLSAFE_OBJECT_OPERATOR = 385, /* "'?->'" */ + T_DOUBLE_ARROW = 386, /* "'=>'" */ + T_COMMENT = 387, /* "comment" */ + T_DOC_COMMENT = 388, /* "doc comment" */ + T_OPEN_TAG = 389, /* "open tag" */ + T_OPEN_TAG_WITH_ECHO = 390, /* "''" */ + T_WHITESPACE = 392, /* "whitespace" */ + T_START_HEREDOC = 393, /* "heredoc start" */ + T_END_HEREDOC = 394, /* "heredoc end" */ + T_DOLLAR_OPEN_CURLY_BRACES = 395, /* "'${'" */ + T_CURLY_OPEN = 396, /* "'{$'" */ + T_PAAMAYIM_NEKUDOTAYIM = 397, /* "'::'" */ + T_NS_SEPARATOR = 398, /* "'\\'" */ + T_ELLIPSIS = 399, /* "'...'" */ + T_COALESCE = 400, /* "'??'" */ + T_POW = 401, /* "'**'" */ + T_POW_EQUAL = 402, /* "'**='" */ + T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 403, /* "'&'" */ + T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 404, /* "amp" */ + T_BAD_CHARACTER = 405, /* "invalid character" */ + T_ERROR = 406 /* T_ERROR */ + }; + typedef enum zendtokentype zendtoken_kind_t; +#endif + +/* Value type. */ +#if ! defined ZENDSTYPE && ! defined ZENDSTYPE_IS_DECLARED +typedef zend_parser_stack_elem ZENDSTYPE; +# define ZENDSTYPE_IS_TRIVIAL 1 +# define ZENDSTYPE_IS_DECLARED 1 +#endif + + + + +ZEND_API int zendparse (void); + + +#endif /* !YY_ZEND_MNT_C_USERS_WRENG_PHP_SRC_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED */ diff --git a/include/php/Zend/zend_language_scanner.h b/include/php/Zend/zend_language_scanner.h new file mode 100644 index 0000000..ca32329 --- /dev/null +++ b/include/php/Zend/zend_language_scanner.h @@ -0,0 +1,85 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_SCANNER_H +#define ZEND_SCANNER_H + +typedef struct _zend_lex_state { + 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; + zend_ptr_stack heredoc_label_stack; + zend_stack nest_location_stack; /* for syntax error reporting */ + + zend_file_handle *in; + uint32_t lineno; + zend_string *filename; + + /* original (unfiltered) script */ + unsigned char *script_org; + size_t script_org_size; + + /* filtered script */ + unsigned char *script_filtered; + size_t script_filtered_size; + + /* input/output filters */ + zend_encoding_filter input_filter; + zend_encoding_filter output_filter; + const zend_encoding *script_encoding; + + /* hooks */ + void (*on_event)( + zend_php_scanner_event event, int token, int line, + const char *text, size_t length, void *context); + void *on_event_context; + + zend_ast *ast; + zend_arena *ast_arena; +} zend_lex_state; + +typedef struct _zend_heredoc_label { + char *label; + int length; + int indentation; + bool indentation_uses_spaces; +} zend_heredoc_label; + +/* Track locations of unclosed {, [, (, etc. for better syntax error reporting */ +typedef struct _zend_nest_location { + char text; + int lineno; +} zend_nest_location; + +BEGIN_EXTERN_C() +ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state); +ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state); +ZEND_API void zend_prepare_string_for_scanning(zval *str, zend_string *filename); +ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding); +ZEND_API zend_result zend_multibyte_set_filter(const zend_encoding *onetime_encoding); +ZEND_API zend_result zend_lex_tstring(zval *zv, unsigned char *ident); + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_language_scanner_defs.h b/include/php/Zend/zend_language_scanner_defs.h new file mode 100644 index 0000000..08b20a8 --- /dev/null +++ b/include/php/Zend/zend_language_scanner_defs.h @@ -0,0 +1,15 @@ +/* Generated by re2c 2.1.1 */ + +enum YYCONDTYPE { + yycST_IN_SCRIPTING, + yycST_LOOKING_FOR_PROPERTY, + yycST_BACKQUOTE, + yycST_DOUBLE_QUOTES, + yycST_HEREDOC, + yycST_LOOKING_FOR_VARNAME, + yycST_VAR_OFFSET, + yycSHEBANG, + yycINITIAL, + yycST_END_HEREDOC, + yycST_NOWDOC, +}; diff --git a/include/php/Zend/zend_list.h b/include/php/Zend/zend_list.h new file mode 100644 index 0000000..55ccf78 --- /dev/null +++ b/include/php/Zend/zend_list.h @@ -0,0 +1,76 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_LIST_H +#define ZEND_LIST_H + +#include "zend_hash.h" +#include "zend_globals.h" + +BEGIN_EXTERN_C() + +typedef void (*rsrc_dtor_func_t)(zend_resource *res); +#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_resource *res) + +typedef struct _zend_rsrc_list_dtors_entry { + rsrc_dtor_func_t list_dtor_ex; + rsrc_dtor_func_t plist_dtor_ex; + + const char *type_name; + + int module_number; + int resource_id; +} zend_rsrc_list_dtors_entry; + + +ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, const char *type_name, int module_number); + +void list_entry_destructor(zval *ptr); +void plist_entry_destructor(zval *ptr); + +void zend_clean_module_rsrc_dtors(int module_number); +ZEND_API void zend_init_rsrc_list(void); /* Exported for phar hack */ +void zend_init_rsrc_plist(void); +void zend_close_rsrc_list(HashTable *ht); +void zend_destroy_rsrc_list(HashTable *ht); +void zend_init_rsrc_list_dtors(void); +void zend_destroy_rsrc_list_dtors(void); + +ZEND_API zval* ZEND_FASTCALL zend_list_insert(void *ptr, int type); +ZEND_API void ZEND_FASTCALL zend_list_free(zend_resource *res); +ZEND_API zend_result ZEND_FASTCALL zend_list_delete(zend_resource *res); +ZEND_API void ZEND_FASTCALL zend_list_close(zend_resource *res); + +ZEND_API zend_resource *zend_register_resource(void *rsrc_pointer, int rsrc_type); +ZEND_API void *zend_fetch_resource(zend_resource *res, const char *resource_type_name, int resource_type); +ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type, int resource_type2); +ZEND_API void *zend_fetch_resource_ex(zval *res, const char *resource_type_name, int resource_type); +ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int resource_type, int resource_type2); + +ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res); +ZEND_API int zend_fetch_list_dtor_id(const char *type_name); + +ZEND_API zend_resource* zend_register_persistent_resource(const char *key, size_t key_len, void *rsrc_pointer, int rsrc_type); +ZEND_API zend_resource* zend_register_persistent_resource_ex(zend_string *key, void *rsrc_pointer, int rsrc_type); + +extern ZEND_API int le_index_ptr; /* list entry type for index pointers */ + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_llist.h b/include/php/Zend/zend_llist.h new file mode 100644 index 0000000..cce5ad5 --- /dev/null +++ b/include/php/Zend/zend_llist.h @@ -0,0 +1,91 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_LLIST_H +#define ZEND_LLIST_H + +typedef struct _zend_llist_element { + struct _zend_llist_element *next; + struct _zend_llist_element *prev; + char data[1]; /* Needs to always be last in the struct */ +} zend_llist_element; + +typedef void (*llist_dtor_func_t)(void *); +typedef int (*llist_compare_func_t)(const zend_llist_element **, const zend_llist_element **); +typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args); +typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg); +typedef void (*llist_apply_func_t)(void *); + +typedef struct _zend_llist { + zend_llist_element *head; + zend_llist_element *tail; + size_t count; + size_t size; + llist_dtor_func_t dtor; + unsigned char persistent; + zend_llist_element *traverse_ptr; +} zend_llist; + +typedef zend_llist_element* zend_llist_position; + +BEGIN_EXTERN_C() +ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent); +ZEND_API void zend_llist_add_element(zend_llist *l, const void *element); +ZEND_API void zend_llist_prepend_element(zend_llist *l, const void *element); +ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)); +ZEND_API void zend_llist_destroy(zend_llist *l); +ZEND_API void zend_llist_clean(zend_llist *l); +ZEND_API void zend_llist_remove_tail(zend_llist *l); +ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src); +ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func); +ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)); +ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg); +ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...); +ZEND_API size_t zend_llist_count(zend_llist *l); +ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func); + +/* traversal */ +ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos); +ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos); +ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos); +ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos); + +static zend_always_inline void *zend_llist_get_first(zend_llist *l) +{ + return zend_llist_get_first_ex(l, NULL); +} + +static zend_always_inline void *zend_llist_get_last(zend_llist *l) +{ + return zend_llist_get_last_ex(l, NULL); +} + +static zend_always_inline void *zend_llist_get_next(zend_llist *l) +{ + return zend_llist_get_next_ex(l, NULL); +} + +static zend_always_inline void *zend_llist_get_prev(zend_llist *l) +{ + return zend_llist_get_prev_ex(l, NULL); +} + +END_EXTERN_C() + +#endif /* ZEND_LLIST_H */ diff --git a/include/php/Zend/zend_long.h b/include/php/Zend/zend_long.h new file mode 100644 index 0000000..3796f1c --- /dev/null +++ b/include/php/Zend/zend_long.h @@ -0,0 +1,128 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Anatol Belski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_LONG_H +#define ZEND_LONG_H + +#include +#include + +/* This is the heart of the whole int64 enablement in zval. */ +#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64) +# define ZEND_ENABLE_ZVAL_LONG64 1 +#endif + +/* Integer types. */ +#ifdef ZEND_ENABLE_ZVAL_LONG64 +typedef int64_t zend_long; +typedef uint64_t zend_ulong; +typedef int64_t zend_off_t; +# define ZEND_LONG_MAX INT64_MAX +# define ZEND_LONG_MIN INT64_MIN +# define ZEND_ULONG_MAX UINT64_MAX +# define Z_L(i) INT64_C(i) +# define Z_UL(i) UINT64_C(i) +# define SIZEOF_ZEND_LONG 8 +#else +typedef int32_t zend_long; +typedef uint32_t zend_ulong; +typedef int32_t zend_off_t; +# define ZEND_LONG_MAX INT32_MAX +# define ZEND_LONG_MIN INT32_MIN +# define ZEND_ULONG_MAX UINT32_MAX +# define Z_L(i) INT32_C(i) +# define Z_UL(i) UINT32_C(i) +# define SIZEOF_ZEND_LONG 4 +#endif + + +/* Conversion macros. */ +#define ZEND_LTOA_BUF_LEN 65 + +#ifdef ZEND_ENABLE_ZVAL_LONG64 +# define ZEND_LONG_FMT "%" PRId64 +# define ZEND_ULONG_FMT "%" PRIu64 +# define ZEND_XLONG_FMT "%" PRIx64 +# define ZEND_LONG_FMT_SPEC PRId64 +# define ZEND_ULONG_FMT_SPEC PRIu64 +# ifdef ZEND_WIN32 +# define ZEND_LTOA(i, s, len) _i64toa_s((i), (s), (len), 10) +# define ZEND_ATOL(s) _atoi64((s)) +# define ZEND_STRTOL(s0, s1, base) _strtoi64((s0), (s1), (base)) +# define ZEND_STRTOUL(s0, s1, base) _strtoui64((s0), (s1), (base)) +# define ZEND_STRTOL_PTR _strtoi64 +# define ZEND_STRTOUL_PTR _strtoui64 +# define ZEND_ABS _abs64 +# else +# define ZEND_LTOA(i, s, len) \ + do { \ + int st = snprintf((s), (len), ZEND_LONG_FMT, (i)); \ + (s)[st] = '\0'; \ + } while (0) +# define ZEND_ATOL(s) atoll((s)) +# define ZEND_STRTOL(s0, s1, base) strtoll((s0), (s1), (base)) +# define ZEND_STRTOUL(s0, s1, base) strtoull((s0), (s1), (base)) +# define ZEND_STRTOL_PTR strtoll +# define ZEND_STRTOUL_PTR strtoull +# define ZEND_ABS imaxabs +# endif +#else +# define ZEND_STRTOL(s0, s1, base) strtol((s0), (s1), (base)) +# define ZEND_STRTOUL(s0, s1, base) strtoul((s0), (s1), (base)) +# define ZEND_LONG_FMT "%" PRId32 +# define ZEND_ULONG_FMT "%" PRIu32 +# define ZEND_XLONG_FMT "%" PRIx32 +# define ZEND_LONG_FMT_SPEC PRId32 +# define ZEND_ULONG_FMT_SPEC PRIu32 +# ifdef ZEND_WIN32 +# define ZEND_LTOA(i, s, len) _ltoa_s((i), (s), (len), 10) +# define ZEND_ATOL(s) atol((s)) +# else +# define ZEND_LTOA(i, s, len) \ + do { \ + int st = snprintf((s), (len), ZEND_LONG_FMT, (i)); \ + (s)[st] = '\0'; \ + } while (0) +# define ZEND_ATOL(s) atol((s)) +# endif +# define ZEND_STRTOL_PTR strtol +# define ZEND_STRTOUL_PTR strtoul +# define ZEND_ABS abs +#endif + +#if SIZEOF_ZEND_LONG == 4 +# define MAX_LENGTH_OF_LONG 11 +# define LONG_MIN_DIGITS "2147483648" +#elif SIZEOF_ZEND_LONG == 8 +# define MAX_LENGTH_OF_LONG 20 +# define LONG_MIN_DIGITS "9223372036854775808" +#else +# error "Unknown SIZEOF_ZEND_LONG" +#endif + +static const char long_min_digits[] = LONG_MIN_DIGITS; + +#if SIZEOF_SIZE_T == 4 +# define ZEND_ADDR_FMT "0x%08zx" +#elif SIZEOF_SIZE_T == 8 +# define ZEND_ADDR_FMT "0x%016zx" +#else +# error "Unknown SIZEOF_SIZE_T" +#endif + +#endif /* ZEND_LONG_H */ diff --git a/include/php/Zend/zend_map_ptr.h b/include/php/Zend/zend_map_ptr.h new file mode 100644 index 0000000..aa726e0 --- /dev/null +++ b/include/php/Zend/zend_map_ptr.h @@ -0,0 +1,81 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_MAP_PTR_H +#define ZEND_MAP_PTR_H + +#include "zend_portability.h" + +#define ZEND_MAP_PTR_KIND_PTR 0 +#define ZEND_MAP_PTR_KIND_PTR_OR_OFFSET 1 + +#define ZEND_MAP_PTR_KIND ZEND_MAP_PTR_KIND_PTR_OR_OFFSET + +#define ZEND_MAP_PTR(ptr) \ + ptr ## __ptr +#define ZEND_MAP_PTR_DEF(type, name) \ + type ZEND_MAP_PTR(name) +#define ZEND_MAP_PTR_OFFSET2PTR(offset) \ + ((void**)((char*)CG(map_ptr_base) + offset)) +#define ZEND_MAP_PTR_PTR2OFFSET(ptr) \ + ((void*)(((char*)(ptr)) - ((char*)CG(map_ptr_base)))) +#define ZEND_MAP_PTR_INIT(ptr, val) do { \ + ZEND_MAP_PTR(ptr) = (val); \ + } while (0) +#define ZEND_MAP_PTR_NEW(ptr) do { \ + ZEND_MAP_PTR(ptr) = zend_map_ptr_new(); \ + } while (0) + +#if ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR_OR_OFFSET +# define ZEND_MAP_PTR_NEW_OFFSET() \ + ((uint32_t)(uintptr_t)zend_map_ptr_new()) +# define ZEND_MAP_PTR_IS_OFFSET(ptr) \ + (((uintptr_t)ZEND_MAP_PTR(ptr)) & 1L) +# define ZEND_MAP_PTR_GET(ptr) \ + ((ZEND_MAP_PTR_IS_OFFSET(ptr) ? \ + ZEND_MAP_PTR_GET_IMM(ptr) : \ + ((void*)(ZEND_MAP_PTR(ptr))))) +# define ZEND_MAP_PTR_GET_IMM(ptr) \ + (*ZEND_MAP_PTR_OFFSET2PTR((uintptr_t)ZEND_MAP_PTR(ptr))) +# define ZEND_MAP_PTR_SET(ptr, val) do { \ + if (ZEND_MAP_PTR_IS_OFFSET(ptr)) { \ + ZEND_MAP_PTR_SET_IMM(ptr, val); \ + } else { \ + ZEND_MAP_PTR_INIT(ptr, val); \ + } \ + } while (0) +# define ZEND_MAP_PTR_SET_IMM(ptr, val) do { \ + void **__p = ZEND_MAP_PTR_OFFSET2PTR((uintptr_t)ZEND_MAP_PTR(ptr)); \ + *__p = (val); \ + } while (0) +# define ZEND_MAP_PTR_BIASED_BASE(real_base) \ + ((void*)(((uintptr_t)(real_base)) - 1)) +#else +# error "Unknown ZEND_MAP_PTR_KIND" +#endif + +BEGIN_EXTERN_C() + +ZEND_API void zend_map_ptr_reset(void); +ZEND_API void *zend_map_ptr_new(void); +ZEND_API void zend_map_ptr_extend(size_t last); +ZEND_API void zend_alloc_ce_cache(zend_string *type_name); + +END_EXTERN_C() + +#endif /* ZEND_MAP_PTR_H */ diff --git a/include/php/Zend/zend_max_execution_timer.h b/include/php/Zend/zend_max_execution_timer.h new file mode 100644 index 0000000..789f50e --- /dev/null +++ b/include/php/Zend/zend_max_execution_timer.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Kévin Dunglas | + +----------------------------------------------------------------------+ + */ + +#ifndef ZEND_MAX_EXECUTION_TIMER_H +#define ZEND_MAX_EXECUTION_TIMER_H + +# ifdef ZEND_MAX_EXECUTION_TIMERS + +#include "zend_long.h" + +/* Must be called after calls to fork() */ +ZEND_API void zend_max_execution_timer_init(void); +void zend_max_execution_timer_settime(zend_long seconds); +void zend_max_execution_timer_shutdown(void); + +# else + +#define zend_max_execution_timer_init() +#define zend_max_execution_timer_settime(seconds) +#define zend_max_execution_timer_shutdown() + +# endif +#endif diff --git a/include/php/Zend/zend_mmap.h b/include/php/Zend/zend_mmap.h new file mode 100644 index 0000000..201fd84 --- /dev/null +++ b/include/php/Zend/zend_mmap.h @@ -0,0 +1,44 @@ +/* + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Max Kellermann | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_MMAP_H +#define ZEND_MMAP_H + +#include "zend_portability.h" + +#ifdef HAVE_PRCTL +# include + +/* fallback definitions if our libc is older than the kernel */ +# ifndef PR_SET_VMA +# define PR_SET_VMA 0x53564d41 +# endif +# ifndef PR_SET_VMA_ANON_NAME +# define PR_SET_VMA_ANON_NAME 0 +# endif +#endif // HAVE_PRCTL + +/** + * Set a name for the specified memory area. + * + * This feature requires Linux 5.17. + */ +static zend_always_inline void zend_mmap_set_name(const void *start, size_t len, const char *name) +{ +#ifdef HAVE_PRCTL + prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, (unsigned long)start, len, (unsigned long)name); +#endif +} + +#endif /* ZEND_MMAP_H */ diff --git a/include/php/Zend/zend_modules.h b/include/php/Zend/zend_modules.h new file mode 100644 index 0000000..09661e6 --- /dev/null +++ b/include/php/Zend/zend_modules.h @@ -0,0 +1,131 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef MODULES_H +#define MODULES_H + +#include "zend.h" +#include "zend_compile.h" +#include "zend_build.h" + +#define INIT_FUNC_ARGS int type, int module_number +#define INIT_FUNC_ARGS_PASSTHRU type, module_number +#define SHUTDOWN_FUNC_ARGS int type, int module_number +#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number +#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module +#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module + +#define ZEND_MODULE_API_NO 20230831 +#ifdef ZTS +#define USING_ZTS 1 +#else +#define USING_ZTS 0 +#endif + +#define STANDARD_MODULE_HEADER_EX sizeof(zend_module_entry), ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS +#define STANDARD_MODULE_HEADER \ + STANDARD_MODULE_HEADER_EX, NULL, NULL +#define ZE2_STANDARD_MODULE_HEADER \ + STANDARD_MODULE_HEADER_EX, ini_entries, NULL + +#define ZEND_MODULE_BUILD_ID "API" ZEND_TOSTR(ZEND_MODULE_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA + +#define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0, ZEND_MODULE_BUILD_ID + +#define NO_MODULE_GLOBALS 0, NULL, NULL, NULL + +#ifdef ZTS +# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals_id +#else +# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals +#endif + +#define STANDARD_MODULE_PROPERTIES \ + NO_MODULE_GLOBALS, NULL, STANDARD_MODULE_PROPERTIES_EX + +#define NO_VERSION_YET NULL + +#define MODULE_PERSISTENT 1 +#define MODULE_TEMPORARY 2 + +struct _zend_ini_entry; +typedef struct _zend_module_entry zend_module_entry; +typedef struct _zend_module_dep zend_module_dep; + +struct _zend_module_entry { + unsigned short size; + unsigned int zend_api; + unsigned char zend_debug; + unsigned char zts; + const struct _zend_ini_entry *ini_entry; + const struct _zend_module_dep *deps; + const char *name; + const struct _zend_function_entry *functions; + zend_result (*module_startup_func)(INIT_FUNC_ARGS); + zend_result (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS); + zend_result (*request_startup_func)(INIT_FUNC_ARGS); + zend_result (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS); + void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS); + const char *version; + size_t globals_size; +#ifdef ZTS + ts_rsrc_id* globals_id_ptr; +#else + void* globals_ptr; +#endif + void (*globals_ctor)(void *global); + void (*globals_dtor)(void *global); + zend_result (*post_deactivate_func)(void); + int module_started; + unsigned char type; + void *handle; + int module_number; + const char *build_id; +}; + +#define MODULE_DEP_REQUIRED 1 +#define MODULE_DEP_CONFLICTS 2 +#define MODULE_DEP_OPTIONAL 3 + +#define ZEND_MOD_REQUIRED_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_REQUIRED }, +#define ZEND_MOD_CONFLICTS_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_CONFLICTS }, +#define ZEND_MOD_OPTIONAL_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_OPTIONAL }, + +#define ZEND_MOD_REQUIRED(name) ZEND_MOD_REQUIRED_EX(name, NULL, NULL) +#define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL) +#define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL) + +#define ZEND_MOD_END { NULL, NULL, NULL, 0 } + +struct _zend_module_dep { + const char *name; /* module name */ + const char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */ + const char *version; /* version */ + unsigned char type; /* dependency type */ +}; + +BEGIN_EXTERN_C() +extern ZEND_API HashTable module_registry; + +void module_destructor(zend_module_entry *module); +int module_registry_request_startup(zend_module_entry *module); +int module_registry_unload_temp(const zend_module_entry *module); +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_multibyte.h b/include/php/Zend/zend_multibyte.h new file mode 100644 index 0000000..b00d57e --- /dev/null +++ b/include/php/Zend/zend_multibyte.h @@ -0,0 +1,79 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Masaki Fujimoto | + | Rui Hirokawa | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_MULTIBYTE_H +#define ZEND_MULTIBYTE_H + +typedef struct _zend_encoding zend_encoding; + +typedef size_t (*zend_encoding_filter)(unsigned char **str, size_t *str_length, const unsigned char *buf, size_t length); + +typedef const zend_encoding* (*zend_encoding_fetcher)(const char *encoding_name); +typedef const char* (*zend_encoding_name_getter)(const zend_encoding *encoding); +typedef bool (*zend_encoding_lexer_compatibility_checker)(const zend_encoding *encoding); +typedef const zend_encoding *(*zend_encoding_detector)(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size); +typedef size_t (*zend_encoding_converter)(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from); +typedef zend_result (*zend_encoding_list_parser)(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, bool persistent); +typedef const zend_encoding *(*zend_encoding_internal_encoding_getter)(void); +typedef zend_result (*zend_encoding_internal_encoding_setter)(const zend_encoding *encoding); + +typedef struct _zend_multibyte_functions { + const char *provider_name; + zend_encoding_fetcher encoding_fetcher; + zend_encoding_name_getter encoding_name_getter; + zend_encoding_lexer_compatibility_checker lexer_compatibility_checker; + zend_encoding_detector encoding_detector; + zend_encoding_converter encoding_converter; + zend_encoding_list_parser encoding_list_parser; + zend_encoding_internal_encoding_getter internal_encoding_getter; + zend_encoding_internal_encoding_setter internal_encoding_setter; +} zend_multibyte_functions; + +/* + * zend multibyte APIs + */ +BEGIN_EXTERN_C() + +ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf32be; +ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf32le; +ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf16be; +ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf16le; +ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf8; + +/* multibyte utility functions */ +ZEND_API zend_result zend_multibyte_set_functions(const zend_multibyte_functions *functions); +ZEND_API void zend_multibyte_restore_functions(void); +ZEND_API const zend_multibyte_functions *zend_multibyte_get_functions(void); + +ZEND_API const zend_encoding *zend_multibyte_fetch_encoding(const char *name); +ZEND_API const char *zend_multibyte_get_encoding_name(const zend_encoding *encoding); +ZEND_API int zend_multibyte_check_lexer_compatibility(const zend_encoding *encoding); +ZEND_API const zend_encoding *zend_multibyte_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size); +ZEND_API size_t zend_multibyte_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from); +ZEND_API zend_result zend_multibyte_parse_encoding_list(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, bool persistent); + +ZEND_API const zend_encoding *zend_multibyte_get_internal_encoding(void); +ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(void); +ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size); +ZEND_API zend_result zend_multibyte_set_internal_encoding(const zend_encoding *encoding); +ZEND_API zend_result zend_multibyte_set_script_encoding_by_string(const char *new_value, size_t new_value_length); + +END_EXTERN_C() + +#endif /* ZEND_MULTIBYTE_H */ diff --git a/include/php/Zend/zend_multiply.h b/include/php/Zend/zend_multiply.h new file mode 100644 index 0000000..a99e858 --- /dev/null +++ b/include/php/Zend/zend_multiply.h @@ -0,0 +1,356 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Sascha Schumann | + | Ard Biesheuvel | + +----------------------------------------------------------------------+ +*/ + +#include "zend_portability.h" + +#ifndef ZEND_MULTIPLY_H +#define ZEND_MULTIPLY_H + +#if PHP_HAVE_BUILTIN_SMULL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG + +#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + long __tmpvar; \ + if (((usedval) = __builtin_smull_overflow((a), (b), &__tmpvar))) { \ + (dval) = (double) (a) * (double) (b); \ + } \ + else (lval) = __tmpvar; \ +} while (0) + +#elif PHP_HAVE_BUILTIN_SMULLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG + +#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + long long __tmpvar; \ + if (((usedval) = __builtin_smulll_overflow((a), (b), &__tmpvar))) { \ + (dval) = (double) (a) * (double) (b); \ + } \ + else (lval) = __tmpvar; \ +} while (0) + +#elif (defined(__i386__) || defined(__x86_64__)) && defined(__GNUC__) + +#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + zend_long __tmpvar; \ + __asm__ ("imul %3,%0\n" \ + "adc $0,%1" \ + : "=r"(__tmpvar),"=r"(usedval) \ + : "0"(a), "r"(b), "1"(0)); \ + if (usedval) (dval) = (double) (a) * (double) (b); \ + else (lval) = __tmpvar; \ +} while (0) + +#elif defined(__arm__) && defined(__GNUC__) + +#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + zend_long __tmpvar; \ + __asm__("smull %0, %1, %2, %3\n" \ + "sub %1, %1, %0, asr #31" \ + : "=r"(__tmpvar), "=r"(usedval) \ + : "r"(a), "r"(b)); \ + if (usedval) (dval) = (double) (a) * (double) (b); \ + else (lval) = __tmpvar; \ +} while (0) + +#elif defined(__aarch64__) && defined(__GNUC__) + +#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + zend_long __tmpvar; \ + __asm__("mul %0, %2, %3\n" \ + "smulh %1, %2, %3\n" \ + "sub %1, %1, %0, asr #63\n" \ + : "=&r"(__tmpvar), "=&r"(usedval) \ + : "r"(a), "r"(b)); \ + if (usedval) (dval) = (double) (a) * (double) (b); \ + else (lval) = __tmpvar; \ +} while (0) + +#elif defined(ZEND_WIN32) + +# ifdef _M_X64 +# pragma intrinsic(_mul128) +# define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + __int64 __high; \ + __int64 __low = _mul128((a), (b), &__high); \ + if ((__low >> 63I64) == __high) { \ + (usedval) = 0; \ + (lval) = __low; \ + } else { \ + (usedval) = 1; \ + (dval) = (double)(a) * (double)(b); \ + } \ +} while (0) +# elif defined(_M_ARM64) +# pragma intrinsic(__mulh) +# define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + __int64 __high = __mulh((a), (b)); \ + __int64 __low = (a) * (b); \ + if ((__low >> 63I64) == __high) { \ + (usedval) = 0; \ + (lval) = __low; \ + } else { \ + (usedval) = 1; \ + (dval) = (double)(a) * (double)(b); \ + } \ +} while (0) +# else +# define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + zend_long __lres = (a) * (b); \ + long double __dres = (long double)(a) * (long double)(b); \ + long double __delta = (long double) __lres - __dres; \ + if ( ((usedval) = (( __dres + __delta ) != __dres))) { \ + (dval) = __dres; \ + } else { \ + (lval) = __lres; \ + } \ +} while (0) +# endif + +#elif defined(__powerpc64__) && defined(__GNUC__) + +#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + long __low, __high; \ + __asm__("mulld %0,%2,%3\n\t" \ + "mulhd %1,%2,%3\n" \ + : "=&r"(__low), "=&r"(__high) \ + : "r"(a), "r"(b)); \ + if ((__low >> 63) != __high) { \ + (dval) = (double) (a) * (double) (b); \ + (usedval) = 1; \ + } else { \ + (lval) = __low; \ + (usedval) = 0; \ + } \ +} while (0) + +#elif SIZEOF_ZEND_LONG == 4 + +#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + int64_t __result = (int64_t) (a) * (int64_t) (b); \ + if (__result > ZEND_LONG_MAX || __result < ZEND_LONG_MIN) { \ + (dval) = (double) __result; \ + (usedval) = 1; \ + } else { \ + (lval) = (long) __result; \ + (usedval) = 0; \ + } \ +} while (0) + +#else + +#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ + long __lres = (a) * (b); \ + long double __dres = (long double)(a) * (long double)(b); \ + long double __delta = (long double) __lres - __dres; \ + if ( ((usedval) = (( __dres + __delta ) != __dres))) { \ + (dval) = __dres; \ + } else { \ + (lval) = __lres; \ + } \ +} while (0) + +#endif + +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow) +{ + size_t res = nmemb; + size_t m_overflow = 0; + + if (ZEND_CONST_COND(offset == 0, 0)) { + __asm__ ("mull %3\n\tadcl $0,%1" + : "=&a"(res), "=&d" (m_overflow) + : "%0"(res), + "rm"(size)); + } else { + __asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1" + : "=&a"(res), "=&d" (m_overflow) + : "%0"(res), + "rm"(size), + "rm"(offset)); + } + + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif defined(__GNUC__) && defined(__x86_64__) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow) +{ + size_t res = nmemb; + zend_ulong m_overflow = 0; + +#ifdef __ILP32__ /* x32 */ +# define LP_SUFF "l" +#else /* amd64 */ +# define LP_SUFF "q" +#endif + + if (ZEND_CONST_COND(offset == 0, 0)) { + __asm__ ("mul" LP_SUFF " %3\n\t" + "adc $0,%1" + : "=&a"(res), "=&d" (m_overflow) + : "%0"(res), + "rm"(size)); + } else { + __asm__ ("mul" LP_SUFF " %3\n\t" + "add %4,%0\n\t" + "adc $0,%1" + : "=&a"(res), "=&d" (m_overflow) + : "%0"(res), + "rm"(size), + "rm"(offset)); + } +#undef LP_SUFF + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif defined(__GNUC__) && defined(__arm__) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow) +{ + size_t res; + zend_ulong m_overflow; + + __asm__ ("umlal %0,%1,%2,%3" + : "=r"(res), "=r"(m_overflow) + : "r"(nmemb), + "r"(size), + "0"(offset), + "1"(0)); + + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif defined(__GNUC__) && defined(__aarch64__) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow) +{ + size_t res; + zend_ulong m_overflow; + + __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr" + : "=&r"(res), "=&r"(m_overflow) + : "r"(nmemb), + "r"(size), + "r"(offset)); + + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif defined(__GNUC__) && defined(__powerpc64__) + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow) +{ + size_t res; + unsigned long m_overflow; + + __asm__ ("mulld %0,%2,%3\n\t" + "mulhdu %1,%2,%3\n\t" + "addc %0,%0,%4\n\t" + "addze %1,%1\n" + : "=&r"(res), "=&r"(m_overflow) + : "r"(nmemb), + "r"(size), + "r"(offset)); + + if (UNEXPECTED(m_overflow)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} + +#elif SIZEOF_SIZE_T == 4 + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow) +{ + uint64_t res = (uint64_t) nmemb * (uint64_t) size + (uint64_t) offset; + + if (UNEXPECTED(res > UINT64_C(0xFFFFFFFF))) { + *overflow = 1; + return 0; + } + *overflow = 0; + return (size_t) res; +} + +#else + +static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, bool *overflow) +{ + size_t res = nmemb * size + offset; + double _d = (double)nmemb * (double)size + (double)offset; + double _delta = (double)res - _d; + + if (UNEXPECTED((_d + _delta ) != _d)) { + *overflow = 1; + return 0; + } + *overflow = 0; + return res; +} +#endif + +static zend_always_inline size_t zend_safe_address_guarded(size_t nmemb, size_t size, size_t offset) +{ + bool overflow; + size_t ret = zend_safe_address(nmemb, size, offset, &overflow); + + if (UNEXPECTED(overflow)) { + zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); + return 0; + } + return ret; +} + +/* A bit more generic version of the same */ +static zend_always_inline size_t zend_safe_addmult(size_t nmemb, size_t size, size_t offset, const char *message) +{ + bool overflow; + size_t ret = zend_safe_address(nmemb, size, offset, &overflow); + + if (UNEXPECTED(overflow)) { + zend_error_noreturn(E_ERROR, "Possible integer overflow in %s (%zu * %zu + %zu)", message, nmemb, size, offset); + return 0; + } + return ret; +} + +#endif /* ZEND_MULTIPLY_H */ diff --git a/include/php/Zend/zend_object_handlers.h b/include/php/Zend/zend_object_handlers.h new file mode 100644 index 0000000..23a6c18 --- /dev/null +++ b/include/php/Zend/zend_object_handlers.h @@ -0,0 +1,282 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_OBJECT_HANDLERS_H +#define ZEND_OBJECT_HANDLERS_H + +#include + +struct _zend_property_info; + +#define ZEND_WRONG_PROPERTY_INFO \ + ((struct _zend_property_info*)((intptr_t)-1)) + +#define ZEND_DYNAMIC_PROPERTY_OFFSET ((uintptr_t)(intptr_t)(-1)) + +#define IS_VALID_PROPERTY_OFFSET(offset) ((intptr_t)(offset) > 0) +#define IS_WRONG_PROPERTY_OFFSET(offset) ((intptr_t)(offset) == 0) +#define IS_DYNAMIC_PROPERTY_OFFSET(offset) ((intptr_t)(offset) < 0) + +#define IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(offset) (offset == ZEND_DYNAMIC_PROPERTY_OFFSET) +#define ZEND_DECODE_DYN_PROP_OFFSET(offset) ((uintptr_t)(-(intptr_t)(offset) - 2)) +#define ZEND_ENCODE_DYN_PROP_OFFSET(offset) ((uintptr_t)(-((intptr_t)(offset) + 2))) + + +/* Used to fetch property from the object, read-only */ +typedef zval *(*zend_object_read_property_t)(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv); + +/* Used to fetch dimension from the object, read-only */ +typedef zval *(*zend_object_read_dimension_t)(zend_object *object, zval *offset, int type, zval *rv); + + +/* Used to set property of the object + You must return the final value of the assigned property. +*/ +typedef zval *(*zend_object_write_property_t)(zend_object *object, zend_string *member, zval *value, void **cache_slot); + +/* Used to set dimension of the object */ +typedef void (*zend_object_write_dimension_t)(zend_object *object, zval *offset, zval *value); + + +/* Used to create pointer to the property of the object, for future direct r/w access. + * May return one of: + * * A zval pointer, without incrementing the reference count. + * * &EG(error_zval), if an exception has been thrown. + * * NULL, if acquiring a direct pointer is not possible. + * In this case, the VM will fall back to using read_property and write_property. + */ +typedef zval *(*zend_object_get_property_ptr_ptr_t)(zend_object *object, zend_string *member, int type, void **cache_slot); + +/* Used to check if a property of the object exists */ +/* param has_set_exists: + * 0 (has) whether property exists and is not NULL + * 1 (set) whether property exists and is true + * 2 (exists) whether property exists + */ +typedef int (*zend_object_has_property_t)(zend_object *object, zend_string *member, int has_set_exists, void **cache_slot); + +/* Used to check if a dimension of the object exists */ +typedef int (*zend_object_has_dimension_t)(zend_object *object, zval *member, int check_empty); + +/* Used to remove a property of the object */ +typedef void (*zend_object_unset_property_t)(zend_object *object, zend_string *member, void **cache_slot); + +/* Used to remove a dimension of the object */ +typedef void (*zend_object_unset_dimension_t)(zend_object *object, zval *offset); + +/* Used to get hash of the properties of the object, as hash of zval's */ +typedef HashTable *(*zend_object_get_properties_t)(zend_object *object); + +typedef HashTable *(*zend_object_get_debug_info_t)(zend_object *object, int *is_temp); + +typedef enum _zend_prop_purpose { + /* Used for debugging. Supersedes get_debug_info handler. */ + ZEND_PROP_PURPOSE_DEBUG, + /* Used for (array) casts. */ + ZEND_PROP_PURPOSE_ARRAY_CAST, + /* Used for serialization using the "O" scheme. + * Unserialization will use __wakeup(). */ + ZEND_PROP_PURPOSE_SERIALIZE, + /* Used for var_export(). + * The data will be passed to __set_state() when evaluated. */ + ZEND_PROP_PURPOSE_VAR_EXPORT, + /* Used for json_encode(). */ + ZEND_PROP_PURPOSE_JSON, + /* Dummy member to ensure that "default" is specified. */ + _ZEND_PROP_PURPOSE_NON_EXHAUSTIVE_ENUM +} zend_prop_purpose; + +/* The return value must be released using zend_release_properties(). */ +typedef zend_array *(*zend_object_get_properties_for_t)(zend_object *object, zend_prop_purpose purpose); + +/* Used to call methods */ +/* args on stack! */ +/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this. + */ +typedef zend_function *(*zend_object_get_method_t)(zend_object **object, zend_string *method, const zval *key); +typedef zend_function *(*zend_object_get_constructor_t)(zend_object *object); + +/* free_obj should release any resources the object holds, without freeing the + * object structure itself. The object does not need to be in a valid state after + * free_obj finishes running. + * + * free_obj will always be invoked, even if the object leaks or a fatal error + * occurs. However, during shutdown it may be called once the executor is no + * longer active, in which case execution of user code may be skipped. + */ +typedef void (*zend_object_free_obj_t)(zend_object *object); + +/* dtor_obj is called before free_obj. The object must remain in a valid state + * after dtor_obj finishes running. Unlike free_obj, it is run prior to + * deactivation of the executor during shutdown, which allows user code to run. + * + * This handler is not guaranteed to be called (e.g. on fatal error), and as + * such should not be used to release resources or deallocate memory. Furthermore, + * releasing resources in this handler can break detection of memory leaks, as + * cycles may be broken early. + * + * dtor_obj should be used *only* to call user destruction hooks, such as __destruct. + */ +typedef void (*zend_object_dtor_obj_t)(zend_object *object); + +typedef zend_object* (*zend_object_clone_obj_t)(zend_object *object); + +/* Get class name for display in var_dump and other debugging functions. + * Must be defined and must return a non-NULL value. */ +typedef zend_string *(*zend_object_get_class_name_t)(const zend_object *object); + +typedef int (*zend_object_compare_t)(zval *object1, zval *object2); + +/* Cast an object to some other type. + * readobj and retval must point to distinct zvals. + */ +typedef zend_result (*zend_object_cast_t)(zend_object *readobj, zval *retval, int type); + +/* updates *count to hold the number of elements present and returns SUCCESS. + * Returns FAILURE if the object does not have any sense of overloaded dimensions */ +typedef zend_result (*zend_object_count_elements_t)(zend_object *object, zend_long *count); + +typedef zend_result (*zend_object_get_closure_t)(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only); + +typedef HashTable *(*zend_object_get_gc_t)(zend_object *object, zval **table, int *n); + +typedef zend_result (*zend_object_do_operation_t)(uint8_t opcode, zval *result, zval *op1, zval *op2); + +struct _zend_object_handlers { + /* offset of real object header (usually zero) */ + int offset; + /* object handlers */ + zend_object_free_obj_t free_obj; /* required */ + zend_object_dtor_obj_t dtor_obj; /* required */ + zend_object_clone_obj_t clone_obj; /* optional */ + zend_object_read_property_t read_property; /* required */ + zend_object_write_property_t write_property; /* required */ + zend_object_read_dimension_t read_dimension; /* required */ + zend_object_write_dimension_t write_dimension; /* required */ + zend_object_get_property_ptr_ptr_t get_property_ptr_ptr; /* required */ + zend_object_has_property_t has_property; /* required */ + zend_object_unset_property_t unset_property; /* required */ + zend_object_has_dimension_t has_dimension; /* required */ + zend_object_unset_dimension_t unset_dimension; /* required */ + zend_object_get_properties_t get_properties; /* required */ + zend_object_get_method_t get_method; /* required */ + zend_object_get_constructor_t get_constructor; /* required */ + zend_object_get_class_name_t get_class_name; /* required */ + zend_object_cast_t cast_object; /* required */ + zend_object_count_elements_t count_elements; /* optional */ + zend_object_get_debug_info_t get_debug_info; /* optional */ + zend_object_get_closure_t get_closure; /* optional */ + zend_object_get_gc_t get_gc; /* required */ + zend_object_do_operation_t do_operation; /* optional */ + zend_object_compare_t compare; /* required */ + zend_object_get_properties_for_t get_properties_for; /* optional */ +}; + +BEGIN_EXTERN_C() +extern const ZEND_API zend_object_handlers std_object_handlers; + +#define zend_get_std_object_handlers() \ + (&std_object_handlers) + +#define zend_get_function_root_class(fbc) \ + ((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope) + +#define ZEND_PROPERTY_ISSET 0x0 /* Property exists and is not NULL */ +#define ZEND_PROPERTY_NOT_EMPTY ZEND_ISEMPTY /* Property is not empty */ +#define ZEND_PROPERTY_EXISTS 0x2 /* Property exists */ + +ZEND_API void zend_class_init_statics(zend_class_entry *ce); +ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key); +ZEND_API zval *zend_std_get_static_property_with_info(zend_class_entry *ce, zend_string *property_name, int type, struct _zend_property_info **prop_info); +ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, int type); +ZEND_API ZEND_COLD bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name); +ZEND_API zend_function *zend_std_get_constructor(zend_object *object); +ZEND_API struct _zend_property_info *zend_get_property_info(const zend_class_entry *ce, zend_string *member, int silent); +ZEND_API HashTable *zend_std_get_properties(zend_object *object); +ZEND_API HashTable *zend_std_get_gc(zend_object *object, zval **table, int *n); +ZEND_API HashTable *zend_std_get_debug_info(zend_object *object, int *is_temp); +ZEND_API zend_result zend_std_cast_object_tostring(zend_object *object, zval *writeobj, int type); +ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *object, zend_string *member, int type, void **cache_slot); +ZEND_API zval *zend_std_read_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv); +ZEND_API zval *zend_std_write_property(zend_object *object, zend_string *member, zval *value, void **cache_slot); +ZEND_API int zend_std_has_property(zend_object *object, zend_string *member, int has_set_exists, void **cache_slot); +ZEND_API void zend_std_unset_property(zend_object *object, zend_string *member, void **cache_slot); +ZEND_API zval *zend_std_read_dimension(zend_object *object, zval *offset, int type, zval *rv); +ZEND_API void zend_std_write_dimension(zend_object *object, zval *offset, zval *value); +ZEND_API int zend_std_has_dimension(zend_object *object, zval *offset, int check_empty); +ZEND_API void zend_std_unset_dimension(zend_object *object, zval *offset); +ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key); +ZEND_API zend_string *zend_std_get_class_name(const zend_object *zobj); +ZEND_API int zend_std_compare_objects(zval *o1, zval *o2); +ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only); +ZEND_API void rebuild_object_properties(zend_object *zobj); + +ZEND_API HashTable *zend_std_build_object_properties_array(zend_object *zobj); + +/* Handler for objects that cannot be meaningfully compared. + * Only objects with the same identity will be considered equal. */ +ZEND_API int zend_objects_not_comparable(zval *o1, zval *o2); + +ZEND_API bool zend_check_protected(const zend_class_entry *ce, const zend_class_entry *scope); + +ZEND_API zend_result zend_check_property_access(const zend_object *zobj, zend_string *prop_info_name, bool is_dynamic); + +ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce, zend_string *method_name, bool is_static); + +ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member); + +ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member); + +ZEND_API uint32_t *zend_get_recursion_guard(zend_object *zobj); + +/* Default behavior for get_properties_for. For use as a fallback in custom + * get_properties_for implementations. */ +ZEND_API HashTable *zend_std_get_properties_for(zend_object *obj, zend_prop_purpose purpose); + +/* Will call get_properties_for handler or use default behavior. For use by + * consumers of the get_properties_for API. */ +ZEND_API HashTable *zend_get_properties_for(zval *obj, zend_prop_purpose purpose); + +#define zend_release_properties(ht) do { \ + if ((ht) && !(GC_FLAGS(ht) & GC_IMMUTABLE) && !GC_DELREF(ht)) { \ + zend_array_destroy(ht); \ + } \ +} while (0) + +#define zend_free_trampoline(func) do { \ + if ((func) == &EG(trampoline)) { \ + EG(trampoline).common.function_name = NULL; \ + } else { \ + efree(func); \ + } \ + } while (0) + +/* Fallback to default comparison implementation if the arguments aren't both objects + * and have the same compare() handler. You'll likely want to use this unless you + * explicitly wish to support comparisons between objects and non-objects. */ +#define ZEND_COMPARE_OBJECTS_FALLBACK(op1, op2) \ + if (Z_TYPE_P(op1) != IS_OBJECT || \ + Z_TYPE_P(op2) != IS_OBJECT || \ + Z_OBJ_HT_P(op1)->compare != Z_OBJ_HT_P(op2)->compare) { \ + return zend_std_compare_objects(op1, op2); \ + } + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_objects.h b/include/php/Zend/zend_objects.h new file mode 100644 index 0000000..91d3881 --- /dev/null +++ b/include/php/Zend/zend_objects.h @@ -0,0 +1,35 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_OBJECTS_H +#define ZEND_OBJECTS_H + +#include "zend.h" + +BEGIN_EXTERN_C() +ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce); +ZEND_API zend_object* ZEND_FASTCALL zend_objects_new(zend_class_entry *ce); +ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object, zend_object *old_object); + +ZEND_API void zend_object_std_dtor(zend_object *object); +ZEND_API void zend_objects_destroy_object(zend_object *object); +ZEND_API zend_object *zend_objects_clone_obj(zend_object *object); +END_EXTERN_C() + +#endif /* ZEND_OBJECTS_H */ diff --git a/include/php/Zend/zend_objects_API.h b/include/php/Zend/zend_objects_API.h new file mode 100644 index 0000000..422bf6a --- /dev/null +++ b/include/php/Zend/zend_objects_API.h @@ -0,0 +1,116 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_OBJECTS_API_H +#define ZEND_OBJECTS_API_H + +#include "zend.h" +#include "zend_compile.h" + +#define OBJ_BUCKET_INVALID (1<<0) + +#define IS_OBJ_VALID(o) (!(((uintptr_t)(o)) & OBJ_BUCKET_INVALID)) + +#define SET_OBJ_INVALID(o) ((zend_object*)((((uintptr_t)(o)) | OBJ_BUCKET_INVALID))) + +#define GET_OBJ_BUCKET_NUMBER(o) (((intptr_t)(o)) >> 1) + +#define SET_OBJ_BUCKET_NUMBER(o, n) do { \ + (o) = (zend_object*)((((uintptr_t)(n)) << 1) | OBJ_BUCKET_INVALID); \ + } while (0) + +#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(h) do { \ + SET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[(h)], EG(objects_store).free_list_head); \ + EG(objects_store).free_list_head = (h); \ + } while (0) + +#define OBJ_RELEASE(obj) zend_object_release(obj) + +typedef struct _zend_objects_store { + zend_object **object_buckets; + uint32_t top; + uint32_t size; + int free_list_head; +} zend_objects_store; + +/* Global store handling functions */ +BEGIN_EXTERN_C() +ZEND_API void ZEND_FASTCALL zend_objects_store_init(zend_objects_store *objects, uint32_t init_size); +ZEND_API void ZEND_FASTCALL zend_objects_store_call_destructors(zend_objects_store *objects); +ZEND_API void ZEND_FASTCALL zend_objects_store_mark_destructed(zend_objects_store *objects); +ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_store *objects, bool fast_shutdown); +ZEND_API void ZEND_FASTCALL zend_objects_store_destroy(zend_objects_store *objects); + +/* Store API functions */ +ZEND_API void ZEND_FASTCALL zend_objects_store_put(zend_object *object); +ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object); + +/* Called when the ctor was terminated by an exception */ +static zend_always_inline void zend_object_store_ctor_failed(zend_object *obj) +{ + GC_ADD_FLAGS(obj, IS_OBJ_DESTRUCTOR_CALLED); +} + +END_EXTERN_C() + +static zend_always_inline void zend_object_release(zend_object *obj) +{ + if (GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + } else if (UNEXPECTED(GC_MAY_LEAK((zend_refcounted*)obj))) { + gc_possible_root((zend_refcounted*)obj); + } +} + +static zend_always_inline size_t zend_object_properties_size(zend_class_entry *ce) +{ + return sizeof(zval) * + (ce->default_properties_count - + ((ce->ce_flags & ZEND_ACC_USE_GUARDS) ? 0 : 1)); +} + +/* Allocates object type and zeros it, but not the standard zend_object and properties. + * Standard object MUST be initialized using zend_object_std_init(). + * Properties MUST be initialized using object_properties_init(). */ +static zend_always_inline void *zend_object_alloc(size_t obj_size, zend_class_entry *ce) { + void *obj = emalloc(obj_size + zend_object_properties_size(ce)); + memset(obj, 0, obj_size - sizeof(zend_object)); + return obj; +} + +static inline zend_property_info *zend_get_property_info_for_slot(zend_object *obj, zval *slot) +{ + zend_property_info **table = obj->ce->properties_info_table; + intptr_t prop_num = slot - obj->properties_table; + ZEND_ASSERT(prop_num >= 0 && prop_num < obj->ce->default_properties_count); + return table[prop_num]; +} + +/* Helper for cases where we're only interested in property info of typed properties. */ +static inline zend_property_info *zend_get_typed_property_info_for_slot(zend_object *obj, zval *slot) +{ + zend_property_info *prop_info = zend_get_property_info_for_slot(obj, slot); + if (prop_info && ZEND_TYPE_IS_SET(prop_info->type)) { + return prop_info; + } + return NULL; +} + + +#endif /* ZEND_OBJECTS_H */ diff --git a/include/php/Zend/zend_observer.h b/include/php/Zend/zend_observer.h new file mode 100644 index 0000000..fc4d9a6 --- /dev/null +++ b/include/php/Zend/zend_observer.h @@ -0,0 +1,130 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Levi Morrison | + | Sammy Kaye Powers | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_OBSERVER_H +#define ZEND_OBSERVER_H + +#include "zend.h" +#include "zend_compile.h" +#include "zend_fibers.h" + +BEGIN_EXTERN_C() + +extern ZEND_API int zend_observer_fcall_op_array_extension; +extern ZEND_API bool zend_observer_errors_observed; +extern ZEND_API bool zend_observer_function_declared_observed; +extern ZEND_API bool zend_observer_class_linked_observed; + +#define ZEND_OBSERVER_ENABLED (zend_observer_fcall_op_array_extension != -1) + +#define ZEND_OBSERVER_FCALL_BEGIN(execute_data) do { \ + if (ZEND_OBSERVER_ENABLED) { \ + zend_observer_fcall_begin(execute_data); \ + } \ + } while (0) + +#define ZEND_OBSERVER_FCALL_END(execute_data, return_value) do { \ + if (ZEND_OBSERVER_ENABLED) { \ + zend_observer_fcall_end(execute_data, return_value); \ + } \ + } while (0) + +typedef void (*zend_observer_fcall_begin_handler)(zend_execute_data *execute_data); +typedef void (*zend_observer_fcall_end_handler)(zend_execute_data *execute_data, zval *retval); + +typedef struct _zend_observer_fcall_handlers { + zend_observer_fcall_begin_handler begin; + zend_observer_fcall_end_handler end; +} zend_observer_fcall_handlers; + +/* If the fn should not be observed then return {NULL, NULL} */ +typedef zend_observer_fcall_handlers (*zend_observer_fcall_init)(zend_execute_data *execute_data); + +// Call during minit/startup ONLY +ZEND_API void zend_observer_fcall_register(zend_observer_fcall_init); + +// Call during runtime, but only if you have used zend_observer_fcall_register. +// You must not have more than one begin and one end handler active at the same time. Remove the old one first, if there is an existing one. +ZEND_API void zend_observer_add_begin_handler(zend_function *function, zend_observer_fcall_begin_handler begin); +ZEND_API bool zend_observer_remove_begin_handler(zend_function *function, zend_observer_fcall_begin_handler begin); +ZEND_API void zend_observer_add_end_handler(zend_function *function, zend_observer_fcall_end_handler end); +ZEND_API bool zend_observer_remove_end_handler(zend_function *function, zend_observer_fcall_end_handler end); + +ZEND_API void zend_observer_startup(void); // Called by engine before MINITs +ZEND_API void zend_observer_post_startup(void); // Called by engine after MINITs +ZEND_API void zend_observer_activate(void); +ZEND_API void zend_observer_shutdown(void); + +ZEND_API void ZEND_FASTCALL zend_observer_fcall_begin( + zend_execute_data *execute_data); + +ZEND_API void ZEND_FASTCALL zend_observer_generator_resume( + zend_execute_data *execute_data); + +ZEND_API void ZEND_FASTCALL zend_observer_fcall_end( + zend_execute_data *execute_data, + zval *return_value); + +ZEND_API void zend_observer_fcall_end_all(void); + +typedef void (*zend_observer_function_declared_cb)(zend_op_array *op_array, zend_string *name); + +ZEND_API void zend_observer_function_declared_register(zend_observer_function_declared_cb cb); +ZEND_API void ZEND_FASTCALL _zend_observer_function_declared_notify(zend_op_array *op_array, zend_string *name); +static inline void zend_observer_function_declared_notify(zend_op_array *op_array, zend_string *name) { + if (UNEXPECTED(zend_observer_function_declared_observed)) { + _zend_observer_function_declared_notify(op_array, name); + } +} + +typedef void (*zend_observer_class_linked_cb)(zend_class_entry *ce, zend_string *name); + +ZEND_API void zend_observer_class_linked_register(zend_observer_class_linked_cb cb); +ZEND_API void ZEND_FASTCALL _zend_observer_class_linked_notify(zend_class_entry *ce, zend_string *name); +static inline void zend_observer_class_linked_notify(zend_class_entry *ce, zend_string *name) { + if (UNEXPECTED(zend_observer_class_linked_observed)) { + _zend_observer_class_linked_notify(ce, name); + } +} + +typedef void (*zend_observer_error_cb)(int type, zend_string *error_filename, uint32_t error_lineno, zend_string *message); + +ZEND_API void zend_observer_error_register(zend_observer_error_cb callback); +ZEND_API void _zend_observer_error_notify(int type, zend_string *error_filename, uint32_t error_lineno, zend_string *message); +static inline void zend_observer_error_notify(int type, zend_string *error_filename, uint32_t error_lineno, zend_string *message) { + if (UNEXPECTED(zend_observer_errors_observed)) { + _zend_observer_error_notify(type, error_filename, error_lineno, message); + } +} + +typedef void (*zend_observer_fiber_init_handler)(zend_fiber_context *initializing); +typedef void (*zend_observer_fiber_switch_handler)(zend_fiber_context *from, zend_fiber_context *to); +typedef void (*zend_observer_fiber_destroy_handler)(zend_fiber_context *destroying); + +ZEND_API void zend_observer_fiber_init_register(zend_observer_fiber_init_handler handler); +ZEND_API void zend_observer_fiber_switch_register(zend_observer_fiber_switch_handler handler); +ZEND_API void zend_observer_fiber_destroy_register(zend_observer_fiber_destroy_handler handler); + +ZEND_API void ZEND_FASTCALL zend_observer_fiber_init_notify(zend_fiber_context *initializing); +ZEND_API void ZEND_FASTCALL zend_observer_fiber_switch_notify(zend_fiber_context *from, zend_fiber_context *to); +ZEND_API void ZEND_FASTCALL zend_observer_fiber_destroy_notify(zend_fiber_context *destroying); + +END_EXTERN_C() + +#endif /* ZEND_OBSERVER_H */ diff --git a/include/php/Zend/zend_operators.h b/include/php/Zend/zend_operators.h new file mode 100644 index 0000000..4f4a14b --- /dev/null +++ b/include/php/Zend/zend_operators.h @@ -0,0 +1,974 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_OPERATORS_H +#define ZEND_OPERATORS_H + +#include +#include +#include +#include +#include + +#ifdef HAVE_IEEEFP_H +#include +#endif + +#include "zend_portability.h" +#include "zend_strtod.h" +#include "zend_multiply.h" +#include "zend_object_handlers.h" + +#define LONG_SIGN_MASK ZEND_LONG_MIN + +BEGIN_EXTERN_C() +ZEND_API zend_result ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL boolean_not_function(zval *result, zval *op1); +ZEND_API zend_result ZEND_FASTCALL bitwise_not_function(zval *result, zval *op1); +ZEND_API zend_result ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2); + +ZEND_API bool ZEND_FASTCALL zend_is_identical(const zval *op1, const zval *op2); + +ZEND_API zend_result ZEND_FASTCALL is_equal_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL is_identical_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL is_not_identical_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL is_not_equal_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval *op2); +ZEND_API zend_result ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zval *op1, zval *op2); + +ZEND_API bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce); +ZEND_API bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce); + +static zend_always_inline bool instanceof_function( + const zend_class_entry *instance_ce, const zend_class_entry *ce) { + return instance_ce == ce || instanceof_function_slow(instance_ce, ce); +} + +ZEND_API bool zend_string_only_has_ascii_alphanumeric(const zend_string *str); + +/** + * Checks whether the string "str" with length "length" is numeric. The value + * of allow_errors determines whether it's required to be entirely numeric, or + * just its prefix. Leading whitespace is allowed. + * + * The function returns 0 if the string did not contain a valid number; IS_LONG + * if it contained a number that fits within the range of a long; or IS_DOUBLE + * if the number was out of long range or contained a decimal point/exponent. + * The number's value is returned into the respective pointer, *lval or *dval, + * if that pointer is not NULL. + * + * This variant also gives information if a string that represents an integer + * could not be represented as such due to overflow. It writes 1 to oflow_info + * if the integer is larger than ZEND_LONG_MAX and -1 if it's smaller than ZEND_LONG_MIN. + */ +ZEND_API uint8_t ZEND_FASTCALL _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, + double *dval, bool allow_errors, int *oflow_info, bool *trailing_data); + +ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end); +ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end); + +#if SIZEOF_ZEND_LONG == 4 +# define ZEND_DOUBLE_FITS_LONG(d) (!((d) > (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN)) +#else + /* >= as (double)ZEND_LONG_MAX is outside signed range */ +# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN)) +#endif + +ZEND_API zend_long ZEND_FASTCALL zend_dval_to_lval_slow(double d); + +static zend_always_inline zend_long zend_dval_to_lval(double d) +{ + if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) { + return 0; + } else if (!ZEND_DOUBLE_FITS_LONG(d)) { + return zend_dval_to_lval_slow(d); + } + return (zend_long)d; +} + +/* Used to convert a string float to integer during an (int) cast */ +static zend_always_inline zend_long zend_dval_to_lval_cap(double d) +{ + if (UNEXPECTED(!zend_finite(d)) || UNEXPECTED(zend_isnan(d))) { + return 0; + } else if (!ZEND_DOUBLE_FITS_LONG(d)) { + return (d > 0 ? ZEND_LONG_MAX : ZEND_LONG_MIN); + } + return (zend_long)d; +} +/* }}} */ + +static zend_always_inline bool zend_is_long_compatible(double d, zend_long l) { + return (double)l == d; +} + +ZEND_API void zend_incompatible_double_to_long_error(double d); +ZEND_API void zend_incompatible_string_to_long_error(const zend_string *s); + +static zend_always_inline zend_long zend_dval_to_lval_safe(double d) +{ + zend_long l = zend_dval_to_lval(d); + if (!zend_is_long_compatible(d, l)) { + zend_incompatible_double_to_long_error(d); + } + return l; +} + +#define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9') +#define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f')) + +static zend_always_inline uint8_t is_numeric_string_ex(const char *str, size_t length, zend_long *lval, + double *dval, bool allow_errors, int *oflow_info, bool *trailing_data) +{ + if (*str > '9') { + return 0; + } + return _is_numeric_string_ex(str, length, lval, dval, allow_errors, oflow_info, trailing_data); +} + +static zend_always_inline uint8_t is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, bool allow_errors) { + return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL, NULL); +} + +ZEND_API uint8_t ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval); + +static zend_always_inline const char * +zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const char *end) +{ + const char *p = haystack; + size_t off_s; + + ZEND_ASSERT(end >= p); + + if (needle_len == 1) { + return (const char *)memchr(p, *needle, (end-p)); + } else if (UNEXPECTED(needle_len == 0)) { + return p; + } + + off_s = (size_t)(end - p); + + if (needle_len > off_s) { + return NULL; + } + + if (EXPECTED(off_s < 1024 || needle_len < 9)) { /* glibc memchr is faster when needle is too short */ + const char ne = needle[needle_len-1]; + end -= needle_len; + + while (p <= end) { + if ((p = (const char *)memchr(p, *needle, (end-p+1)))) { + if (ne == p[needle_len-1] && !memcmp(needle+1, p+1, needle_len-2)) { + return p; + } + } else { + return NULL; + } + p++; + } + + return NULL; + } else { + return zend_memnstr_ex(haystack, needle, needle_len, end); + } +} + +static zend_always_inline const void *zend_memrchr(const void *s, int c, size_t n) +{ +#if defined(HAVE_MEMRCHR) && !defined(i386) + /* On x86 memrchr() doesn't use SSE/AVX, so inlined version is faster */ + return (const void*)memrchr(s, c, n); +#else + const unsigned char *e; + if (0 == n) { + return NULL; + } + + for (e = (const unsigned char *)s + n - 1; e >= (const unsigned char *)s; e--) { + if (*e == (unsigned char)c) { + return (const void *)e; + } + } + return NULL; +#endif +} + + +static zend_always_inline const char * +zend_memnrstr(const char *haystack, const char *needle, size_t needle_len, const char *end) +{ + const char *p = end; + ptrdiff_t off_p; + size_t off_s; + + if (needle_len == 0) { + return p; + } + + if (needle_len == 1) { + return (const char *)zend_memrchr(haystack, *needle, (p - haystack)); + } + + off_p = end - haystack; + off_s = (off_p > 0) ? (size_t)off_p : 0; + + if (needle_len > off_s) { + return NULL; + } + + if (EXPECTED(off_s < 1024 || needle_len < 3)) { + const char ne = needle[needle_len-1]; + p -= needle_len; + + do { + p = (const char *)zend_memrchr(haystack, *needle, (p - haystack) + 1); + if (!p) { + return NULL; + } + if (ne == p[needle_len-1] && !memcmp(needle + 1, p + 1, needle_len - 2)) { + return p; + } + } while (p-- >= haystack); + + return NULL; + } else { + return zend_memnrstr_ex(haystack, needle, needle_len, end); + } +} + +static zend_always_inline size_t zend_strnlen(const char* s, size_t maxlen) +{ +#if defined(HAVE_STRNLEN) + return strnlen(s, maxlen); +#else + const char *p = (const char *)memchr(s, '\0', maxlen); + return p ? p-s : maxlen; +#endif +} + +ZEND_API zend_result ZEND_FASTCALL increment_function(zval *op1); +ZEND_API zend_result ZEND_FASTCALL decrement_function(zval *op2); + +ZEND_API void ZEND_FASTCALL convert_scalar_to_number(zval *op); +ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op); +ZEND_API void ZEND_FASTCALL convert_to_long(zval *op); +ZEND_API void ZEND_FASTCALL convert_to_double(zval *op); +ZEND_API void ZEND_FASTCALL convert_to_null(zval *op); +ZEND_API void ZEND_FASTCALL convert_to_boolean(zval *op); +ZEND_API void ZEND_FASTCALL convert_to_array(zval *op); +ZEND_API void ZEND_FASTCALL convert_to_object(zval *op); + +ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(const zval *op, bool is_strict); +ZEND_API zend_long ZEND_FASTCALL zval_try_get_long(const zval *op, bool *failed); +ZEND_API double ZEND_FASTCALL zval_get_double_func(const zval *op); +ZEND_API zend_string* ZEND_FASTCALL zval_get_string_func(zval *op); +ZEND_API zend_string* ZEND_FASTCALL zval_try_get_string_func(zval *op); + +static zend_always_inline zend_long zval_get_long(const zval *op) { + return EXPECTED(Z_TYPE_P(op) == IS_LONG) ? Z_LVAL_P(op) : zval_get_long_func(op, false); +} +static zend_always_inline zend_long zval_get_long_ex(const zval *op, bool is_strict) { + return EXPECTED(Z_TYPE_P(op) == IS_LONG) ? Z_LVAL_P(op) : zval_get_long_func(op, is_strict); +} +static zend_always_inline double zval_get_double(const zval *op) { + return EXPECTED(Z_TYPE_P(op) == IS_DOUBLE) ? Z_DVAL_P(op) : zval_get_double_func(op); +} +static zend_always_inline zend_string *zval_get_string(zval *op) { + return EXPECTED(Z_TYPE_P(op) == IS_STRING) ? zend_string_copy(Z_STR_P(op)) : zval_get_string_func(op); +} + +static zend_always_inline zend_string *zval_get_tmp_string(zval *op, zend_string **tmp) { + if (EXPECTED(Z_TYPE_P(op) == IS_STRING)) { + *tmp = NULL; + return Z_STR_P(op); + } else { + return *tmp = zval_get_string_func(op); + } +} +static zend_always_inline void zend_tmp_string_release(zend_string *tmp) { + if (UNEXPECTED(tmp)) { + zend_string_release_ex(tmp, 0); + } +} + +/* Like zval_get_string, but returns NULL if the conversion fails with an exception. */ +static zend_always_inline zend_string *zval_try_get_string(zval *op) { + if (EXPECTED(Z_TYPE_P(op) == IS_STRING)) { + zend_string *ret = zend_string_copy(Z_STR_P(op)); + ZEND_ASSUME(ret != NULL); + return ret; + } else { + return zval_try_get_string_func(op); + } +} + +/* Like zval_get_tmp_string, but returns NULL if the conversion fails with an exception. */ +static zend_always_inline zend_string *zval_try_get_tmp_string(zval *op, zend_string **tmp) { + if (EXPECTED(Z_TYPE_P(op) == IS_STRING)) { + zend_string *ret = Z_STR_P(op); + *tmp = NULL; + ZEND_ASSUME(ret != NULL); + return ret; + } else { + return *tmp = zval_try_get_string_func(op); + } +} + +/* Like convert_to_string(), but returns whether the conversion succeeded and does not modify the + * zval in-place if it fails. */ +ZEND_API bool ZEND_FASTCALL _try_convert_to_string(zval *op); +static zend_always_inline bool try_convert_to_string(zval *op) { + if (Z_TYPE_P(op) == IS_STRING) { + return 1; + } + return _try_convert_to_string(op); +} + +/* Compatibility macros for 7.2 and below */ +#define _zval_get_long(op) zval_get_long(op) +#define _zval_get_double(op) zval_get_double(op) +#define _zval_get_string(op) zval_get_string(op) +#define _zval_get_long_func(op) zval_get_long_func(op) +#define _zval_get_double_func(op) zval_get_double_func(op) +#define _zval_get_string_func(op) zval_get_string_func(op) + +#define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op)); } + + +ZEND_API int ZEND_FASTCALL zend_is_true(const zval *op); +ZEND_API bool ZEND_FASTCALL zend_object_is_true(const zval *op); + +#define zval_is_true(op) \ + zend_is_true(op) + +static zend_always_inline bool i_zend_is_true(const zval *op) +{ + bool result = 0; + +again: + switch (Z_TYPE_P(op)) { + case IS_TRUE: + result = 1; + break; + case IS_LONG: + if (Z_LVAL_P(op)) { + result = 1; + } + break; + case IS_DOUBLE: + if (Z_DVAL_P(op)) { + result = 1; + } + break; + case IS_STRING: + if (Z_STRLEN_P(op) > 1 || (Z_STRLEN_P(op) && Z_STRVAL_P(op)[0] != '0')) { + result = 1; + } + break; + case IS_ARRAY: + if (zend_hash_num_elements(Z_ARRVAL_P(op))) { + result = 1; + } + break; + case IS_OBJECT: + if (EXPECTED(Z_OBJ_HT_P(op)->cast_object == zend_std_cast_object_tostring)) { + result = 1; + } else { + result = zend_object_is_true(op); + } + break; + case IS_RESOURCE: + if (EXPECTED(Z_RES_HANDLE_P(op))) { + result = 1; + } + break; + case IS_REFERENCE: + op = Z_REFVAL_P(op); + goto again; + break; + default: + break; + } + return result; +} + +/* Indicate that two values cannot be compared. This value should be returned for both orderings + * of the operands. This implies that all of ==, <, <= and >, >= will return false, because we + * canonicalize >/>= to value) + : "cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0); +#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__) + __asm__ goto( + "addq $1,(%0)\n\t" + "jo %l1\n" + : + : "r"(&op1->value) + : "cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0); +#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__) + __asm__ goto ( + "ldr x5, [%0]\n\t" + "adds x5, x5, 1\n\t" + "bvs %l1\n" + "str x5, [%0]" + : + : "r"(&op1->value) + : "x5", "cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0); +#elif PHP_HAVE_BUILTIN_SADDL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG + long lresult; + if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) { + /* switch to double */ + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0); + } else { + Z_LVAL_P(op1) = lresult; + } +#elif PHP_HAVE_BUILTIN_SADDLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG + long long llresult; + if (UNEXPECTED(__builtin_saddll_overflow(Z_LVAL_P(op1), 1, &llresult))) { + /* switch to double */ + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0); + } else { + Z_LVAL_P(op1) = llresult; + } +#else + if (UNEXPECTED(Z_LVAL_P(op1) == ZEND_LONG_MAX)) { + /* switch to double */ + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0); + } else { + Z_LVAL_P(op1)++; + } +#endif +} + +static zend_always_inline void fast_long_decrement_function(zval *op1) +{ +#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__) + __asm__ goto( + "subl $1,(%0)\n\t" + "jo %l1\n" + : + : "r"(&op1->value) + : "cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0); +#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__) + __asm__ goto( + "subq $1,(%0)\n\t" + "jo %l1\n" + : + : "r"(&op1->value) + : "cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0); +#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__) + __asm__ goto ( + "ldr x5, [%0]\n\t" + "subs x5 ,x5, 1\n\t" + "bvs %l1\n" + "str x5, [%0]" + : + : "r"(&op1->value) + : "x5", "cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0); +#elif PHP_HAVE_BUILTIN_SSUBL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG + long lresult; + if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) { + /* switch to double */ + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0); + } else { + Z_LVAL_P(op1) = lresult; + } +#elif PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG + long long llresult; + if (UNEXPECTED(__builtin_ssubll_overflow(Z_LVAL_P(op1), 1, &llresult))) { + /* switch to double */ + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0); + } else { + Z_LVAL_P(op1) = llresult; + } +#else + if (UNEXPECTED(Z_LVAL_P(op1) == ZEND_LONG_MIN)) { + /* switch to double */ + ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0); + } else { + Z_LVAL_P(op1)--; + } +#endif +} + +static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2) +{ +#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__) + __asm__ goto( + "movl (%1), %%eax\n\t" + "addl (%2), %%eax\n\t" + "jo %l5\n\t" + "movl %%eax, (%0)\n\t" + "movl %3, %c4(%0)\n" + : + : "r"(&result->value), + "r"(&op1->value), + "r"(&op2->value), + "n"(IS_LONG), + "n"(ZVAL_OFFSETOF_TYPE) + : "eax","cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); +#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__) + __asm__ goto( + "movq (%1), %%rax\n\t" + "addq (%2), %%rax\n\t" + "jo %l5\n\t" + "movq %%rax, (%0)\n\t" + "movl %3, %c4(%0)\n" + : + : "r"(&result->value), + "r"(&op1->value), + "r"(&op2->value), + "n"(IS_LONG), + "n"(ZVAL_OFFSETOF_TYPE) + : "rax","cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); +#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__) + __asm__ goto( + "ldr x5, [%1]\n\t" + "ldr x6, [%2]\n\t" + "adds x5, x5, x6\n\t" + "bvs %l5\n\t" + "mov w6, %3\n\t" + "str x5, [%0]\n\t" + "str w6, [%0, %c4]\n" + : + : "r"(&result->value), + "r"(&op1->value), + "r"(&op2->value), + "n"(IS_LONG), + "n"(ZVAL_OFFSETOF_TYPE) + : "x5", "x6", "cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); +#elif PHP_HAVE_BUILTIN_SADDL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG + long lresult; + if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) { + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); + } else { + ZVAL_LONG(result, lresult); + } +#elif PHP_HAVE_BUILTIN_SADDLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG + long long llresult; + if (UNEXPECTED(__builtin_saddll_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &llresult))) { + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); + } else { + ZVAL_LONG(result, llresult); + } +#else + /* + * 'result' may alias with op1 or op2, so we need to + * ensure that 'result' is not updated until after we + * have read the values of op1 and op2. + */ + + if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK) + && (Z_LVAL_P(op1) & LONG_SIGN_MASK) != ((Z_LVAL_P(op1) + Z_LVAL_P(op2)) & LONG_SIGN_MASK))) { + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); + } else { + ZVAL_LONG(result, Z_LVAL_P(op1) + Z_LVAL_P(op2)); + } +#endif +} + +static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2) +{ +#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__) + __asm__ goto( + "movl (%1), %%eax\n\t" + "subl (%2), %%eax\n\t" + "jo %l5\n\t" + "movl %%eax, (%0)\n\t" + "movl %3, %c4(%0)\n" + : + : "r"(&result->value), + "r"(&op1->value), + "r"(&op2->value), + "n"(IS_LONG), + "n"(ZVAL_OFFSETOF_TYPE) + : "eax","cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); +#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__) + __asm__ goto( + "movq (%1), %%rax\n\t" + "subq (%2), %%rax\n\t" + "jo %l5\n\t" + "movq %%rax, (%0)\n\t" + "movl %3, %c4(%0)\n" + : + : "r"(&result->value), + "r"(&op1->value), + "r"(&op2->value), + "n"(IS_LONG), + "n"(ZVAL_OFFSETOF_TYPE) + : "rax","cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); +#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__) + __asm__ goto( + "ldr x5, [%1]\n\t" + "ldr x6, [%2]\n\t" + "subs x5, x5, x6\n\t" + "bvs %l5\n\t" + "mov w6, %3\n\t" + "str x5, [%0]\n\t" + "str w6, [%0, %c4]\n" + : + : "r"(&result->value), + "r"(&op1->value), + "r"(&op2->value), + "n"(IS_LONG), + "n"(ZVAL_OFFSETOF_TYPE) + : "x5", "x6", "cc", "memory" + : overflow); + return; +overflow: ZEND_ATTRIBUTE_COLD_LABEL + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); +#elif PHP_HAVE_BUILTIN_SSUBL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG + long lresult; + if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) { + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); + } else { + ZVAL_LONG(result, lresult); + } +#elif PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG + long long llresult; + if (UNEXPECTED(__builtin_ssubll_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &llresult))) { + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); + } else { + ZVAL_LONG(result, llresult); + } +#else + ZVAL_LONG(result, Z_LVAL_P(op1) - Z_LVAL_P(op2)); + + if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK) + && (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) { + ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); + } +#endif +} + +static zend_always_inline bool zend_fast_equal_strings(zend_string *s1, zend_string *s2) +{ + if (s1 == s2) { + return 1; + } else if (ZSTR_VAL(s1)[0] > '9' || ZSTR_VAL(s2)[0] > '9') { + return zend_string_equal_content(s1, s2); + } else { + return zendi_smart_streq(s1, s2); + } +} + +static zend_always_inline bool fast_equal_check_function(zval *op1, zval *op2) +{ + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + return Z_LVAL_P(op1) == Z_LVAL_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + return ((double)Z_LVAL_P(op1)) == Z_DVAL_P(op2); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + return Z_DVAL_P(op1) == Z_DVAL_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + return Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2)); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + return zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + } + } + return zend_compare(op1, op2) == 0; +} + +static zend_always_inline bool fast_equal_check_long(zval *op1, zval *op2) +{ + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + return Z_LVAL_P(op1) == Z_LVAL_P(op2); + } + return zend_compare(op1, op2) == 0; +} + +static zend_always_inline bool fast_equal_check_string(zval *op1, zval *op2) +{ + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + return zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + } + return zend_compare(op1, op2) == 0; +} + +static zend_always_inline bool fast_is_identical_function(zval *op1, zval *op2) +{ + if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { + return 0; + } else if (Z_TYPE_P(op1) <= IS_TRUE) { + return 1; + } + return zend_is_identical(op1, op2); +} + +static zend_always_inline bool fast_is_not_identical_function(zval *op1, zval *op2) +{ + if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { + return 1; + } else if (Z_TYPE_P(op1) <= IS_TRUE) { + return 0; + } + return !zend_is_identical(op1, op2); +} + +/* buf points to the END of the buffer */ +static zend_always_inline char *zend_print_ulong_to_buf(char *buf, zend_ulong num) { + *buf = '\0'; + do { + *--buf = (char) (num % 10) + '0'; + num /= 10; + } while (num > 0); + return buf; +} + +/* buf points to the END of the buffer */ +static zend_always_inline char *zend_print_long_to_buf(char *buf, zend_long num) { + if (num < 0) { + char *result = zend_print_ulong_to_buf(buf, ~((zend_ulong) num) + 1); + *--result = '-'; + return result; + } else { + return zend_print_ulong_to_buf(buf, num); + } +} + +ZEND_API zend_string* ZEND_FASTCALL zend_long_to_str(zend_long num); +ZEND_API zend_string* ZEND_FASTCALL zend_ulong_to_str(zend_ulong num); +ZEND_API zend_string* ZEND_FASTCALL zend_u64_to_str(uint64_t num); +ZEND_API zend_string* ZEND_FASTCALL zend_i64_to_str(int64_t num); +ZEND_API zend_string* ZEND_FASTCALL zend_double_to_str(double num); + +static zend_always_inline void zend_unwrap_reference(zval *op) /* {{{ */ +{ + if (Z_REFCOUNT_P(op) == 1) { + ZVAL_UNREF(op); + } else { + Z_DELREF_P(op); + ZVAL_COPY(op, Z_REFVAL_P(op)); + } +} +/* }}} */ + +static zend_always_inline bool zend_strnieq(const char *ptr1, const char *ptr2, size_t num) +{ + const char *end = ptr1 + num; + while (ptr1 < end) { + if (zend_tolower_ascii(*ptr1++) != zend_tolower_ascii(*ptr2++)) { + return 0; + } + } + return 1; +} + +static zend_always_inline const char * +zend_memnistr(const char *haystack, const char *needle, size_t needle_len, const char *end) +{ + ZEND_ASSERT(end >= haystack); + + if (UNEXPECTED(needle_len == 0)) { + return haystack; + } + + if (UNEXPECTED(needle_len > (size_t)(end - haystack))) { + return NULL; + } + + const char first_lower = zend_tolower_ascii(*needle); + const char first_upper = zend_toupper_ascii(*needle); + const char *p_lower = (const char *)memchr(haystack, first_lower, end - haystack); + const char *p_upper = NULL; + if (first_lower != first_upper) { + // If the needle length is 1 we don't need to look beyond p_lower as it is a guaranteed match + size_t upper_search_length = needle_len == 1 && p_lower != NULL ? p_lower - haystack : end - haystack; + p_upper = (const char *)memchr(haystack, first_upper, upper_search_length); + } + const char *p = !p_upper || (p_lower && p_lower < p_upper) ? p_lower : p_upper; + + if (needle_len == 1) { + return p; + } + + const char needle_end_lower = zend_tolower_ascii(needle[needle_len - 1]); + const char needle_end_upper = zend_toupper_ascii(needle[needle_len - 1]); + end -= needle_len; + + while (p && p <= end) { + if (needle_end_lower == p[needle_len - 1] || needle_end_upper == p[needle_len - 1]) { + if (zend_strnieq(needle + 1, p + 1, needle_len - 2)) { + return p; + } + } + if (p_lower == p) { + p_lower = (const char *)memchr(p_lower + 1, first_lower, end - p_lower); + } + if (p_upper == p) { + p_upper = (const char *)memchr(p_upper + 1, first_upper, end - p_upper); + } + p = !p_upper || (p_lower && p_lower < p_upper) ? p_lower : p_upper; + } + + return NULL; +} + + +END_EXTERN_C() + +#endif diff --git a/include/php/Zend/zend_portability.h b/include/php/Zend/zend_portability.h new file mode 100644 index 0000000..2ed71da --- /dev/null +++ b/include/php/Zend/zend_portability.h @@ -0,0 +1,770 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_PORTABILITY_H +#define ZEND_PORTABILITY_H + +#ifdef __cplusplus +#define BEGIN_EXTERN_C() extern "C" { +#define END_EXTERN_C() } +#else +#define BEGIN_EXTERN_C() +#define END_EXTERN_C() +#endif + +/* + * general definitions + */ + +#ifdef ZEND_WIN32 +# include "zend_config.w32.h" +# define ZEND_PATHS_SEPARATOR ';' +#elif defined(__riscos__) +# include +# define ZEND_PATHS_SEPARATOR ';' +#else +# include +# define ZEND_PATHS_SEPARATOR ':' +#endif + +#include "../TSRM/TSRM.h" + +#include +#include +#include + +#ifdef HAVE_UNIX_H +# include +#endif + +#include +#include + +#ifdef HAVE_DLFCN_H +# include +#endif + +#include + +#if defined(ZEND_WIN32) && !defined(__clang__) +#include +#endif + +#include "zend_range_check.h" + +/* GCC x.y.z supplies __GNUC__ = x and __GNUC_MINOR__ = y */ +#ifdef __GNUC__ +# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) +#else +# define ZEND_GCC_VERSION 0 +#endif + +/* Compatibility with non-clang compilers */ +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif +#ifndef __has_builtin +# define __has_builtin(x) 0 +#endif +#ifndef __has_feature +# define __has_feature(x) 0 +#endif + +#if defined(ZEND_WIN32) && !defined(__clang__) +# define ZEND_ASSUME(c) __assume(c) +#elif defined(__clang__) && __has_builtin(__builtin_assume) +# pragma clang diagnostic ignored "-Wassume" +# define ZEND_ASSUME(c) __builtin_assume(c) +#elif ((defined(__GNUC__) && ZEND_GCC_VERSION >= 4005) || __has_builtin(__builtin_unreachable)) && PHP_HAVE_BUILTIN_EXPECT +# define ZEND_ASSUME(c) do { \ + if (__builtin_expect(!(c), 0)) __builtin_unreachable(); \ + } while (0) +#else +# define ZEND_ASSUME(c) +#endif + +#if ZEND_DEBUG +# define ZEND_ASSERT(c) assert(c) +#else +# define ZEND_ASSERT(c) ZEND_ASSUME(c) +#endif + +#if ZEND_DEBUG +# define ZEND_UNREACHABLE() do {ZEND_ASSERT(0); ZEND_ASSUME(0);} while (0) +#else +# define ZEND_UNREACHABLE() ZEND_ASSUME(0) +#endif + +/* pseudo fallthrough keyword; */ +#if defined(__GNUC__) && __GNUC__ >= 7 +# define ZEND_FALLTHROUGH __attribute__((__fallthrough__)) +#else +# define ZEND_FALLTHROUGH ((void)0) +#endif + +/* Only use this macro if you know for sure that all of the switches values + are covered by its case statements */ +#define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_UNREACHABLE(); break; + +#if defined(__GNUC__) && __GNUC__ >= 4 +# define ZEND_IGNORE_VALUE(x) (({ __typeof__ (x) __x = (x); (void) __x; })) +#else +# define ZEND_IGNORE_VALUE(x) ((void) (x)) +#endif + +#define zend_quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__)) + +/* all HAVE_XXX test have to be after the include of zend_config above */ + +#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32) + +# if __has_feature(address_sanitizer) +# define __SANITIZE_ADDRESS__ +# endif + +# ifndef RTLD_LAZY +# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */ +# endif + +# ifndef RTLD_GLOBAL +# define RTLD_GLOBAL 0 +# endif + +# ifdef PHP_USE_RTLD_NOW +# define PHP_RTLD_MODE RTLD_NOW +# else +# define PHP_RTLD_MODE RTLD_LAZY +# endif + +# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT) +# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT) +# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer) +# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND) +# else +# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL) +# endif +# define DL_UNLOAD dlclose +# if defined(DLSYM_NEEDS_UNDERSCORE) +# define DL_FETCH_SYMBOL(h,s) dlsym((h), "_" s) +# else +# define DL_FETCH_SYMBOL dlsym +# endif +# define DL_ERROR dlerror +# define DL_HANDLE void * +# define ZEND_EXTENSIONS_SUPPORT 1 +#elif defined(ZEND_WIN32) +# define DL_LOAD(libname) LoadLibrary(libname) +# define DL_FETCH_SYMBOL GetProcAddress +# define DL_UNLOAD FreeLibrary +# define DL_HANDLE HMODULE +# define ZEND_EXTENSIONS_SUPPORT 1 +#else +# define DL_HANDLE void * +# define ZEND_EXTENSIONS_SUPPORT 0 +#endif + +#if defined(HAVE_ALLOCA_H) && !defined(_ALLOCA_H) +# include +#endif +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# ifndef HAVE_ALLOCA_H +# ifdef _AIX +# pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca(); +# endif +# endif +# endif +#endif + +#if !ZEND_DEBUG && (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN) +# define ZEND_ALLOCA_MAX_SIZE (32 * 1024) +# define ALLOCA_FLAG(name) \ + bool name; +# define SET_ALLOCA_FLAG(name) \ + name = true +# define do_alloca_ex(size, limit, use_heap) \ + ((use_heap = (UNEXPECTED((size) > (limit)))) ? emalloc(size) : alloca(size)) +# define do_alloca(size, use_heap) \ + do_alloca_ex(size, ZEND_ALLOCA_MAX_SIZE, use_heap) +# define free_alloca(p, use_heap) \ + do { if (UNEXPECTED(use_heap)) efree(p); } while (0) +#else +# define ALLOCA_FLAG(name) +# define SET_ALLOCA_FLAG(name) +# define do_alloca(p, use_heap) emalloc(p) +# define free_alloca(p, use_heap) efree(p) +#endif + +#if ZEND_GCC_VERSION >= 2096 || __has_attribute(__malloc__) +# define ZEND_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +#elif defined(ZEND_WIN32) +# define ZEND_ATTRIBUTE_MALLOC __declspec(allocator) __declspec(restrict) +#else +# define ZEND_ATTRIBUTE_MALLOC +#endif + +#if ZEND_GCC_VERSION >= 4003 || __has_attribute(alloc_size) +# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) __attribute__ ((alloc_size(X))) +# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) __attribute__ ((alloc_size(X,Y))) +#else +# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) +# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) +#endif + +#if ZEND_GCC_VERSION >= 3000 +# define ZEND_ATTRIBUTE_CONST __attribute__((const)) +#else +# define ZEND_ATTRIBUTE_CONST +#endif + +#if ZEND_GCC_VERSION >= 2007 || __has_attribute(format) +# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first))) +#else +# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) +#endif + +#if (ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER)) || __has_attribute(format) +# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first))) +#else +# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) +#endif + +#if ZEND_GCC_VERSION >= 3001 || __has_attribute(deprecated) +# define ZEND_ATTRIBUTE_DEPRECATED __attribute__((deprecated)) +#elif defined(ZEND_WIN32) +# define ZEND_ATTRIBUTE_DEPRECATED __declspec(deprecated) +#else +# define ZEND_ATTRIBUTE_DEPRECATED +#endif + +#if ZEND_GCC_VERSION >= 4003 || __has_attribute(unused) +# define ZEND_ATTRIBUTE_UNUSED __attribute__((unused)) +#else +# define ZEND_ATTRIBUTE_UNUSED +#endif + +#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003 +# define ZEND_COLD __attribute__((cold)) +# ifdef __OPTIMIZE__ +# define ZEND_OPT_SIZE __attribute__((optimize("Os"))) +# define ZEND_OPT_SPEED __attribute__((optimize("Ofast"))) +# else +# define ZEND_OPT_SIZE +# define ZEND_OPT_SPEED +# endif +#else +# define ZEND_COLD +# define ZEND_OPT_SIZE +# define ZEND_OPT_SPEED +#endif + +#if defined(__GNUC__) && ZEND_GCC_VERSION >= 5000 +# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((unused)); +# define ZEND_ATTRIBUTE_COLD_LABEL __attribute__((cold)); +#else +# define ZEND_ATTRIBUTE_UNUSED_LABEL +# define ZEND_ATTRIBUTE_COLD_LABEL +#endif + +#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__) +# define ZEND_FASTCALL __attribute__((fastcall)) +#elif defined(_MSC_VER) && defined(_M_IX86) && _MSC_VER == 1700 +# define ZEND_FASTCALL __fastcall +#elif defined(_MSC_VER) && _MSC_VER >= 1800 && !defined(__clang__) +# define ZEND_FASTCALL __vectorcall +#else +# define ZEND_FASTCALL +#endif + +#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn) +# define HAVE_NORETURN +# define ZEND_NORETURN __attribute__((noreturn)) +#elif defined(ZEND_WIN32) +# define HAVE_NORETURN +# define ZEND_NORETURN __declspec(noreturn) +#else +# define ZEND_NORETURN +#endif + +#if __has_attribute(force_align_arg_pointer) +# define ZEND_STACK_ALIGNED __attribute__((force_align_arg_pointer)) +#else +# define ZEND_STACK_ALIGNED +#endif + +#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) +# define HAVE_NORETURN_ALIAS +# define HAVE_ATTRIBUTE_WEAK +#endif + +#if ZEND_GCC_VERSION >= 3001 || __has_builtin(__builtin_constant_p) +# define HAVE_BUILTIN_CONSTANT_P +#endif + +#ifdef HAVE_BUILTIN_CONSTANT_P +# define ZEND_CONST_COND(_condition, _default) \ + (__builtin_constant_p(_condition) ? (_condition) : (_default)) +#else +# define ZEND_CONST_COND(_condition, _default) \ + (_default) +#endif + +#if ZEND_DEBUG || defined(ZEND_WIN32_NEVER_INLINE) +# define zend_always_inline inline +# define zend_never_inline +#else +# if defined(__GNUC__) +# if __GNUC__ >= 3 +# define zend_always_inline inline __attribute__((always_inline)) +# define zend_never_inline __attribute__((noinline)) +# else +# define zend_always_inline inline +# define zend_never_inline +# endif +# elif defined(_MSC_VER) +# define zend_always_inline __forceinline +# define zend_never_inline __declspec(noinline) +# else +# if __has_attribute(always_inline) +# define zend_always_inline inline __attribute__((always_inline)) +# else +# define zend_always_inline inline +# endif +# if __has_attribute(noinline) +# define zend_never_inline __attribute__((noinline)) +# else +# define zend_never_inline +# endif +# endif +#endif /* ZEND_DEBUG */ + +#ifdef PHP_HAVE_BUILTIN_EXPECT +# define EXPECTED(condition) __builtin_expect(!!(condition), 1) +# define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) +#else +# define EXPECTED(condition) (condition) +# define UNEXPECTED(condition) (condition) +#endif + +#ifndef XtOffsetOf +# define XtOffsetOf(s_type, field) offsetof(s_type, field) +#endif + +#ifdef HAVE_SIGSETJMP +# define SETJMP(a) sigsetjmp(a, 0) +# define LONGJMP(a,b) siglongjmp(a, b) +# define JMP_BUF sigjmp_buf +#else +# define SETJMP(a) setjmp(a) +# define LONGJMP(a,b) longjmp(a, b) +# define JMP_BUF jmp_buf +#endif + +#if ZEND_DEBUG +# define ZEND_FILE_LINE_D const char *__zend_filename, const uint32_t __zend_lineno +# define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D +# define ZEND_FILE_LINE_ORIG_D const char *__zend_orig_filename, const uint32_t __zend_orig_lineno +# define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D +# define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno +# define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C +# define ZEND_FILE_LINE_C __FILE__, __LINE__ +# define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C +# define ZEND_FILE_LINE_EMPTY_C NULL, 0 +# define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C +# define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno +# define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C +#else +# define ZEND_FILE_LINE_D void +# define ZEND_FILE_LINE_DC +# define ZEND_FILE_LINE_ORIG_D void +# define ZEND_FILE_LINE_ORIG_DC +# define ZEND_FILE_LINE_RELAY_C +# define ZEND_FILE_LINE_RELAY_CC +# define ZEND_FILE_LINE_C +# define ZEND_FILE_LINE_CC +# define ZEND_FILE_LINE_EMPTY_C +# define ZEND_FILE_LINE_EMPTY_CC +# define ZEND_FILE_LINE_ORIG_RELAY_C +# define ZEND_FILE_LINE_ORIG_RELAY_CC +#endif /* ZEND_DEBUG */ + +#if ZEND_DEBUG +# define Z_DBG(expr) (expr) +#else +# define Z_DBG(expr) +#endif + +#ifdef ZTS +# define ZTS_V 1 +#else +# define ZTS_V 0 +#endif + +#ifndef LONG_MAX +# define LONG_MAX 2147483647L +#endif + +#ifndef LONG_MIN +# define LONG_MIN (- LONG_MAX - 1) +#endif + +#define MAX_LENGTH_OF_DOUBLE 32 + +#undef MIN +#undef MAX +#define MAX(a, b) (((a)>(b))?(a):(b)) +#define MIN(a, b) (((a)<(b))?(a):(b)) + +#define ZEND_BIT_TEST(bits, bit) \ + (((bits)[(bit) / (sizeof((bits)[0])*8)] >> ((bit) & (sizeof((bits)[0])*8-1))) & 1) + +#define ZEND_INFINITY INFINITY + +#define ZEND_NAN NAN + +#if defined(__cplusplus) && __cplusplus >= 201103L +extern "C++" { +# include +} +# define zend_isnan std::isnan +# define zend_isinf std::isinf +# define zend_finite std::isfinite +#else +# include +# define zend_isnan(a) isnan(a) +# define zend_isinf(a) isinf(a) +# define zend_finite(a) isfinite(a) +#endif + +#define ZEND_STRL(str) (str), (sizeof(str)-1) +#define ZEND_STRS(str) (str), (sizeof(str)) +#define ZEND_NORMALIZE_BOOL(n) \ + ((n) ? (((n)<0) ? -1 : 1) : 0) +#define ZEND_TRUTH(x) ((x) ? 1 : 0) +#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b)) + +/** + * Do a three-way comparison of two integers and returns -1, 0 or 1 + * depending on whether #a is smaller, equal or larger than #b. + */ +#define ZEND_THREEWAY_COMPARE(a, b) ((a) == (b) ? 0 : ((a) < (b) ? -1 : 1)) + +#define ZEND_MAX_RESERVED_RESOURCES 6 + +/* excpt.h on Digital Unix 4.0 defines function_table */ +#undef function_table + +#ifdef ZEND_WIN32 +#define ZEND_SECURE_ZERO(var, size) RtlSecureZeroMemory((var), (size)) +#else +#define ZEND_SECURE_ZERO(var, size) explicit_bzero((var), (size)) +#endif + +/* This check should only be used on network socket, not file descriptors */ +#ifdef ZEND_WIN32 +#define ZEND_VALID_SOCKET(sock) (INVALID_SOCKET != (sock)) +#else +#define ZEND_VALID_SOCKET(sock) ((sock) >= 0) +#endif + +/* Intrinsics macros start. */ + +/* Memory sanitizer is incompatible with ifunc resolvers. Even if the resolver + * is marked as no_sanitize("memory") it will still be instrumented and crash. */ +#if __has_feature(memory_sanitizer) || __has_feature(thread_sanitizer) || \ + __has_feature(dataflow_sanitizer) +# undef HAVE_FUNC_ATTRIBUTE_IFUNC +#endif + +/* Only use ifunc resolvers if we have __builtin_cpu_supports() and __builtin_cpu_init(), + * otherwise the use of zend_cpu_supports() may not be safe inside ifunc resolvers. */ +#if defined(HAVE_FUNC_ATTRIBUTE_IFUNC) && defined(HAVE_FUNC_ATTRIBUTE_TARGET) && \ + defined(PHP_HAVE_BUILTIN_CPU_SUPPORTS) && defined(PHP_HAVE_BUILTIN_CPU_INIT) +# define ZEND_INTRIN_HAVE_IFUNC_TARGET 1 +#endif + +#if (defined(__i386__) || defined(__x86_64__)) +# if defined(HAVE_TMMINTRIN_H) +# define PHP_HAVE_SSSE3 +# endif + +# if defined(HAVE_NMMINTRIN_H) +# define PHP_HAVE_SSE4_2 +# endif + +# if defined(HAVE_WMMINTRIN_H) +# define PHP_HAVE_PCLMUL +# endif + +/* + * AVX2 support was added in gcc 4.7, but AVX2 intrinsics don't work in + * __attribute__((target("avx2"))) functions until gcc 4.9. + */ +# if defined(HAVE_IMMINTRIN_H) && \ + (defined(__llvm__) || defined(__clang__) || (defined(__GNUC__) && ZEND_GCC_VERSION >= 4009)) +# define PHP_HAVE_AVX2 +# endif +#endif + +#ifdef __SSSE3__ +/* Instructions compiled directly. */ +# define ZEND_INTRIN_SSSE3_NATIVE 1 +#elif (defined(HAVE_FUNC_ATTRIBUTE_TARGET) && defined(PHP_HAVE_SSSE3)) || (defined(ZEND_WIN32) && (!defined(_M_ARM64))) +/* Function resolved by ifunc or MINIT. */ +# define ZEND_INTRIN_SSSE3_RESOLVER 1 +#endif + +/* Do not use for conditional declaration of API functions! */ +#if defined(ZEND_INTRIN_SSSE3_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) +# define ZEND_INTRIN_SSSE3_FUNC_PROTO 1 +#elif defined(ZEND_INTRIN_SSSE3_RESOLVER) +# define ZEND_INTRIN_SSSE3_FUNC_PTR 1 +#endif + +#ifdef ZEND_INTRIN_SSSE3_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET +# define ZEND_INTRIN_SSSE3_FUNC_DECL(func) ZEND_API func __attribute__((target("ssse3"))) +# else +# define ZEND_INTRIN_SSSE3_FUNC_DECL(func) func +# endif +#else +# define ZEND_INTRIN_SSSE3_FUNC_DECL(func) +#endif + +#ifdef __SSE4_2__ +/* Instructions compiled directly. */ +# define ZEND_INTRIN_SSE4_2_NATIVE 1 +#elif (defined(HAVE_FUNC_ATTRIBUTE_TARGET) && defined(PHP_HAVE_SSE4_2)) || (defined(ZEND_WIN32) && (!defined(_M_ARM64))) +/* Function resolved by ifunc or MINIT. */ +# define ZEND_INTRIN_SSE4_2_RESOLVER 1 +#endif + +/* Do not use for conditional declaration of API functions! */ +#if defined(ZEND_INTRIN_SSE4_2_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) +# define ZEND_INTRIN_SSE4_2_FUNC_PROTO 1 +#elif defined(ZEND_INTRIN_SSE4_2_RESOLVER) +# define ZEND_INTRIN_SSE4_2_FUNC_PTR 1 +#endif + +#ifdef ZEND_INTRIN_SSE4_2_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET +# define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) ZEND_API func __attribute__((target("sse4.2"))) +# else +# define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) func +# endif +#else +# define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) +#endif + +#ifdef __PCLMUL__ +/* Instructions compiled directly. */ +# define ZEND_INTRIN_PCLMUL_NATIVE 1 +#elif (defined(HAVE_FUNC_ATTRIBUTE_TARGET) && defined(PHP_HAVE_PCLMUL)) || (defined(ZEND_WIN32) && (!defined(_M_ARM64))) +/* Function resolved by ifunc or MINIT. */ +# define ZEND_INTRIN_PCLMUL_RESOLVER 1 +#endif + +/* Do not use for conditional declaration of API functions! */ +#if defined(ZEND_INTRIN_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000)) +/* __builtin_cpu_supports has pclmul from gcc9 */ +# define ZEND_INTRIN_PCLMUL_FUNC_PROTO 1 +#elif defined(ZEND_INTRIN_PCLMUL_RESOLVER) +# define ZEND_INTRIN_PCLMUL_FUNC_PTR 1 +#endif + +#ifdef ZEND_INTRIN_PCLMUL_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET +# define ZEND_INTRIN_PCLMUL_FUNC_DECL(func) ZEND_API func __attribute__((target("pclmul"))) +# else +# define ZEND_INTRIN_PCLMUL_FUNC_DECL(func) func +# endif +#else +# define ZEND_INTRIN_PCLMUL_FUNC_DECL(func) +#endif + +#if defined(ZEND_INTRIN_SSE4_2_NATIVE) && defined(ZEND_INTRIN_PCLMUL_NATIVE) +/* Instructions compiled directly. */ +# define ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE 1 +#elif (defined(HAVE_FUNC_ATTRIBUTE_TARGET) && defined(PHP_HAVE_SSE4_2) && defined(PHP_HAVE_PCLMUL)) || (defined(ZEND_WIN32) && (!defined(_M_ARM64))) +/* Function resolved by ifunc or MINIT. */ +# define ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER 1 +#endif + +/* Do not use for conditional declaration of API functions! */ +#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000)) +/* __builtin_cpu_supports has pclmul from gcc9 */ +# define ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PROTO 1 +#elif defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER) +# define ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PTR 1 +#endif + +#ifdef ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET +# define ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_DECL(func) ZEND_API func __attribute__((target("sse4.2,pclmul"))) +# else +# define ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_DECL(func) func +# endif +#else +# define ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_DECL(func) +#endif + +#ifdef __AVX2__ +# define ZEND_INTRIN_AVX2_NATIVE 1 +#elif (defined(HAVE_FUNC_ATTRIBUTE_TARGET) && defined(PHP_HAVE_AVX2)) || (defined(ZEND_WIN32) && (!defined(_M_ARM64))) +# define ZEND_INTRIN_AVX2_RESOLVER 1 +#endif + +/* Do not use for conditional declaration of API functions! */ +#if defined(ZEND_INTRIN_AVX2_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) +# define ZEND_INTRIN_AVX2_FUNC_PROTO 1 +#elif defined(ZEND_INTRIN_AVX2_RESOLVER) +# define ZEND_INTRIN_AVX2_FUNC_PTR 1 +#endif + +#ifdef ZEND_INTRIN_AVX2_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET +# define ZEND_INTRIN_AVX2_FUNC_DECL(func) ZEND_API func __attribute__((target("avx2"))) +# else +# define ZEND_INTRIN_AVX2_FUNC_DECL(func) func +# endif +#else +# define ZEND_INTRIN_AVX2_FUNC_DECL(func) +#endif + +#if PHP_HAVE_AVX512_SUPPORTS && defined(HAVE_FUNC_ATTRIBUTE_TARGET) || defined(ZEND_WIN32) +#define ZEND_INTRIN_AVX512_RESOLVER 1 +#endif + +#if defined(ZEND_INTRIN_AVX512_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) +# define ZEND_INTRIN_AVX512_FUNC_PROTO 1 +#elif defined(ZEND_INTRIN_AVX512_RESOLVER) +# define ZEND_INTRIN_AVX512_FUNC_PTR 1 +#endif + +#ifdef ZEND_INTRIN_AVX512_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET +# define ZEND_INTRIN_AVX512_FUNC_DECL(func) ZEND_API func __attribute__((target("avx512f,avx512cd,avx512vl,avx512dq,avx512bw"))) +# else +# define ZEND_INTRIN_AVX512_FUNC_DECL(func) func +# endif +#else +# define ZEND_INTRIN_AVX512_FUNC_DECL(func) +#endif + +#if PHP_HAVE_AVX512_VBMI_SUPPORTS && defined(HAVE_FUNC_ATTRIBUTE_TARGET) +#define ZEND_INTRIN_AVX512_VBMI_RESOLVER 1 +#endif + +#if defined(ZEND_INTRIN_AVX512_VBMI_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) +# define ZEND_INTRIN_AVX512_VBMI_FUNC_PROTO 1 +#elif defined(ZEND_INTRIN_AVX512_VBMI_RESOLVER) +# define ZEND_INTRIN_AVX512_VBMI_FUNC_PTR 1 +#endif + +#ifdef ZEND_INTRIN_AVX512_VBMI_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET +# define ZEND_INTRIN_AVX512_VBMI_FUNC_DECL(func) ZEND_API func __attribute__((target("avx512f,avx512cd,avx512vl,avx512dq,avx512bw,avx512vbmi"))) +# else +# define ZEND_INTRIN_AVX512_VBMI_FUNC_DECL(func) func +# endif +#else +# define ZEND_INTRIN_AVX512_VBMI_FUNC_DECL(func) +#endif + +/* Intrinsics macros end. */ + +#ifdef ZEND_WIN32 +# define ZEND_SET_ALIGNED(alignment, decl) __declspec(align(alignment)) decl +#elif defined(HAVE_ATTRIBUTE_ALIGNED) +# define ZEND_SET_ALIGNED(alignment, decl) decl __attribute__ ((__aligned__ (alignment))) +#else +# define ZEND_SET_ALIGNED(alignment, decl) decl +#endif + +#define ZEND_SLIDE_TO_ALIGNED(alignment, ptr) (((uintptr_t)(ptr) + ((alignment)-1)) & ~((alignment)-1)) +#define ZEND_SLIDE_TO_ALIGNED16(ptr) ZEND_SLIDE_TO_ALIGNED(Z_UL(16), ptr) + +#ifdef ZEND_WIN32 +# define _ZEND_EXPAND_VA(a) a +# define ZEND_EXPAND_VA(code) _ZEND_EXPAND_VA(code) +#else +# define ZEND_EXPAND_VA(code) code +#endif + +/* On CPU with few registers, it's cheaper to reload value then use spill slot */ +#if defined(__i386__) || (defined(_WIN32) && !defined(_WIN64)) +# define ZEND_PREFER_RELOAD +#endif + +#if defined(ZEND_WIN32) && defined(_DEBUG) +# define ZEND_IGNORE_LEAKS_BEGIN() _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) & ~_CRTDBG_ALLOC_MEM_DF) +# define ZEND_IGNORE_LEAKS_END() _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF) +#else +# define ZEND_IGNORE_LEAKS_BEGIN() +# define ZEND_IGNORE_LEAKS_END() +#endif + +/* MSVC yields C4090 when a (const T **) is passed to a (void *); ZEND_VOIDP works around that */ +#ifdef _MSC_VER +# define ZEND_VOIDP(ptr) ((void *) ptr) +#else +# define ZEND_VOIDP(ptr) (ptr) +#endif + +#if __has_attribute(__indirect_return__) +# define ZEND_INDIRECT_RETURN __attribute__((__indirect_return__)) +#else +# define ZEND_INDIRECT_RETURN +#endif + +#define __ZEND_DO_PRAGMA(x) _Pragma(#x) +#define _ZEND_DO_PRAGMA(x) __ZEND_DO_PRAGMA(x) +#if defined(__clang__) +# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \ + _Pragma("clang diagnostic push") \ + _ZEND_DO_PRAGMA(clang diagnostic ignored warning) +# define ZEND_DIAGNOSTIC_IGNORED_END \ + _Pragma("clang diagnostic pop") +#elif defined(__GNUC__) +# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \ + _Pragma("GCC diagnostic push") \ + _ZEND_DO_PRAGMA(GCC diagnostic ignored warning) +# define ZEND_DIAGNOSTIC_IGNORED_END \ + _Pragma("GCC diagnostic pop") +#else +# define ZEND_DIAGNOSTIC_IGNORED_START(warning) +# define ZEND_DIAGNOSTIC_IGNORED_END +#endif + +/** @deprecated */ +#define ZEND_CGG_DIAGNOSTIC_IGNORED_START ZEND_DIAGNOSTIC_IGNORED_START +/** @deprecated */ +#define ZEND_CGG_DIAGNOSTIC_IGNORED_END ZEND_DIAGNOSTIC_IGNORED_END + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */ +# define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m) +#else +# define ZEND_STATIC_ASSERT(c, m) +#endif + +#endif /* ZEND_PORTABILITY_H */ diff --git a/include/php/Zend/zend_ptr_stack.h b/include/php/Zend/zend_ptr_stack.h new file mode 100644 index 0000000..1126da5 --- /dev/null +++ b/include/php/Zend/zend_ptr_stack.h @@ -0,0 +1,118 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_PTR_STACK_H +#define ZEND_PTR_STACK_H + +typedef struct _zend_ptr_stack { + int top, max; + void **elements; + void **top_element; + bool persistent; +} zend_ptr_stack; + + +#define PTR_STACK_BLOCK_SIZE 64 + +BEGIN_EXTERN_C() +ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack); +ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, bool persistent); +ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...); +ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...); +ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack); +ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)); +ZEND_API void zend_ptr_stack_reverse_apply(zend_ptr_stack *stack, void (*func)(void *)); +ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), bool free_elements); +ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack); +END_EXTERN_C() + +#define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \ + if (stack->top+count > stack->max) { \ + /* we need to allocate more memory */ \ + do { \ + stack->max += PTR_STACK_BLOCK_SIZE; \ + } while (stack->top+count > stack->max); \ + stack->elements = (void **) safe_perealloc(stack->elements, sizeof(void *), (stack->max), 0, stack->persistent); \ + stack->top_element = stack->elements+stack->top; \ + } + +/* Not doing this with a macro because of the loop unrolling in the element assignment. + Just using a macro for 3 in the body for readability sake. */ +static zend_always_inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void *a, void *b, void *c) +{ +#define ZEND_PTR_STACK_NUM_ARGS 3 + + ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) + + stack->top += ZEND_PTR_STACK_NUM_ARGS; + *(stack->top_element++) = a; + *(stack->top_element++) = b; + *(stack->top_element++) = c; + +#undef ZEND_PTR_STACK_NUM_ARGS +} + +static zend_always_inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b) +{ +#define ZEND_PTR_STACK_NUM_ARGS 2 + + ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) + + stack->top += ZEND_PTR_STACK_NUM_ARGS; + *(stack->top_element++) = a; + *(stack->top_element++) = b; + +#undef ZEND_PTR_STACK_NUM_ARGS +} + +static zend_always_inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c) +{ + *a = *(--stack->top_element); + *b = *(--stack->top_element); + *c = *(--stack->top_element); + stack->top -= 3; +} + +static zend_always_inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b) +{ + *a = *(--stack->top_element); + *b = *(--stack->top_element); + stack->top -= 2; +} + +static zend_always_inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr) +{ + ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, 1) + + stack->top++; + *(stack->top_element++) = ptr; +} + +static zend_always_inline void *zend_ptr_stack_pop(zend_ptr_stack *stack) +{ + stack->top--; + return *(--stack->top_element); +} + +static zend_always_inline void *zend_ptr_stack_top(zend_ptr_stack *stack) +{ + return stack->elements[stack->top - 1]; +} + +#endif /* ZEND_PTR_STACK_H */ diff --git a/include/php/Zend/zend_range_check.h b/include/php/Zend/zend_range_check.h new file mode 100644 index 0000000..9c82249 --- /dev/null +++ b/include/php/Zend/zend_range_check.h @@ -0,0 +1,67 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Anatol Belski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_RANGE_CHECK_H +#define ZEND_RANGE_CHECK_H + +#include "zend_long.h" + +/* Flag macros for basic range recognition. Notable is that + always sizeof(signed) == sizeof(unsigned), so no need to + overcomplicate things. */ +#if SIZEOF_INT < SIZEOF_ZEND_LONG +# define ZEND_LONG_CAN_OVFL_INT 1 +# define ZEND_LONG_CAN_OVFL_UINT 1 +#endif + +#if SIZEOF_INT < SIZEOF_SIZE_T +/* size_t can always overflow signed int on the same platform. + Furthermore, by the current design, size_t can always + overflow zend_long. */ +# define ZEND_SIZE_T_CAN_OVFL_UINT 1 +#endif + + +/* zend_long vs. (unsigned) int checks. */ +#ifdef ZEND_LONG_CAN_OVFL_INT +# define ZEND_LONG_INT_OVFL(zlong) UNEXPECTED((zlong) > (zend_long)INT_MAX) +# define ZEND_LONG_INT_UDFL(zlong) UNEXPECTED((zlong) < (zend_long)INT_MIN) +# define ZEND_LONG_EXCEEDS_INT(zlong) UNEXPECTED(ZEND_LONG_INT_OVFL(zlong) || ZEND_LONG_INT_UDFL(zlong)) +# define ZEND_LONG_UINT_OVFL(zlong) UNEXPECTED((zlong) < 0 || (zlong) > (zend_long)UINT_MAX) +#else +# define ZEND_LONG_INT_OVFL(zl) (0) +# define ZEND_LONG_INT_UDFL(zl) (0) +# define ZEND_LONG_EXCEEDS_INT(zlong) (0) +# define ZEND_LONG_UINT_OVFL(zl) (0) +#endif + +/* size_t vs (unsigned) int checks. */ +#define ZEND_SIZE_T_INT_OVFL(size) UNEXPECTED((size) > (size_t)INT_MAX) +#ifdef ZEND_SIZE_T_CAN_OVFL_UINT +# define ZEND_SIZE_T_UINT_OVFL(size) UNEXPECTED((size) > (size_t)UINT_MAX) +#else +# define ZEND_SIZE_T_UINT_OVFL(size) (0) +#endif + +/* Comparison zend_long vs size_t */ +#define ZEND_SIZE_T_GT_ZEND_LONG(size, zlong) ((zlong) < 0 || (size) > (size_t)(zlong)) +#define ZEND_SIZE_T_GTE_ZEND_LONG(size, zlong) ((zlong) < 0 || (size) >= (size_t)(zlong)) +#define ZEND_SIZE_T_LT_ZEND_LONG(size, zlong) ((zlong) >= 0 && (size) < (size_t)(zlong)) +#define ZEND_SIZE_T_LTE_ZEND_LONG(size, zlong) ((zlong) >= 0 && (size) <= (size_t)(zlong)) + +#endif /* ZEND_RANGE_CHECK_H */ diff --git a/include/php/Zend/zend_signal.h b/include/php/Zend/zend_signal.h new file mode 100644 index 0000000..93edc1f --- /dev/null +++ b/include/php/Zend/zend_signal.h @@ -0,0 +1,112 @@ +/* + +----------------------------------------------------------------------+ + | Zend Signal Handling | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Lucas Nealan | + | Arnaud Le Blanc | + +----------------------------------------------------------------------+ + + */ + +#ifndef ZEND_SIGNAL_H +#define ZEND_SIGNAL_H + +#ifdef ZEND_SIGNALS + +#include + +#ifndef NSIG +#define NSIG 65 +#endif + +#ifndef ZEND_SIGNAL_QUEUE_SIZE +#define ZEND_SIGNAL_QUEUE_SIZE 64 +#endif + +/* Signal structs */ +typedef struct _zend_signal_entry_t { + int flags; /* sigaction style flags */ + void* handler; /* signal handler or context */ +} zend_signal_entry_t; + +typedef struct _zend_signal_t { + int signo; + siginfo_t *siginfo; + void* context; +} zend_signal_t; + +typedef struct _zend_signal_queue_t { + zend_signal_t zend_signal; + struct _zend_signal_queue_t *next; +} zend_signal_queue_t; + +/* Signal Globals */ +typedef struct _zend_signal_globals_t { + int depth; + int blocked; /* 1==TRUE, 0==FALSE */ + int running; /* in signal handler execution */ + int active; /* internal signal handling is enabled */ + bool check; /* check for replaced handlers on shutdown */ + bool reset; /* reset signal handlers on each request */ + zend_signal_entry_t handlers[NSIG]; + zend_signal_queue_t pstorage[ZEND_SIGNAL_QUEUE_SIZE], *phead, *ptail, *pavail; /* pending queue */ +} zend_signal_globals_t; + +# ifdef ZTS +# define SIGG(v) ZEND_TSRMG_FAST(zend_signal_globals_offset, zend_signal_globals_t *, v) +BEGIN_EXTERN_C() +ZEND_API extern int zend_signal_globals_id; +ZEND_API extern size_t zend_signal_globals_offset; +END_EXTERN_C() +# else +# define SIGG(v) (zend_signal_globals.v) +BEGIN_EXTERN_C() +ZEND_API extern zend_signal_globals_t zend_signal_globals; +END_EXTERN_C() +# endif /* not ZTS */ + +# ifdef ZTS +# define ZEND_SIGNAL_BLOCK_INTERRUPTIONS() if (EXPECTED(zend_signal_globals_id)) { SIGG(depth)++; } +# define ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() if (EXPECTED(zend_signal_globals_id) && UNEXPECTED(((SIGG(depth)--) == SIGG(blocked)))) { zend_signal_handler_unblock(); } +# else /* ZTS */ +# define ZEND_SIGNAL_BLOCK_INTERRUPTIONS() SIGG(depth)++; +# define ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() if (((SIGG(depth)--) == SIGG(blocked))) { zend_signal_handler_unblock(); } +# endif /* not ZTS */ + +ZEND_API void zend_signal_handler_unblock(void); +void zend_signal_activate(void); +void zend_signal_deactivate(void); +BEGIN_EXTERN_C() +ZEND_API void zend_signal_startup(void); +END_EXTERN_C() +void zend_signal_init(void); + +ZEND_API void zend_signal(int signo, void (*handler)(int)); +ZEND_API void zend_sigaction(int signo, const struct sigaction *act, struct sigaction *oldact); + +#else /* ZEND_SIGNALS */ + +# define ZEND_SIGNAL_BLOCK_INTERRUPTIONS() +# define ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() + +# define zend_signal_activate() +# define zend_signal_deactivate() +# define zend_signal_startup() +# define zend_signal_init() + +# define zend_signal(signo, handler) signal(signo, handler) +# define zend_sigaction(signo, act, oldact) sigaction(signo, act, oldact) + +#endif /* ZEND_SIGNALS */ + +#endif /* ZEND_SIGNAL_H */ diff --git a/include/php/Zend/zend_smart_str.h b/include/php/Zend/zend_smart_str.h new file mode 100644 index 0000000..e271835 --- /dev/null +++ b/include/php/Zend/zend_smart_str.h @@ -0,0 +1,200 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ + */ + +#ifndef ZEND_SMART_STR_H +#define ZEND_SMART_STR_H + +#include +#include "zend_globals.h" +#include "zend_smart_str_public.h" + +BEGIN_EXTERN_C() + +ZEND_API void ZEND_FASTCALL smart_str_erealloc(smart_str *str, size_t len); +ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len); +ZEND_API void ZEND_FASTCALL smart_str_append_escaped(smart_str *str, const char *s, size_t l); +/* If zero_fraction is true, then a ".0" will be added to numbers that would not otherwise + * have a fractional part and look like integers. */ +ZEND_API void ZEND_FASTCALL smart_str_append_double( + smart_str *str, double num, int precision, bool zero_fraction); +ZEND_API void smart_str_append_printf(smart_str *dest, const char *format, ...) + ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); +ZEND_API void ZEND_FASTCALL smart_str_append_escaped_truncated(smart_str *str, const zend_string *value, size_t length); +ZEND_API void ZEND_FASTCALL smart_str_append_scalar(smart_str *str, const zval *value, size_t truncate); +END_EXTERN_C() + +static zend_always_inline size_t smart_str_alloc(smart_str *str, size_t len, bool persistent) { + if (UNEXPECTED(!str->s)) { + goto do_smart_str_realloc; + } else { + len += ZSTR_LEN(str->s); + if (UNEXPECTED(len >= str->a)) { +do_smart_str_realloc: + if (persistent) { + smart_str_realloc(str, len); + } else { + smart_str_erealloc(str, len); + } + } + } + return len; +} + +static zend_always_inline char* smart_str_extend_ex(smart_str *dest, size_t len, bool persistent) { + size_t new_len = smart_str_alloc(dest, len, persistent); + char *ret = ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s); + ZSTR_LEN(dest->s) = new_len; + return ret; +} + +static zend_always_inline char* smart_str_extend(smart_str *dest, size_t length) +{ + return smart_str_extend_ex(dest, length, false); +} + +static zend_always_inline void smart_str_free_ex(smart_str *str, bool persistent) { + if (str->s) { + zend_string_release_ex(str->s, persistent); + str->s = NULL; + } + str->a = 0; +} + +static zend_always_inline void smart_str_free(smart_str *str) +{ + smart_str_free_ex(str, false); +} + +static zend_always_inline void smart_str_0(smart_str *str) { + if (str->s) { + ZSTR_VAL(str->s)[ZSTR_LEN(str->s)] = '\0'; + } +} + +static zend_always_inline size_t smart_str_get_len(smart_str *str) { + return str->s ? ZSTR_LEN(str->s) : 0; +} + +static zend_always_inline void smart_str_trim_to_size_ex(smart_str *str, bool persistent) +{ + if (str->s && str->a > ZSTR_LEN(str->s)) { + str->s = zend_string_realloc(str->s, ZSTR_LEN(str->s), persistent); + str->a = ZSTR_LEN(str->s); + } +} + +static zend_always_inline void smart_str_trim_to_size(smart_str *dest) +{ + smart_str_trim_to_size_ex(dest, false); +} + +static zend_always_inline zend_string *smart_str_extract_ex(smart_str *str, bool persistent) { + if (str->s) { + zend_string *res; + smart_str_0(str); + smart_str_trim_to_size_ex(str, persistent); + res = str->s; + str->s = NULL; + return res; + } else { + return ZSTR_EMPTY_ALLOC(); + } +} + +static zend_always_inline zend_string *smart_str_extract(smart_str *dest) +{ + return smart_str_extract_ex(dest, false); +} + +static zend_always_inline void smart_str_appendc_ex(smart_str *dest, char ch, bool persistent) { + size_t new_len = smart_str_alloc(dest, 1, persistent); + ZSTR_VAL(dest->s)[new_len - 1] = ch; + ZSTR_LEN(dest->s) = new_len; +} + +static zend_always_inline void smart_str_appendl_ex(smart_str *dest, const char *str, size_t len, bool persistent) { + size_t new_len = smart_str_alloc(dest, len, persistent); + memcpy(ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s), str, len); + ZSTR_LEN(dest->s) = new_len; +} + +static zend_always_inline void smart_str_append_ex(smart_str *dest, const zend_string *src, bool persistent) { + smart_str_appendl_ex(dest, ZSTR_VAL(src), ZSTR_LEN(src), persistent); +} + +static zend_always_inline void smart_str_append_smart_str_ex(smart_str *dest, const smart_str *src, bool persistent) { + if (src->s && ZSTR_LEN(src->s)) { + smart_str_append_ex(dest, src->s, persistent); + } +} + +static zend_always_inline void smart_str_append_long_ex(smart_str *dest, zend_long num, bool persistent) { + char buf[32]; + char *result = zend_print_long_to_buf(buf + sizeof(buf) - 1, num); + smart_str_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent); +} + +static zend_always_inline void smart_str_append_long(smart_str *dest, zend_long num) +{ + smart_str_append_long_ex(dest, num, false); +} + +static zend_always_inline void smart_str_append_unsigned_ex(smart_str *dest, zend_ulong num, bool persistent) { + char buf[32]; + char *result = zend_print_ulong_to_buf(buf + sizeof(buf) - 1, num); + smart_str_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent); +} + +static zend_always_inline void smart_str_append_unsigned(smart_str *dest, zend_ulong num) +{ + smart_str_append_unsigned_ex(dest, num, false); +} + +static zend_always_inline void smart_str_appendl(smart_str *dest, const char *src, size_t length) +{ + smart_str_appendl_ex(dest, src, length, false); +} +static zend_always_inline void smart_str_appends_ex(smart_str *dest, const char *src, bool persistent) +{ + smart_str_appendl_ex(dest, src, strlen(src), persistent); +} +static zend_always_inline void smart_str_appends(smart_str *dest, const char *src) +{ + smart_str_appendl_ex(dest, src, strlen(src), false); +} +static zend_always_inline void smart_str_append(smart_str *dest, const zend_string *src) +{ + smart_str_append_ex(dest, src, false); +} +static zend_always_inline void smart_str_appendc(smart_str *dest, char ch) +{ + smart_str_appendc_ex(dest, ch, false); +} +static zend_always_inline void smart_str_append_smart_str(smart_str *dest, const smart_str *src) +{ + smart_str_append_smart_str_ex(dest, src, false); +} + +static zend_always_inline void smart_str_setl(smart_str *dest, const char *src, size_t len) { + smart_str_free(dest); + smart_str_appendl(dest, src, len); +} + +static zend_always_inline void smart_str_sets(smart_str *dest, const char *src) +{ + smart_str_setl(dest, src, strlen(src)); +} +#endif diff --git a/include/php/Zend/zend_smart_str_public.h b/include/php/Zend/zend_smart_str_public.h new file mode 100644 index 0000000..e81a683 --- /dev/null +++ b/include/php/Zend/zend_smart_str_public.h @@ -0,0 +1,26 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ + */ + +#ifndef ZEND_SMART_STR_PUBLIC_H +#define ZEND_SMART_STR_PUBLIC_H + +typedef struct { + /** See smart_str_extract() */ + zend_string *s; + size_t a; +} smart_str; + +#endif diff --git a/include/php/Zend/zend_smart_string.h b/include/php/Zend/zend_smart_string.h new file mode 100644 index 0000000..8149b29 --- /dev/null +++ b/include/php/Zend/zend_smart_string.h @@ -0,0 +1,113 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + | Xinchen Hui | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_SMART_STRING_H +#define PHP_SMART_STRING_H + +#include "zend_smart_string_public.h" + +#include +#include + +/* wrapper */ + +#define smart_string_appends_ex(str, src, what) \ + smart_string_appendl_ex((str), (src), strlen(src), (what)) +#define smart_string_appends(str, src) \ + smart_string_appendl((str), (src), strlen(src)) +#define smart_string_append_ex(str, src, what) \ + smart_string_appendl_ex((str), ((smart_string *)(src))->c, \ + ((smart_string *)(src))->len, (what)); +#define smart_string_sets(str, src) \ + smart_string_setl((str), (src), strlen(src)); + +#define smart_string_appendc(str, c) \ + smart_string_appendc_ex((str), (c), 0) +#define smart_string_free(s) \ + smart_string_free_ex((s), 0) +#define smart_string_appendl(str, src, len) \ + smart_string_appendl_ex((str), (src), (len), 0) +#define smart_string_append(str, src) \ + smart_string_append_ex((str), (src), 0) +#define smart_string_append_long(str, val) \ + smart_string_append_long_ex((str), (val), 0) +#define smart_string_append_unsigned(str, val) \ + smart_string_append_unsigned_ex((str), (val), 0) + +ZEND_API void ZEND_FASTCALL _smart_string_alloc_persistent(smart_string *str, size_t len); +ZEND_API void ZEND_FASTCALL _smart_string_alloc(smart_string *str, size_t len); + +static zend_always_inline size_t smart_string_alloc(smart_string *str, size_t len, bool persistent) { + if (UNEXPECTED(!str->c) || UNEXPECTED(len >= str->a - str->len)) { + if (persistent) { + _smart_string_alloc_persistent(str, len); + } else { + _smart_string_alloc(str, len); + } + } + return str->len + len; +} + +static zend_always_inline void smart_string_free_ex(smart_string *str, bool persistent) { + if (str->c) { + pefree(str->c, persistent); + str->c = NULL; + } + str->a = str->len = 0; +} + +static zend_always_inline void smart_string_0(smart_string *str) { + if (str->c) { + str->c[str->len] = '\0'; + } +} + +static zend_always_inline void smart_string_appendc_ex(smart_string *dest, char ch, bool persistent) { + dest->len = smart_string_alloc(dest, 1, persistent); + dest->c[dest->len - 1] = ch; +} + +static zend_always_inline void smart_string_appendl_ex(smart_string *dest, const char *str, size_t len, bool persistent) { + size_t new_len = smart_string_alloc(dest, len, persistent); + memcpy(dest->c + dest->len, str, len); + dest->len = new_len; + +} + +static zend_always_inline void smart_string_append_long_ex(smart_string *dest, zend_long num, bool persistent) { + char buf[32]; + char *result = zend_print_long_to_buf(buf + sizeof(buf) - 1, num); + smart_string_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent); +} + +static zend_always_inline void smart_string_append_unsigned_ex(smart_string *dest, zend_ulong num, bool persistent) { + char buf[32]; + char *result = zend_print_ulong_to_buf(buf + sizeof(buf) - 1, num); + smart_string_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent); +} + +static zend_always_inline void smart_string_setl(smart_string *dest, char *src, size_t len) { + dest->len = len; + dest->a = len + 1; + dest->c = src; +} + +static zend_always_inline void smart_string_reset(smart_string *str) { + str->len = 0; +} + +#endif diff --git a/include/php/Zend/zend_smart_string_public.h b/include/php/Zend/zend_smart_string_public.h new file mode 100644 index 0000000..543e1d3 --- /dev/null +++ b/include/php/Zend/zend_smart_string_public.h @@ -0,0 +1,29 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + | Xinchen Hui | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_SMART_STRING_PUBLIC_H +#define PHP_SMART_STRING_PUBLIC_H + +#include + +typedef struct { + char *c; + size_t len; + size_t a; +} smart_string; + +#endif diff --git a/include/php/Zend/zend_sort.h b/include/php/Zend/zend_sort.h new file mode 100644 index 0000000..e606935 --- /dev/null +++ b/include/php/Zend/zend_sort.h @@ -0,0 +1,28 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Xinchen Hui | + | Sterling Hughes | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_SORT_H +#define ZEND_SORT_H + +BEGIN_EXTERN_C() +ZEND_API void zend_sort(void *base, size_t nmemb, size_t siz, compare_func_t cmp, swap_func_t swp); +ZEND_API void zend_insert_sort(void *base, size_t nmemb, size_t siz, compare_func_t cmp, swap_func_t swp); +END_EXTERN_C() + +#endif /* ZEND_SORT_H */ diff --git a/include/php/Zend/zend_stack.h b/include/php/Zend/zend_stack.h new file mode 100644 index 0000000..68c3621 --- /dev/null +++ b/include/php/Zend/zend_stack.h @@ -0,0 +1,51 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_STACK_H +#define ZEND_STACK_H + +typedef struct _zend_stack { + int size, top, max; + void *elements; +} zend_stack; + + +#define STACK_BLOCK_SIZE 16 + +typedef enum { + ZEND_STACK_APPLY_TOPDOWN, + ZEND_STACK_APPLY_BOTTOMUP, +} zend_stack_apply_direction; + +BEGIN_EXTERN_C() +ZEND_API void zend_stack_init(zend_stack *stack, int size); +ZEND_API int zend_stack_push(zend_stack *stack, const void *element); +ZEND_API void *zend_stack_top(const zend_stack *stack); +ZEND_API void zend_stack_del_top(zend_stack *stack); +ZEND_API int zend_stack_int_top(const zend_stack *stack); +ZEND_API bool zend_stack_is_empty(const zend_stack *stack); +ZEND_API void zend_stack_destroy(zend_stack *stack); +ZEND_API void *zend_stack_base(const zend_stack *stack); +ZEND_API int zend_stack_count(const zend_stack *stack); +ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)); +ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, zend_stack_apply_direction type, int (*apply_function)(void *element, void *arg), void *arg); +ZEND_API void zend_stack_clean(zend_stack *stack, void (*func)(void *), bool free_elements); +END_EXTERN_C() + +#endif /* ZEND_STACK_H */ diff --git a/include/php/Zend/zend_stream.h b/include/php/Zend/zend_stream.h new file mode 100644 index 0000000..c1f8ddf --- /dev/null +++ b/include/php/Zend/zend_stream.h @@ -0,0 +1,100 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Wez Furlong | + | Scott MacVicar | + | Nuno Lopes | + | Marcus Boerger | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_STREAM_H +#define ZEND_STREAM_H + +#include +#include + +/* Lightweight stream implementation for the ZE scanners. + * These functions are private to the engine. + * */ +typedef size_t (*zend_stream_fsizer_t)(void* handle); +typedef ssize_t (*zend_stream_reader_t)(void* handle, char *buf, size_t len); +typedef void (*zend_stream_closer_t)(void* handle); + +#define ZEND_MMAP_AHEAD 32 + +typedef enum { + ZEND_HANDLE_FILENAME, + ZEND_HANDLE_FP, + ZEND_HANDLE_STREAM +} zend_stream_type; + +typedef struct _zend_stream { + void *handle; + int isatty; + zend_stream_reader_t reader; + zend_stream_fsizer_t fsizer; + zend_stream_closer_t closer; +} zend_stream; + +typedef struct _zend_file_handle { + union { + FILE *fp; + zend_stream stream; + } handle; + zend_string *filename; + zend_string *opened_path; + uint8_t type; /* packed zend_stream_type */ + bool primary_script; + bool in_list; /* added into CG(open_file) */ + char *buf; + size_t len; +} zend_file_handle; + +BEGIN_EXTERN_C() +ZEND_API void zend_stream_init_fp(zend_file_handle *handle, FILE *fp, const char *filename); +ZEND_API void zend_stream_init_filename(zend_file_handle *handle, const char *filename); +ZEND_API void zend_stream_init_filename_ex(zend_file_handle *handle, zend_string *filename); +ZEND_API zend_result zend_stream_open(zend_file_handle *handle); +ZEND_API zend_result zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t *len); +ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle); + +void zend_stream_init(void); +void zend_stream_shutdown(void); +END_EXTERN_C() + +#ifdef ZEND_WIN32 +# include "win32/ioutil.h" +typedef php_win32_ioutil_stat_t zend_stat_t; +#ifdef _WIN64 +# define zend_fseek _fseeki64 +# define zend_ftell _ftelli64 +# define zend_lseek _lseeki64 +# else +# define zend_fseek fseek +# define zend_ftell ftell +# define zend_lseek lseek +# endif +# define zend_fstat php_win32_ioutil_fstat +# define zend_stat php_win32_ioutil_stat +#else +typedef struct stat zend_stat_t; +# define zend_fseek fseek +# define zend_ftell ftell +# define zend_lseek lseek +# define zend_fstat fstat +# define zend_stat stat +#endif + +#endif diff --git a/include/php/Zend/zend_string.h b/include/php/Zend/zend_string.h new file mode 100644 index 0000000..1513a19 --- /dev/null +++ b/include/php/Zend/zend_string.h @@ -0,0 +1,643 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_STRING_H +#define ZEND_STRING_H + +#include "zend.h" + +BEGIN_EXTERN_C() + +typedef void (*zend_string_copy_storage_func_t)(void); +typedef zend_string *(ZEND_FASTCALL *zend_new_interned_string_func_t)(zend_string *str); +typedef zend_string *(ZEND_FASTCALL *zend_string_init_interned_func_t)(const char *str, size_t size, bool permanent); +typedef zend_string *(ZEND_FASTCALL *zend_string_init_existing_interned_func_t)(const char *str, size_t size, bool permanent); + +ZEND_API extern zend_new_interned_string_func_t zend_new_interned_string; +ZEND_API extern zend_string_init_interned_func_t zend_string_init_interned; +/* Init an interned string if it already exists, but do not create a new one if it does not. */ +ZEND_API extern zend_string_init_existing_interned_func_t zend_string_init_existing_interned; + +ZEND_API zend_ulong ZEND_FASTCALL zend_string_hash_func(zend_string *str); +ZEND_API zend_ulong ZEND_FASTCALL zend_hash_func(const char *str, size_t len); +ZEND_API zend_string* ZEND_FASTCALL zend_interned_string_find_permanent(zend_string *str); + +ZEND_API zend_string *zend_string_concat2( + const char *str1, size_t str1_len, + const char *str2, size_t str2_len); +ZEND_API zend_string *zend_string_concat3( + const char *str1, size_t str1_len, + const char *str2, size_t str2_len, + const char *str3, size_t str3_len); + +ZEND_API void zend_interned_strings_init(void); +ZEND_API void zend_interned_strings_dtor(void); +ZEND_API void zend_interned_strings_activate(void); +ZEND_API void zend_interned_strings_deactivate(void); +ZEND_API void zend_interned_strings_set_request_storage_handlers( + zend_new_interned_string_func_t handler, + zend_string_init_interned_func_t init_handler, + zend_string_init_existing_interned_func_t init_existing_handler); +ZEND_API void zend_interned_strings_switch_storage(bool request); + +ZEND_API extern zend_string *zend_empty_string; +ZEND_API extern zend_string *zend_one_char_string[256]; +ZEND_API extern zend_string **zend_known_strings; + +END_EXTERN_C() + +/* Shortcuts */ + +#define ZSTR_VAL(zstr) (zstr)->val +#define ZSTR_LEN(zstr) (zstr)->len +#define ZSTR_H(zstr) (zstr)->h +#define ZSTR_HASH(zstr) zend_string_hash_val(zstr) + +/* Compatibility macros */ + +#define IS_INTERNED(s) ZSTR_IS_INTERNED(s) +#define STR_EMPTY_ALLOC() ZSTR_EMPTY_ALLOC() +#define _STR_HEADER_SIZE _ZSTR_HEADER_SIZE +#define STR_ALLOCA_ALLOC(str, _len, use_heap) ZSTR_ALLOCA_ALLOC(str, _len, use_heap) +#define STR_ALLOCA_INIT(str, s, len, use_heap) ZSTR_ALLOCA_INIT(str, s, len, use_heap) +#define STR_ALLOCA_FREE(str, use_heap) ZSTR_ALLOCA_FREE(str, use_heap) + +/*---*/ + +#define ZSTR_IS_INTERNED(s) (GC_FLAGS(s) & IS_STR_INTERNED) +#define ZSTR_IS_VALID_UTF8(s) (GC_FLAGS(s) & IS_STR_VALID_UTF8) + +/* These are properties, encoded as flags, that will hold on the resulting string + * after concatenating two strings that have these property. + * Example: concatenating two UTF-8 strings yields another UTF-8 string. */ +#define ZSTR_COPYABLE_CONCAT_PROPERTIES (IS_STR_VALID_UTF8) + +#define ZSTR_GET_COPYABLE_CONCAT_PROPERTIES(s) (GC_FLAGS(s) & ZSTR_COPYABLE_CONCAT_PROPERTIES) +/* This macro returns the copyable concat properties which hold on both strings. */ +#define ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(s1, s2) (GC_FLAGS(s1) & GC_FLAGS(s2) & ZSTR_COPYABLE_CONCAT_PROPERTIES) + +#define ZSTR_COPY_CONCAT_PROPERTIES(out, in) do { \ + zend_string *_out = (out); \ + uint32_t properties = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES((in)); \ + GC_ADD_FLAGS(_out, properties); \ +} while (0) + +#define ZSTR_COPY_CONCAT_PROPERTIES_BOTH(out, in1, in2) do { \ + zend_string *_out = (out); \ + uint32_t properties = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH((in1), (in2)); \ + GC_ADD_FLAGS(_out, properties); \ +} while (0) + +#define ZSTR_EMPTY_ALLOC() zend_empty_string +#define ZSTR_CHAR(c) zend_one_char_string[c] +#define ZSTR_KNOWN(idx) zend_known_strings[idx] + +#define _ZSTR_HEADER_SIZE XtOffsetOf(zend_string, val) + +#define _ZSTR_STRUCT_SIZE(len) (_ZSTR_HEADER_SIZE + len + 1) + +#define ZSTR_MAX_OVERHEAD (ZEND_MM_ALIGNED_SIZE(_ZSTR_HEADER_SIZE + 1)) +#define ZSTR_MAX_LEN (SIZE_MAX - ZSTR_MAX_OVERHEAD) + +#define ZSTR_ALLOCA_ALLOC(str, _len, use_heap) do { \ + (str) = (zend_string *)do_alloca(ZEND_MM_ALIGNED_SIZE_EX(_ZSTR_STRUCT_SIZE(_len), 8), (use_heap)); \ + GC_SET_REFCOUNT(str, 1); \ + GC_TYPE_INFO(str) = GC_STRING; \ + ZSTR_H(str) = 0; \ + ZSTR_LEN(str) = _len; \ +} while (0) + +#define ZSTR_ALLOCA_INIT(str, s, len, use_heap) do { \ + ZSTR_ALLOCA_ALLOC(str, len, use_heap); \ + memcpy(ZSTR_VAL(str), (s), (len)); \ + ZSTR_VAL(str)[(len)] = '\0'; \ +} while (0) + +#define ZSTR_ALLOCA_FREE(str, use_heap) free_alloca(str, use_heap) + +#define ZSTR_INIT_LITERAL(s, persistent) (zend_string_init((s), strlen(s), (persistent))) + +/*---*/ + +static zend_always_inline zend_ulong zend_string_hash_val(zend_string *s) +{ + return ZSTR_H(s) ? ZSTR_H(s) : zend_string_hash_func(s); +} + +static zend_always_inline void zend_string_forget_hash_val(zend_string *s) +{ + ZSTR_H(s) = 0; + GC_DEL_FLAGS(s, IS_STR_VALID_UTF8); +} + +static zend_always_inline uint32_t zend_string_refcount(const zend_string *s) +{ + if (!ZSTR_IS_INTERNED(s)) { + return GC_REFCOUNT(s); + } + return 1; +} + +static zend_always_inline uint32_t zend_string_addref(zend_string *s) +{ + if (!ZSTR_IS_INTERNED(s)) { + return GC_ADDREF(s); + } + return 1; +} + +static zend_always_inline uint32_t zend_string_delref(zend_string *s) +{ + if (!ZSTR_IS_INTERNED(s)) { + return GC_DELREF(s); + } + return 1; +} + +static zend_always_inline zend_string *zend_string_alloc(size_t len, bool persistent) +{ + zend_string *ret = (zend_string *)pemalloc(ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); + + GC_SET_REFCOUNT(ret, 1); + GC_TYPE_INFO(ret) = GC_STRING | ((persistent ? IS_STR_PERSISTENT : 0) << GC_FLAGS_SHIFT); + ZSTR_H(ret) = 0; + ZSTR_LEN(ret) = len; + return ret; +} + +static zend_always_inline zend_string *zend_string_safe_alloc(size_t n, size_t m, size_t l, bool persistent) +{ + zend_string *ret = (zend_string *)safe_pemalloc(n, m, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(l)), persistent); + + GC_SET_REFCOUNT(ret, 1); + GC_TYPE_INFO(ret) = GC_STRING | ((persistent ? IS_STR_PERSISTENT : 0) << GC_FLAGS_SHIFT); + ZSTR_H(ret) = 0; + ZSTR_LEN(ret) = (n * m) + l; + return ret; +} + +static zend_always_inline zend_string *zend_string_init(const char *str, size_t len, bool persistent) +{ + zend_string *ret = zend_string_alloc(len, persistent); + + memcpy(ZSTR_VAL(ret), str, len); + ZSTR_VAL(ret)[len] = '\0'; + return ret; +} + +static zend_always_inline zend_string *zend_string_init_fast(const char *str, size_t len) +{ + if (len > 1) { + return zend_string_init(str, len, 0); + } else if (len == 0) { + return zend_empty_string; + } else /* if (len == 1) */ { + return ZSTR_CHAR((zend_uchar) *str); + } +} + +static zend_always_inline zend_string *zend_string_copy(zend_string *s) +{ + if (!ZSTR_IS_INTERNED(s)) { + GC_ADDREF(s); + } + return s; +} + +static zend_always_inline zend_string *zend_string_dup(zend_string *s, bool persistent) +{ + if (ZSTR_IS_INTERNED(s)) { + return s; + } else { + return zend_string_init(ZSTR_VAL(s), ZSTR_LEN(s), persistent); + } +} + +static zend_always_inline zend_string *zend_string_separate(zend_string *s, bool persistent) +{ + if (ZSTR_IS_INTERNED(s) || GC_REFCOUNT(s) > 1) { + if (!ZSTR_IS_INTERNED(s)) { + GC_DELREF(s); + } + return zend_string_init(ZSTR_VAL(s), ZSTR_LEN(s), persistent); + } + + zend_string_forget_hash_val(s); + return s; +} + +static zend_always_inline zend_string *zend_string_realloc(zend_string *s, size_t len, bool persistent) +{ + zend_string *ret; + + if (!ZSTR_IS_INTERNED(s)) { + if (EXPECTED(GC_REFCOUNT(s) == 1)) { + ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); + ZSTR_LEN(ret) = len; + zend_string_forget_hash_val(ret); + return ret; + } + } + ret = zend_string_alloc(len, persistent); + memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), MIN(len, ZSTR_LEN(s)) + 1); + if (!ZSTR_IS_INTERNED(s)) { + GC_DELREF(s); + } + return ret; +} + +static zend_always_inline zend_string *zend_string_extend(zend_string *s, size_t len, bool persistent) +{ + zend_string *ret; + + ZEND_ASSERT(len >= ZSTR_LEN(s)); + if (!ZSTR_IS_INTERNED(s)) { + if (EXPECTED(GC_REFCOUNT(s) == 1)) { + ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); + ZSTR_LEN(ret) = len; + zend_string_forget_hash_val(ret); + return ret; + } + } + ret = zend_string_alloc(len, persistent); + memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), ZSTR_LEN(s) + 1); + if (!ZSTR_IS_INTERNED(s)) { + GC_DELREF(s); + } + return ret; +} + +static zend_always_inline zend_string *zend_string_truncate(zend_string *s, size_t len, bool persistent) +{ + zend_string *ret; + + ZEND_ASSERT(len <= ZSTR_LEN(s)); + if (!ZSTR_IS_INTERNED(s)) { + if (EXPECTED(GC_REFCOUNT(s) == 1)) { + ret = (zend_string *)perealloc(s, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(len)), persistent); + ZSTR_LEN(ret) = len; + zend_string_forget_hash_val(ret); + return ret; + } + } + ret = zend_string_alloc(len, persistent); + memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), len + 1); + if (!ZSTR_IS_INTERNED(s)) { + GC_DELREF(s); + } + return ret; +} + +static zend_always_inline zend_string *zend_string_safe_realloc(zend_string *s, size_t n, size_t m, size_t l, bool persistent) +{ + zend_string *ret; + + if (!ZSTR_IS_INTERNED(s)) { + if (GC_REFCOUNT(s) == 1) { + ret = (zend_string *)safe_perealloc(s, n, m, ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(l)), persistent); + ZSTR_LEN(ret) = (n * m) + l; + zend_string_forget_hash_val(ret); + return ret; + } + } + ret = zend_string_safe_alloc(n, m, l, persistent); + memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), MIN((n * m) + l, ZSTR_LEN(s)) + 1); + if (!ZSTR_IS_INTERNED(s)) { + GC_DELREF(s); + } + return ret; +} + +static zend_always_inline void zend_string_free(zend_string *s) +{ + if (!ZSTR_IS_INTERNED(s)) { + ZEND_ASSERT(GC_REFCOUNT(s) <= 1); + pefree(s, GC_FLAGS(s) & IS_STR_PERSISTENT); + } +} + +static zend_always_inline void zend_string_efree(zend_string *s) +{ + ZEND_ASSERT(!ZSTR_IS_INTERNED(s)); + ZEND_ASSERT(GC_REFCOUNT(s) <= 1); + ZEND_ASSERT(!(GC_FLAGS(s) & IS_STR_PERSISTENT)); + efree(s); +} + +static zend_always_inline void zend_string_release(zend_string *s) +{ + if (!ZSTR_IS_INTERNED(s)) { + if (GC_DELREF(s) == 0) { + pefree(s, GC_FLAGS(s) & IS_STR_PERSISTENT); + } + } +} + +static zend_always_inline void zend_string_release_ex(zend_string *s, bool persistent) +{ + if (!ZSTR_IS_INTERNED(s)) { + if (GC_DELREF(s) == 0) { + if (persistent) { + ZEND_ASSERT(GC_FLAGS(s) & IS_STR_PERSISTENT); + free(s); + } else { + ZEND_ASSERT(!(GC_FLAGS(s) & IS_STR_PERSISTENT)); + efree(s); + } + } + } +} + +static zend_always_inline bool zend_string_equals_cstr(const zend_string *s1, const char *s2, size_t s2_length) +{ + return ZSTR_LEN(s1) == s2_length && !memcmp(ZSTR_VAL(s1), s2, s2_length); +} + +#if defined(__GNUC__) && (defined(__i386__) || (defined(__x86_64__) && !defined(__ILP32__))) +BEGIN_EXTERN_C() +ZEND_API bool ZEND_FASTCALL zend_string_equal_val(const zend_string *s1, const zend_string *s2); +END_EXTERN_C() +#else +static zend_always_inline bool zend_string_equal_val(const zend_string *s1, const zend_string *s2) +{ + return !memcmp(ZSTR_VAL(s1), ZSTR_VAL(s2), ZSTR_LEN(s1)); +} +#endif + +static zend_always_inline bool zend_string_equal_content(const zend_string *s1, const zend_string *s2) +{ + return ZSTR_LEN(s1) == ZSTR_LEN(s2) && zend_string_equal_val(s1, s2); +} + +static zend_always_inline bool zend_string_equals(const zend_string *s1, const zend_string *s2) +{ + return s1 == s2 || zend_string_equal_content(s1, s2); +} + +#define zend_string_equals_ci(s1, s2) \ + (ZSTR_LEN(s1) == ZSTR_LEN(s2) && !zend_binary_strcasecmp(ZSTR_VAL(s1), ZSTR_LEN(s1), ZSTR_VAL(s2), ZSTR_LEN(s2))) + +#define zend_string_equals_literal_ci(str, c) \ + (ZSTR_LEN(str) == sizeof("" c) - 1 && !zend_binary_strcasecmp(ZSTR_VAL(str), ZSTR_LEN(str), (c), sizeof(c) - 1)) + +#define zend_string_equals_literal(str, literal) \ + zend_string_equals_cstr(str, "" literal, sizeof(literal) - 1) + +static zend_always_inline bool zend_string_starts_with_cstr(const zend_string *str, const char *prefix, size_t prefix_length) +{ + return ZSTR_LEN(str) >= prefix_length && !memcmp(ZSTR_VAL(str), prefix, prefix_length); +} + +static zend_always_inline bool zend_string_starts_with(const zend_string *str, const zend_string *prefix) +{ + return zend_string_starts_with_cstr(str, ZSTR_VAL(prefix), ZSTR_LEN(prefix)); +} + +#define zend_string_starts_with_literal(str, prefix) \ + zend_string_starts_with_cstr(str, prefix, strlen(prefix)) + +static zend_always_inline bool zend_string_starts_with_cstr_ci(const zend_string *str, const char *prefix, size_t prefix_length) +{ + return ZSTR_LEN(str) >= prefix_length && !strncasecmp(ZSTR_VAL(str), prefix, prefix_length); +} + +static zend_always_inline bool zend_string_starts_with_ci(const zend_string *str, const zend_string *prefix) +{ + return zend_string_starts_with_cstr_ci(str, ZSTR_VAL(prefix), ZSTR_LEN(prefix)); +} + +#define zend_string_starts_with_literal_ci(str, prefix) \ + zend_string_starts_with_cstr(str, prefix, strlen(prefix)) + +/* + * DJBX33A (Daniel J. Bernstein, Times 33 with Addition) + * + * This is Daniel J. Bernstein's popular `times 33' hash function as + * posted by him years ago on comp.lang.c. It basically uses a function + * like ``hash(i) = hash(i-1) * 33 + str[i]''. This is one of the best + * known hash functions for strings. Because it is both computed very + * fast and distributes very well. + * + * The magic of number 33, i.e. why it works better than many other + * constants, prime or not, has never been adequately explained by + * anyone. So I try an explanation: if one experimentally tests all + * multipliers between 1 and 256 (as RSE did now) one detects that even + * numbers are not usable at all. The remaining 128 odd numbers + * (except for the number 1) work more or less all equally well. They + * all distribute in an acceptable way and this way fill a hash table + * with an average percent of approx. 86%. + * + * If one compares the Chi^2 values of the variants, the number 33 not + * even has the best value. But the number 33 and a few other equally + * good numbers like 17, 31, 63, 127 and 129 have nevertheless a great + * advantage to the remaining numbers in the large set of possible + * multipliers: their multiply operation can be replaced by a faster + * operation based on just one shift plus either a single addition + * or subtraction operation. And because a hash function has to both + * distribute good _and_ has to be very fast to compute, those few + * numbers should be preferred and seems to be the reason why Daniel J. + * Bernstein also preferred it. + * + * + * -- Ralf S. Engelschall + */ + +static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size_t len) +{ + zend_ulong hash = Z_UL(5381); + +#if defined(_WIN32) || defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) + /* Version with multiplication works better on modern CPU */ + for (; len >= 8; len -= 8, str += 8) { +# if defined(__aarch64__) && !defined(WORDS_BIGENDIAN) + /* On some architectures it is beneficial to load 8 bytes at a + time and extract each byte with a bit field extract instr. */ + uint64_t chunk; + + memcpy(&chunk, str, sizeof(chunk)); + hash = + hash * 33 * 33 * 33 * 33 + + ((chunk >> (8 * 0)) & 0xff) * 33 * 33 * 33 + + ((chunk >> (8 * 1)) & 0xff) * 33 * 33 + + ((chunk >> (8 * 2)) & 0xff) * 33 + + ((chunk >> (8 * 3)) & 0xff); + hash = + hash * 33 * 33 * 33 * 33 + + ((chunk >> (8 * 4)) & 0xff) * 33 * 33 * 33 + + ((chunk >> (8 * 5)) & 0xff) * 33 * 33 + + ((chunk >> (8 * 6)) & 0xff) * 33 + + ((chunk >> (8 * 7)) & 0xff); +# else + hash = + hash * Z_L(33 * 33 * 33 * 33) + + str[0] * Z_L(33 * 33 * 33) + + str[1] * Z_L(33 * 33) + + str[2] * Z_L(33) + + str[3]; + hash = + hash * Z_L(33 * 33 * 33 * 33) + + str[4] * Z_L(33 * 33 * 33) + + str[5] * Z_L(33 * 33) + + str[6] * Z_L(33) + + str[7]; +# endif + } + if (len >= 4) { + hash = + hash * Z_L(33 * 33 * 33 * 33) + + str[0] * Z_L(33 * 33 * 33) + + str[1] * Z_L(33 * 33) + + str[2] * Z_L(33) + + str[3]; + len -= 4; + str += 4; + } + if (len >= 2) { + if (len > 2) { + hash = + hash * Z_L(33 * 33 * 33) + + str[0] * Z_L(33 * 33) + + str[1] * Z_L(33) + + str[2]; + } else { + hash = + hash * Z_L(33 * 33) + + str[0] * Z_L(33) + + str[1]; + } + } else if (len != 0) { + hash = hash * Z_L(33) + *str; + } +#else + /* variant with the hash unrolled eight times */ + for (; len >= 8; len -= 8) { + hash = ((hash << 5) + hash) + *str++; + hash = ((hash << 5) + hash) + *str++; + hash = ((hash << 5) + hash) + *str++; + hash = ((hash << 5) + hash) + *str++; + hash = ((hash << 5) + hash) + *str++; + hash = ((hash << 5) + hash) + *str++; + hash = ((hash << 5) + hash) + *str++; + hash = ((hash << 5) + hash) + *str++; + } + switch (len) { + case 7: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */ + case 6: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */ + case 5: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */ + case 4: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */ + case 3: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */ + case 2: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */ + case 1: hash = ((hash << 5) + hash) + *str++; break; + case 0: break; +EMPTY_SWITCH_DEFAULT_CASE() + } +#endif + + /* Hash value can't be zero, so we always set the high bit */ +#if SIZEOF_ZEND_LONG == 8 + return hash | Z_UL(0x8000000000000000); +#elif SIZEOF_ZEND_LONG == 4 + return hash | Z_UL(0x80000000); +#else +# error "Unknown SIZEOF_ZEND_LONG" +#endif +} + +#define ZEND_KNOWN_STRINGS(_) \ + _(ZEND_STR_FILE, "file") \ + _(ZEND_STR_LINE, "line") \ + _(ZEND_STR_FUNCTION, "function") \ + _(ZEND_STR_CLASS, "class") \ + _(ZEND_STR_OBJECT, "object") \ + _(ZEND_STR_TYPE, "type") \ + _(ZEND_STR_OBJECT_OPERATOR, "->") \ + _(ZEND_STR_PAAMAYIM_NEKUDOTAYIM, "::") \ + _(ZEND_STR_ARGS, "args") \ + _(ZEND_STR_UNKNOWN, "unknown") \ + _(ZEND_STR_UNKNOWN_CAPITALIZED, "Unknown") \ + _(ZEND_STR_EVAL, "eval") \ + _(ZEND_STR_INCLUDE, "include") \ + _(ZEND_STR_REQUIRE, "require") \ + _(ZEND_STR_INCLUDE_ONCE, "include_once") \ + _(ZEND_STR_REQUIRE_ONCE, "require_once") \ + _(ZEND_STR_SCALAR, "scalar") \ + _(ZEND_STR_ERROR_REPORTING, "error_reporting") \ + _(ZEND_STR_STATIC, "static") \ + _(ZEND_STR_THIS, "this") \ + _(ZEND_STR_VALUE, "value") \ + _(ZEND_STR_KEY, "key") \ + _(ZEND_STR_MAGIC_INVOKE, "__invoke") \ + _(ZEND_STR_PREVIOUS, "previous") \ + _(ZEND_STR_CODE, "code") \ + _(ZEND_STR_MESSAGE, "message") \ + _(ZEND_STR_SEVERITY, "severity") \ + _(ZEND_STR_STRING, "string") \ + _(ZEND_STR_TRACE, "trace") \ + _(ZEND_STR_SCHEME, "scheme") \ + _(ZEND_STR_HOST, "host") \ + _(ZEND_STR_PORT, "port") \ + _(ZEND_STR_USER, "user") \ + _(ZEND_STR_PASS, "pass") \ + _(ZEND_STR_PATH, "path") \ + _(ZEND_STR_QUERY, "query") \ + _(ZEND_STR_FRAGMENT, "fragment") \ + _(ZEND_STR_NULL, "NULL") \ + _(ZEND_STR_BOOLEAN, "boolean") \ + _(ZEND_STR_INTEGER, "integer") \ + _(ZEND_STR_DOUBLE, "double") \ + _(ZEND_STR_ARRAY, "array") \ + _(ZEND_STR_RESOURCE, "resource") \ + _(ZEND_STR_CLOSED_RESOURCE, "resource (closed)") \ + _(ZEND_STR_NAME, "name") \ + _(ZEND_STR_ARGV, "argv") \ + _(ZEND_STR_ARGC, "argc") \ + _(ZEND_STR_ARRAY_CAPITALIZED, "Array") \ + _(ZEND_STR_BOOL, "bool") \ + _(ZEND_STR_INT, "int") \ + _(ZEND_STR_FLOAT, "float") \ + _(ZEND_STR_CALLABLE, "callable") \ + _(ZEND_STR_ITERABLE, "iterable") \ + _(ZEND_STR_VOID, "void") \ + _(ZEND_STR_NEVER, "never") \ + _(ZEND_STR_FALSE, "false") \ + _(ZEND_STR_TRUE, "true") \ + _(ZEND_STR_NULL_LOWERCASE, "null") \ + _(ZEND_STR_MIXED, "mixed") \ + _(ZEND_STR_TRAVERSABLE, "Traversable") \ + _(ZEND_STR_SLEEP, "__sleep") \ + _(ZEND_STR_WAKEUP, "__wakeup") \ + _(ZEND_STR_CASES, "cases") \ + _(ZEND_STR_FROM, "from") \ + _(ZEND_STR_TRYFROM, "tryFrom") \ + _(ZEND_STR_TRYFROM_LOWERCASE, "tryfrom") \ + _(ZEND_STR_AUTOGLOBAL_SERVER, "_SERVER") \ + _(ZEND_STR_AUTOGLOBAL_ENV, "_ENV") \ + _(ZEND_STR_AUTOGLOBAL_REQUEST, "_REQUEST") \ + _(ZEND_STR_COUNT, "count") \ + _(ZEND_STR_SENSITIVEPARAMETER, "SensitiveParameter") \ + _(ZEND_STR_CONST_EXPR_PLACEHOLDER, "[constant expression]") \ + + +typedef enum _zend_known_string_id { +#define _ZEND_STR_ID(id, str) id, +ZEND_KNOWN_STRINGS(_ZEND_STR_ID) +#undef _ZEND_STR_ID + ZEND_STR_LAST_KNOWN +} zend_known_string_id; + +#endif /* ZEND_STRING_H */ diff --git a/include/php/Zend/zend_strtod.h b/include/php/Zend/zend_strtod.h new file mode 100644 index 0000000..b049e56 --- /dev/null +++ b/include/php/Zend/zend_strtod.h @@ -0,0 +1,45 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Derick Rethans | + +----------------------------------------------------------------------+ +*/ + +/* This is a header file for the strtod implementation by David M. Gay which + * can be found in zend_strtod.c */ +#ifndef ZEND_STRTOD_H +#define ZEND_STRTOD_H +#include + +BEGIN_EXTERN_C() +ZEND_API void zend_freedtoa(char *s); +ZEND_API char *zend_dtoa(double _d, int mode, int ndigits, int *decpt, bool *sign, char **rve); +ZEND_API char *zend_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf); +ZEND_API double zend_strtod(const char *s00, const char **se); +ZEND_API double zend_hex_strtod(const char *str, const char **endptr); +ZEND_API double zend_oct_strtod(const char *str, const char **endptr); +ZEND_API double zend_bin_strtod(const char *str, const char **endptr); +ZEND_API int zend_startup_strtod(void); +ZEND_API int zend_shutdown_strtod(void); +END_EXTERN_C() + +/* double limits */ +#include +#if defined(DBL_MANT_DIG) && defined(DBL_MIN_EXP) +#define ZEND_DOUBLE_MAX_LENGTH (3 + DBL_MANT_DIG - DBL_MIN_EXP) +#else +#define ZEND_DOUBLE_MAX_LENGTH 1080 +#endif + +#endif diff --git a/include/php/Zend/zend_strtod_int.h b/include/php/Zend/zend_strtod_int.h new file mode 100644 index 0000000..f528b47 --- /dev/null +++ b/include/php/Zend/zend_strtod_int.h @@ -0,0 +1,127 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Anatol Belski | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_STRTOD_INT_H +#define ZEND_STRTOD_INT_H + +#ifdef ZTS +#include +#endif + +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +/* TODO check to undef this option, this might + make more perf. destroy_freelist() + should be adapted then. */ +#define Omit_Private_Memory 1 + +/* HEX strings aren't supported as per + https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings */ +#define NO_HEX_FP 1 + +#include + +#ifdef USE_LOCALE +#undef USE_LOCALE +#endif + +#ifndef NO_INFNAN_CHECK +#define NO_INFNAN_CHECK +#endif + +#ifndef NO_ERRNO +#define NO_ERRNO +#endif + +#ifdef WORDS_BIGENDIAN +#define IEEE_BIG_ENDIAN 1 +#else +#define IEEE_LITTLE_ENDIAN 1 +#endif + +#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) +# if defined(__LITTLE_ENDIAN__) +# undef WORDS_BIGENDIAN +# else +# if defined(__BIG_ENDIAN__) +# define WORDS_BIGENDIAN +# endif +# endif +#endif + +#if defined(__arm__) && !defined(__VFP_FP__) +/* + * * Although the CPU is little endian the FP has different + * * byte and word endianness. The byte order is still little endian + * * but the word order is big endian. + * */ +#define IEEE_BIG_ENDIAN +#undef IEEE_LITTLE_ENDIAN +#endif + +#ifdef __vax__ +#define VAX +#undef IEEE_LITTLE_ENDIAN +#endif + +#ifdef IEEE_LITTLE_ENDIAN +#define IEEE_8087 1 +#endif + +#ifdef IEEE_BIG_ENDIAN +#define IEEE_MC68k 1 +#endif + +#if defined(_MSC_VER) +#ifndef int32_t +#define int32_t __int32 +#endif +#ifndef uint32_t +#define uint32_t unsigned __int32 +#endif +#endif + +#ifdef ZTS +#define MULTIPLE_THREADS 1 + +#define ACQUIRE_DTOA_LOCK(x) \ + if (0 == x) { \ + tsrm_mutex_lock(dtoa_mutex); \ + } else if (1 == x) { \ + tsrm_mutex_lock(pow5mult_mutex); \ + } + +#define FREE_DTOA_LOCK(x) \ + if (0 == x) { \ + tsrm_mutex_unlock(dtoa_mutex); \ + } else if (1 == x) { \ + tsrm_mutex_unlock(pow5mult_mutex); \ + } + + +#endif + +#endif /* ZEND_STRTOD_INT_H */ diff --git a/include/php/Zend/zend_system_id.h b/include/php/Zend/zend_system_id.h new file mode 100644 index 0000000..60514e1 --- /dev/null +++ b/include/php/Zend/zend_system_id.h @@ -0,0 +1,30 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sammy Kaye Powers | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_SYSTEM_ID_H +#define ZEND_SYSTEM_ID_H + +BEGIN_EXTERN_C() +/* True global; Write-only during MINIT/startup */ +extern ZEND_API char zend_system_id[32]; + +ZEND_API ZEND_RESULT_CODE zend_add_system_entropy(const char *module_name, const char *hook_name, const void *data, size_t size); +END_EXTERN_C() + +void zend_startup_system_id(void); +void zend_finalize_system_id(void); + +#endif /* ZEND_SYSTEM_ID_H */ diff --git a/include/php/Zend/zend_type_info.h b/include/php/Zend/zend_type_info.h new file mode 100644 index 0000000..eeab7bf --- /dev/null +++ b/include/php/Zend/zend_type_info.h @@ -0,0 +1,84 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_TYPE_INFO_H +#define ZEND_TYPE_INFO_H + +#include "zend_types.h" + +#define MAY_BE_UNDEF (1 << IS_UNDEF) +#define MAY_BE_NULL (1 << IS_NULL) +#define MAY_BE_FALSE (1 << IS_FALSE) +#define MAY_BE_TRUE (1 << IS_TRUE) +#define MAY_BE_BOOL (MAY_BE_FALSE|MAY_BE_TRUE) +#define MAY_BE_LONG (1 << IS_LONG) +#define MAY_BE_DOUBLE (1 << IS_DOUBLE) +#define MAY_BE_STRING (1 << IS_STRING) +#define MAY_BE_ARRAY (1 << IS_ARRAY) +#define MAY_BE_OBJECT (1 << IS_OBJECT) +#define MAY_BE_RESOURCE (1 << IS_RESOURCE) +#define MAY_BE_ANY (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE) +#define MAY_BE_REF (1 << IS_REFERENCE) /* may be reference */ + +/* These are used in zend_type, but not for type inference. + * They are allowed to overlap with types used during inference. */ +#define MAY_BE_CALLABLE (1 << IS_CALLABLE) +#define MAY_BE_VOID (1 << IS_VOID) +#define MAY_BE_NEVER (1 << IS_NEVER) +#define MAY_BE_STATIC (1 << IS_STATIC) + +#define MAY_BE_ARRAY_SHIFT (IS_REFERENCE) + +#define MAY_BE_ARRAY_OF_NULL (MAY_BE_NULL << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_FALSE (MAY_BE_FALSE << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_TRUE (MAY_BE_TRUE << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_LONG (MAY_BE_LONG << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_DOUBLE (MAY_BE_DOUBLE << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_STRING (MAY_BE_STRING << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_ARRAY (MAY_BE_ARRAY << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_OBJECT (MAY_BE_OBJECT << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_RESOURCE (MAY_BE_RESOURCE << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_ANY (MAY_BE_ANY << MAY_BE_ARRAY_SHIFT) +#define MAY_BE_ARRAY_OF_REF (MAY_BE_REF << MAY_BE_ARRAY_SHIFT) + +#define MAY_BE_ARRAY_PACKED (1<<21) +#define MAY_BE_ARRAY_NUMERIC_HASH (1<<22) /* hash with numeric keys */ +#define MAY_BE_ARRAY_STRING_HASH (1<<23) /* hash with string keys */ +#define MAY_BE_ARRAY_EMPTY (1<<29) + +#define MAY_BE_ARRAY_KEY_LONG (MAY_BE_ARRAY_PACKED | MAY_BE_ARRAY_NUMERIC_HASH) +#define MAY_BE_ARRAY_KEY_STRING MAY_BE_ARRAY_STRING_HASH +#define MAY_BE_ARRAY_KEY_ANY (MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_EMPTY) + +#define MAY_BE_PACKED(t) ((t) & MAY_BE_ARRAY_PACKED) +#define MAY_BE_HASH(t) ((t) & (MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_KEY_STRING)) +#define MAY_BE_PACKED_ONLY(t) (((t) & MAY_BE_ARRAY_KEY_ANY) == MAY_BE_ARRAY_PACKED) +#define MAY_BE_HASH_ONLY(t) (MAY_BE_HASH(t) && !((t) & (MAY_BE_ARRAY_PACKED|MAY_BE_ARRAY_EMPTY))) +#define MAY_BE_EMPTY_ONLY(t) (((t) & MAY_BE_ARRAY_KEY_ANY) == MAY_BE_ARRAY_EMPTY) + +#define MAY_BE_CLASS (1<<24) +#define MAY_BE_INDIRECT (1<<25) + +#define MAY_BE_RC1 (1<<30) /* may be non-reference with refcount == 1 */ +#define MAY_BE_RCN (1u<<31) /* may be non-reference with refcount > 1 */ + + +#define MAY_BE_ANY_ARRAY \ + (MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF) + +#endif /* ZEND_TYPE_INFO_H */ diff --git a/include/php/Zend/zend_types.h b/include/php/Zend/zend_types.h new file mode 100644 index 0000000..c4a07f5 --- /dev/null +++ b/include/php/Zend/zend_types.h @@ -0,0 +1,1577 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + | Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_TYPES_H +#define ZEND_TYPES_H + +#include "zend_portability.h" +#include "zend_long.h" +#include +#include + +#ifdef __SSE2__ +# include +# include +#endif +#if defined(__AVX2__) +# include +#endif +#if defined(__aarch64__) || defined(_M_ARM64) +# include +#endif + +#ifdef WORDS_BIGENDIAN +# define ZEND_ENDIAN_LOHI(lo, hi) hi; lo; +# define ZEND_ENDIAN_LOHI_3(lo, mi, hi) hi; mi; lo; +# define ZEND_ENDIAN_LOHI_4(a, b, c, d) d; c; b; a; +# define ZEND_ENDIAN_LOHI_C(lo, hi) hi, lo +# define ZEND_ENDIAN_LOHI_C_3(lo, mi, hi) hi, mi, lo, +# define ZEND_ENDIAN_LOHI_C_4(a, b, c, d) d, c, b, a +#else +# define ZEND_ENDIAN_LOHI(lo, hi) lo; hi; +# define ZEND_ENDIAN_LOHI_3(lo, mi, hi) lo; mi; hi; +# define ZEND_ENDIAN_LOHI_4(a, b, c, d) a; b; c; d; +# define ZEND_ENDIAN_LOHI_C(lo, hi) lo, hi +# define ZEND_ENDIAN_LOHI_C_3(lo, mi, hi) lo, mi, hi, +# define ZEND_ENDIAN_LOHI_C_4(a, b, c, d) a, b, c, d +#endif + +typedef unsigned char zend_uchar; + +typedef enum { + SUCCESS = 0, + FAILURE = -1, /* this MUST stay a negative number, or it may affect functions! */ +} ZEND_RESULT_CODE; + +typedef ZEND_RESULT_CODE zend_result; + +#ifdef ZEND_ENABLE_ZVAL_LONG64 +# ifdef ZEND_WIN32 +# define ZEND_SIZE_MAX _UI64_MAX +# else +# define ZEND_SIZE_MAX SIZE_MAX +# endif +#else +# if defined(ZEND_WIN32) +# define ZEND_SIZE_MAX _UI32_MAX +# else +# define ZEND_SIZE_MAX SIZE_MAX +# endif +#endif + +#ifdef ZTS +#define ZEND_TLS static TSRM_TLS +#define ZEND_EXT_TLS TSRM_TLS +#else +#define ZEND_TLS static +#define ZEND_EXT_TLS +#endif + +typedef struct _zend_object_handlers zend_object_handlers; +typedef struct _zend_class_entry zend_class_entry; +typedef union _zend_function zend_function; +typedef struct _zend_execute_data zend_execute_data; + +typedef struct _zval_struct zval; + +typedef struct _zend_refcounted zend_refcounted; +typedef struct _zend_string zend_string; +typedef struct _zend_array zend_array; +typedef struct _zend_object zend_object; +typedef struct _zend_resource zend_resource; +typedef struct _zend_reference zend_reference; +typedef struct _zend_ast_ref zend_ast_ref; +typedef struct _zend_ast zend_ast; + +typedef int (*compare_func_t)(const void *, const void *); +typedef void (*swap_func_t)(void *, void *); +typedef void (*sort_func_t)(void *, size_t, size_t, compare_func_t, swap_func_t); +typedef void (*dtor_func_t)(zval *pDest); +typedef void (*copy_ctor_func_t)(zval *pElement); + +/* + * zend_type - is an abstraction layer to represent information about type hint. + * It shouldn't be used directly. Only through ZEND_TYPE_* macros. + * + * ZEND_TYPE_IS_SET() - checks if there is a type-hint + * ZEND_TYPE_IS_ONLY_MASK() - checks if type-hint refer to standard type only + * ZEND_TYPE_IS_COMPLEX() - checks if type is a type_list, or contains a class either as a CE or as a name + * ZEND_TYPE_HAS_NAME() - checks if type-hint contains some class as zend_string * + * ZEND_TYPE_HAS_LITERAL_NAME() - checks if type-hint contains some class as const char * + * ZEND_TYPE_IS_INTERSECTION() - checks if the type_list represents an intersection type list + * ZEND_TYPE_IS_UNION() - checks if the type_list represents a union type list + * + * ZEND_TYPE_NAME() - returns referenced class name + * ZEND_TYPE_PURE_MASK() - returns MAY_BE_* type mask + * ZEND_TYPE_FULL_MASK() - returns MAY_BE_* type mask together with other flags + * + * ZEND_TYPE_ALLOW_NULL() - checks if NULL is allowed + * + * ZEND_TYPE_INIT_*() should be used for construction. + */ + +typedef struct { + /* Not using a union here, because there's no good way to initialize them + * in a way that is supported in both C and C++ (designated initializers + * are only supported since C++20). */ + void *ptr; + uint32_t type_mask; + /* TODO: We could use the extra 32-bit of padding on 64-bit systems. */ +} zend_type; + +typedef struct { + uint32_t num_types; + zend_type types[1]; +} zend_type_list; + +#define _ZEND_TYPE_EXTRA_FLAGS_SHIFT 25 +#define _ZEND_TYPE_MASK ((1u << 25) - 1) +/* Only one of these bits may be set. */ +#define _ZEND_TYPE_NAME_BIT (1u << 24) +// Used to signify that type.ptr is not a `zend_string*` but a `const char*`, +#define _ZEND_TYPE_LITERAL_NAME_BIT (1u << 23) +#define _ZEND_TYPE_LIST_BIT (1u << 22) +#define _ZEND_TYPE_KIND_MASK (_ZEND_TYPE_LIST_BIT|_ZEND_TYPE_NAME_BIT|_ZEND_TYPE_LITERAL_NAME_BIT) +/* For BC behaviour with iterable type */ +#define _ZEND_TYPE_ITERABLE_BIT (1u << 21) +/* Whether the type list is arena allocated */ +#define _ZEND_TYPE_ARENA_BIT (1u << 20) +/* Whether the type list is an intersection type */ +#define _ZEND_TYPE_INTERSECTION_BIT (1u << 19) +/* Whether the type is a union type */ +#define _ZEND_TYPE_UNION_BIT (1u << 18) +/* Type mask excluding the flags above. */ +#define _ZEND_TYPE_MAY_BE_MASK ((1u << 18) - 1) +/* Must have same value as MAY_BE_NULL */ +#define _ZEND_TYPE_NULLABLE_BIT 0x2u + +#define ZEND_TYPE_IS_SET(t) \ + (((t).type_mask & _ZEND_TYPE_MASK) != 0) + +/* If a type is complex it means it's either a list with a union or intersection, + * or the void pointer is a class name */ +#define ZEND_TYPE_IS_COMPLEX(t) \ + ((((t).type_mask) & _ZEND_TYPE_KIND_MASK) != 0) + +#define ZEND_TYPE_HAS_NAME(t) \ + ((((t).type_mask) & _ZEND_TYPE_NAME_BIT) != 0) + +#define ZEND_TYPE_HAS_LITERAL_NAME(t) \ + ((((t).type_mask) & _ZEND_TYPE_LITERAL_NAME_BIT) != 0) + +#define ZEND_TYPE_HAS_LIST(t) \ + ((((t).type_mask) & _ZEND_TYPE_LIST_BIT) != 0) + +#define ZEND_TYPE_IS_ITERABLE_FALLBACK(t) \ + ((((t).type_mask) & _ZEND_TYPE_ITERABLE_BIT) != 0) + +#define ZEND_TYPE_IS_INTERSECTION(t) \ + ((((t).type_mask) & _ZEND_TYPE_INTERSECTION_BIT) != 0) + +#define ZEND_TYPE_IS_UNION(t) \ + ((((t).type_mask) & _ZEND_TYPE_UNION_BIT) != 0) + +#define ZEND_TYPE_USES_ARENA(t) \ + ((((t).type_mask) & _ZEND_TYPE_ARENA_BIT) != 0) + +#define ZEND_TYPE_IS_ONLY_MASK(t) \ + (ZEND_TYPE_IS_SET(t) && (t).ptr == NULL) + +#define ZEND_TYPE_NAME(t) \ + ((zend_string *) (t).ptr) + +#define ZEND_TYPE_LITERAL_NAME(t) \ + ((const char *) (t).ptr) + +#define ZEND_TYPE_LIST(t) \ + ((zend_type_list *) (t).ptr) + +#define ZEND_TYPE_LIST_SIZE(num_types) \ + (sizeof(zend_type_list) + ((num_types) - 1) * sizeof(zend_type)) + +/* This iterates over a zend_type_list. */ +#define ZEND_TYPE_LIST_FOREACH(list, type_ptr) do { \ + zend_type *_list = (list)->types; \ + zend_type *_end = _list + (list)->num_types; \ + for (; _list < _end; _list++) { \ + type_ptr = _list; + +#define ZEND_TYPE_LIST_FOREACH_END() \ + } \ +} while (0) + +/* This iterates over any zend_type. If it's a type list, all list elements will + * be visited. If it's a single type, only the single type is visited. */ +#define ZEND_TYPE_FOREACH(type, type_ptr) do { \ + zend_type *_cur, *_end; \ + if (ZEND_TYPE_HAS_LIST(type)) { \ + zend_type_list *_list = ZEND_TYPE_LIST(type); \ + _cur = _list->types; \ + _end = _cur + _list->num_types; \ + } else { \ + _cur = &(type); \ + _end = _cur + 1; \ + } \ + do { \ + type_ptr = _cur; + +#define ZEND_TYPE_FOREACH_END() \ + } while (++_cur < _end); \ +} while (0) + +#define ZEND_TYPE_SET_PTR(t, _ptr) \ + ((t).ptr = (_ptr)) + +#define ZEND_TYPE_SET_PTR_AND_KIND(t, _ptr, kind_bit) do { \ + (t).ptr = (_ptr); \ + (t).type_mask &= ~_ZEND_TYPE_KIND_MASK; \ + (t).type_mask |= (kind_bit); \ +} while (0) + +#define ZEND_TYPE_SET_LIST(t, list) \ + ZEND_TYPE_SET_PTR_AND_KIND(t, list, _ZEND_TYPE_LIST_BIT) + +/* FULL_MASK() includes the MAY_BE_* type mask, as well as additional metadata bits. + * The PURE_MASK() only includes the MAY_BE_* type mask. */ +#define ZEND_TYPE_FULL_MASK(t) \ + ((t).type_mask) + +#define ZEND_TYPE_PURE_MASK(t) \ + ((t).type_mask & _ZEND_TYPE_MAY_BE_MASK) + +#define ZEND_TYPE_FULL_MASK_WITHOUT_NULL(t) \ + ((t).type_mask & ~_ZEND_TYPE_NULLABLE_BIT) + +#define ZEND_TYPE_PURE_MASK_WITHOUT_NULL(t) \ + ((t).type_mask & _ZEND_TYPE_MAY_BE_MASK & ~_ZEND_TYPE_NULLABLE_BIT) + +#define ZEND_TYPE_CONTAINS_CODE(t, code) \ + (((t).type_mask & (1u << (code))) != 0) + +#define ZEND_TYPE_ALLOW_NULL(t) \ + (((t).type_mask & _ZEND_TYPE_NULLABLE_BIT) != 0) + +#if defined(__cplusplus) && defined(_MSC_VER) +# define _ZEND_TYPE_PREFIX zend_type +#else +/* FIXME: We could add (zend_type) here at some point but this breaks in MSVC because + * (zend_type)(zend_type){} is no longer considered constant. */ +# define _ZEND_TYPE_PREFIX +#endif + +#define ZEND_TYPE_INIT_NONE(extra_flags) \ + _ZEND_TYPE_PREFIX { NULL, (extra_flags) } + +#define ZEND_TYPE_INIT_MASK(_type_mask) \ + _ZEND_TYPE_PREFIX { NULL, (_type_mask) } + +#define ZEND_TYPE_INIT_CODE(code, allow_null, extra_flags) \ + ZEND_TYPE_INIT_MASK(((code) == _IS_BOOL ? MAY_BE_BOOL : ( (code) == IS_ITERABLE ? _ZEND_TYPE_ITERABLE_BIT : ((code) == IS_MIXED ? MAY_BE_ANY : (1 << (code))))) \ + | ((allow_null) ? _ZEND_TYPE_NULLABLE_BIT : 0) | (extra_flags)) + +#define ZEND_TYPE_INIT_PTR(ptr, type_kind, allow_null, extra_flags) \ + _ZEND_TYPE_PREFIX { (void *) (ptr), \ + (type_kind) | ((allow_null) ? _ZEND_TYPE_NULLABLE_BIT : 0) | (extra_flags) } + +#define ZEND_TYPE_INIT_PTR_MASK(ptr, type_mask) \ + _ZEND_TYPE_PREFIX { (void *) (ptr), (type_mask) } + +#define ZEND_TYPE_INIT_UNION(ptr, extra_flags) \ + _ZEND_TYPE_PREFIX { (void *) (ptr), (_ZEND_TYPE_LIST_BIT|_ZEND_TYPE_UNION_BIT) | (extra_flags) } + +#define ZEND_TYPE_INIT_INTERSECTION(ptr, extra_flags) \ + _ZEND_TYPE_PREFIX { (void *) (ptr), (_ZEND_TYPE_LIST_BIT|_ZEND_TYPE_INTERSECTION_BIT) | (extra_flags) } + +#define ZEND_TYPE_INIT_CLASS(class_name, allow_null, extra_flags) \ + ZEND_TYPE_INIT_PTR(class_name, _ZEND_TYPE_NAME_BIT, allow_null, extra_flags) + +#define ZEND_TYPE_INIT_CLASS_MASK(class_name, type_mask) \ + ZEND_TYPE_INIT_PTR_MASK(class_name, _ZEND_TYPE_NAME_BIT | (type_mask)) + +#define ZEND_TYPE_INIT_CLASS_CONST(class_name, allow_null, extra_flags) \ + ZEND_TYPE_INIT_PTR(class_name, _ZEND_TYPE_LITERAL_NAME_BIT, allow_null, extra_flags) + +#define ZEND_TYPE_INIT_CLASS_CONST_MASK(class_name, type_mask) \ + ZEND_TYPE_INIT_PTR_MASK(class_name, (_ZEND_TYPE_LITERAL_NAME_BIT | (type_mask))) + +typedef union _zend_value { + zend_long lval; /* long value */ + double dval; /* double value */ + zend_refcounted *counted; + zend_string *str; + zend_array *arr; + zend_object *obj; + zend_resource *res; + zend_reference *ref; + zend_ast_ref *ast; + zval *zv; + void *ptr; + zend_class_entry *ce; + zend_function *func; + struct { + uint32_t w1; + uint32_t w2; + } ww; +} zend_value; + +struct _zval_struct { + zend_value value; /* value */ + union { + uint32_t type_info; + struct { + ZEND_ENDIAN_LOHI_3( + uint8_t type, /* active type */ + uint8_t type_flags, + union { + uint16_t extra; /* not further specified */ + } u) + } v; + } u1; + union { + uint32_t next; /* hash collision chain */ + uint32_t cache_slot; /* cache slot (for RECV_INIT) */ + uint32_t opline_num; /* opline number (for FAST_CALL) */ + uint32_t lineno; /* line number (for ast nodes) */ + uint32_t num_args; /* arguments number for EX(This) */ + uint32_t fe_pos; /* foreach position */ + uint32_t fe_iter_idx; /* foreach iterator index */ + uint32_t guard; /* recursion and single property guard */ + uint32_t constant_flags; /* constant flags */ + uint32_t extra; /* not further specified */ + } u2; +}; + +typedef struct _zend_refcounted_h { + uint32_t refcount; /* reference counter 32-bit */ + union { + uint32_t type_info; + } u; +} zend_refcounted_h; + +struct _zend_refcounted { + zend_refcounted_h gc; +}; + +struct _zend_string { + zend_refcounted_h gc; + zend_ulong h; /* hash value */ + size_t len; + char val[1]; +}; + +typedef struct _Bucket { + zval val; + zend_ulong h; /* hash value (or numeric index) */ + zend_string *key; /* string key or NULL for numerics */ +} Bucket; + +typedef struct _zend_array HashTable; + +struct _zend_array { + zend_refcounted_h gc; + union { + struct { + ZEND_ENDIAN_LOHI_4( + uint8_t flags, + uint8_t _unused, + uint8_t nIteratorsCount, + uint8_t _unused2) + } v; + uint32_t flags; + } u; + uint32_t nTableMask; + union { + uint32_t *arHash; /* hash table (allocated above this pointer) */ + Bucket *arData; /* array of hash buckets */ + zval *arPacked; /* packed array of zvals */ + }; + uint32_t nNumUsed; + uint32_t nNumOfElements; + uint32_t nTableSize; + uint32_t nInternalPointer; + zend_long nNextFreeElement; + dtor_func_t pDestructor; +}; + +/* + * HashTable Data Layout + * ===================== + * + * +=============================+ + * | HT_HASH(ht, ht->nTableMask) | +=============================+ + * | ... | | HT_INVALID_IDX | + * | HT_HASH(ht, -1) | | HT_INVALID_IDX | + * +-----------------------------+ +-----------------------------+ + * ht->arData ---> | Bucket[0] | ht->arPacked ---> | ZVAL[0] | + * | ... | | ... | + * | Bucket[ht->nTableSize-1] | | ZVAL[ht->nTableSize-1] | + * +=============================+ +=============================+ + */ + +#define HT_INVALID_IDX ((uint32_t) -1) + +#define HT_MIN_MASK ((uint32_t) -2) +#define HT_MIN_SIZE 8 + +/* HT_MAX_SIZE is chosen to satisfy the following constraints: + * - HT_SIZE_TO_MASK(HT_MAX_SIZE) != 0 + * - HT_SIZE_EX(HT_MAX_SIZE, HT_SIZE_TO_MASK(HT_MAX_SIZE)) does not overflow or + * wrapparound, and is <= the addressable space size + * - HT_MAX_SIZE must be a power of two: + * (nTableSizearHash, idx) + +#define HT_SIZE_TO_MASK(nTableSize) \ + ((uint32_t)(-((nTableSize) + (nTableSize)))) +#define HT_HASH_SIZE(nTableMask) \ + (((size_t)-(uint32_t)(nTableMask)) * sizeof(uint32_t)) +#define HT_DATA_SIZE(nTableSize) \ + ((size_t)(nTableSize) * sizeof(Bucket)) +#define HT_SIZE_EX(nTableSize, nTableMask) \ + (HT_DATA_SIZE((nTableSize)) + HT_HASH_SIZE((nTableMask))) +#define HT_SIZE(ht) \ + HT_SIZE_EX((ht)->nTableSize, (ht)->nTableMask) +#define HT_USED_SIZE(ht) \ + (HT_HASH_SIZE((ht)->nTableMask) + ((size_t)(ht)->nNumUsed * sizeof(Bucket))) +#define HT_PACKED_DATA_SIZE(nTableSize) \ + ((size_t)(nTableSize) * sizeof(zval)) +#define HT_PACKED_SIZE_EX(nTableSize, nTableMask) \ + (HT_PACKED_DATA_SIZE((nTableSize)) + HT_HASH_SIZE((nTableMask))) +#define HT_PACKED_SIZE(ht) \ + HT_PACKED_SIZE_EX((ht)->nTableSize, (ht)->nTableMask) +#define HT_PACKED_USED_SIZE(ht) \ + (HT_HASH_SIZE((ht)->nTableMask) + ((size_t)(ht)->nNumUsed * sizeof(zval))) +#if defined(__AVX2__) +# define HT_HASH_RESET(ht) do { \ + char *p = (char*)&HT_HASH(ht, (ht)->nTableMask); \ + size_t size = HT_HASH_SIZE((ht)->nTableMask); \ + __m256i ymm0 = _mm256_setzero_si256(); \ + ymm0 = _mm256_cmpeq_epi64(ymm0, ymm0); \ + ZEND_ASSERT(size >= 64 && ((size & 0x3f) == 0)); \ + do { \ + _mm256_storeu_si256((__m256i*)p, ymm0); \ + _mm256_storeu_si256((__m256i*)(p+32), ymm0); \ + p += 64; \ + size -= 64; \ + } while (size != 0); \ + } while (0) +#elif defined(__SSE2__) +# define HT_HASH_RESET(ht) do { \ + char *p = (char*)&HT_HASH(ht, (ht)->nTableMask); \ + size_t size = HT_HASH_SIZE((ht)->nTableMask); \ + __m128i xmm0 = _mm_setzero_si128(); \ + xmm0 = _mm_cmpeq_epi8(xmm0, xmm0); \ + ZEND_ASSERT(size >= 64 && ((size & 0x3f) == 0)); \ + do { \ + _mm_storeu_si128((__m128i*)p, xmm0); \ + _mm_storeu_si128((__m128i*)(p+16), xmm0); \ + _mm_storeu_si128((__m128i*)(p+32), xmm0); \ + _mm_storeu_si128((__m128i*)(p+48), xmm0); \ + p += 64; \ + size -= 64; \ + } while (size != 0); \ + } while (0) +#elif defined(__aarch64__) || defined(_M_ARM64) +# define HT_HASH_RESET(ht) do { \ + char *p = (char*)&HT_HASH(ht, (ht)->nTableMask); \ + size_t size = HT_HASH_SIZE((ht)->nTableMask); \ + int32x4_t t = vdupq_n_s32(-1); \ + ZEND_ASSERT(size >= 64 && ((size & 0x3f) == 0)); \ + do { \ + vst1q_s32((int32_t*)p, t); \ + vst1q_s32((int32_t*)(p+16), t); \ + vst1q_s32((int32_t*)(p+32), t); \ + vst1q_s32((int32_t*)(p+48), t); \ + p += 64; \ + size -= 64; \ + } while (size != 0); \ + } while (0) +#else +# define HT_HASH_RESET(ht) \ + memset(&HT_HASH(ht, (ht)->nTableMask), HT_INVALID_IDX, HT_HASH_SIZE((ht)->nTableMask)) +#endif +#define HT_HASH_RESET_PACKED(ht) do { \ + HT_HASH(ht, -2) = HT_INVALID_IDX; \ + HT_HASH(ht, -1) = HT_INVALID_IDX; \ + } while (0) +#define HT_HASH_TO_BUCKET(ht, idx) \ + HT_HASH_TO_BUCKET_EX((ht)->arData, idx) + +#define HT_SET_DATA_ADDR(ht, ptr) do { \ + (ht)->arData = (Bucket*)(((char*)(ptr)) + HT_HASH_SIZE((ht)->nTableMask)); \ + } while (0) +#define HT_GET_DATA_ADDR(ht) \ + ((char*)((ht)->arData) - HT_HASH_SIZE((ht)->nTableMask)) + +typedef uint32_t HashPosition; + +typedef struct _HashTableIterator { + HashTable *ht; + HashPosition pos; + uint32_t next_copy; // circular linked list via index into EG(ht_iterators) +} HashTableIterator; + +struct _zend_object { + zend_refcounted_h gc; + uint32_t handle; // TODO: may be removed ??? + zend_class_entry *ce; + const zend_object_handlers *handlers; + HashTable *properties; + zval properties_table[1]; +}; + +struct _zend_resource { + zend_refcounted_h gc; + zend_long handle; // TODO: may be removed ??? + int type; + void *ptr; +}; + +typedef struct { + size_t num; + size_t num_allocated; + struct _zend_property_info *ptr[1]; +} zend_property_info_list; + +typedef union { + struct _zend_property_info *ptr; + uintptr_t list; +} zend_property_info_source_list; + +#define ZEND_PROPERTY_INFO_SOURCE_FROM_LIST(list) (0x1 | (uintptr_t) (list)) +#define ZEND_PROPERTY_INFO_SOURCE_TO_LIST(list) ((zend_property_info_list *) ((list) & ~0x1)) +#define ZEND_PROPERTY_INFO_SOURCE_IS_LIST(list) ((list) & 0x1) + +struct _zend_reference { + zend_refcounted_h gc; + zval val; + zend_property_info_source_list sources; +}; + +struct _zend_ast_ref { + zend_refcounted_h gc; + /*zend_ast ast; zend_ast follows the zend_ast_ref structure */ +}; + +/* Regular data types: Must be in sync with zend_variables.c. */ +#define IS_UNDEF 0 +#define IS_NULL 1 +#define IS_FALSE 2 +#define IS_TRUE 3 +#define IS_LONG 4 +#define IS_DOUBLE 5 +#define IS_STRING 6 +#define IS_ARRAY 7 +#define IS_OBJECT 8 +#define IS_RESOURCE 9 +#define IS_REFERENCE 10 +#define IS_CONSTANT_AST 11 /* Constant expressions */ + +/* Fake types used only for type hinting. + * These are allowed to overlap with the types below. */ +#define IS_CALLABLE 12 +#define IS_ITERABLE 13 +#define IS_VOID 14 +#define IS_STATIC 15 +#define IS_MIXED 16 +#define IS_NEVER 17 + +/* internal types */ +#define IS_INDIRECT 12 +#define IS_PTR 13 +#define IS_ALIAS_PTR 14 +#define _IS_ERROR 15 + +/* used for casts */ +#define _IS_BOOL 18 +#define _IS_NUMBER 19 + +/* guard flags */ +#define ZEND_GUARD_PROPERTY_GET (1<<0) +#define ZEND_GUARD_PROPERTY_SET (1<<1) +#define ZEND_GUARD_PROPERTY_UNSET (1<<2) +#define ZEND_GUARD_PROPERTY_ISSET (1<<3) +#define ZEND_GUARD_PROPERTY_MASK 15 +#define ZEND_GUARD_RECURSION_DEBUG (1<<4) +#define ZEND_GUARD_RECURSION_EXPORT (1<<5) +#define ZEND_GUARD_RECURSION_JSON (1<<6) + +#define ZEND_GUARD_RECURSION_TYPE(t) ZEND_GUARD_RECURSION_ ## t + +#define ZEND_GUARD_IS_RECURSIVE(pg, t) ((*pg & ZEND_GUARD_RECURSION_TYPE(t)) != 0) +#define ZEND_GUARD_PROTECT_RECURSION(pg, t) *pg |= ZEND_GUARD_RECURSION_TYPE(t) +#define ZEND_GUARD_UNPROTECT_RECURSION(pg, t) *pg &= ~ZEND_GUARD_RECURSION_TYPE(t) + +static zend_always_inline uint8_t zval_get_type(const zval* pz) { + return pz->u1.v.type; +} + +#define ZEND_SAME_FAKE_TYPE(faketype, realtype) ( \ + (faketype) == (realtype) \ + || ((faketype) == _IS_BOOL && ((realtype) == IS_TRUE || (realtype) == IS_FALSE)) \ +) + +/* we should never set just Z_TYPE, we should set Z_TYPE_INFO */ +#define Z_TYPE(zval) zval_get_type(&(zval)) +#define Z_TYPE_P(zval_p) Z_TYPE(*(zval_p)) + +#define Z_TYPE_FLAGS(zval) (zval).u1.v.type_flags +#define Z_TYPE_FLAGS_P(zval_p) Z_TYPE_FLAGS(*(zval_p)) + +#define Z_TYPE_EXTRA(zval) (zval).u1.v.u.extra +#define Z_TYPE_EXTRA_P(zval_p) Z_TYPE_EXTRA(*(zval_p)) + +#define Z_TYPE_INFO(zval) (zval).u1.type_info +#define Z_TYPE_INFO_P(zval_p) Z_TYPE_INFO(*(zval_p)) + +#define Z_NEXT(zval) (zval).u2.next +#define Z_NEXT_P(zval_p) Z_NEXT(*(zval_p)) + +#define Z_CACHE_SLOT(zval) (zval).u2.cache_slot +#define Z_CACHE_SLOT_P(zval_p) Z_CACHE_SLOT(*(zval_p)) + +#define Z_LINENO(zval) (zval).u2.lineno +#define Z_LINENO_P(zval_p) Z_LINENO(*(zval_p)) + +#define Z_OPLINE_NUM(zval) (zval).u2.opline_num +#define Z_OPLINE_NUM_P(zval_p) Z_OPLINE_NUM(*(zval_p)) + +#define Z_FE_POS(zval) (zval).u2.fe_pos +#define Z_FE_POS_P(zval_p) Z_FE_POS(*(zval_p)) + +#define Z_FE_ITER(zval) (zval).u2.fe_iter_idx +#define Z_FE_ITER_P(zval_p) Z_FE_ITER(*(zval_p)) + +#define Z_GUARD(zval) (zval).u2.guard +#define Z_GUARD_P(zval_p) Z_GUARD(*(zval_p)) + +#define Z_CONSTANT_FLAGS(zval) (zval).u2.constant_flags +#define Z_CONSTANT_FLAGS_P(zval_p) Z_CONSTANT_FLAGS(*(zval_p)) + +#define Z_EXTRA(zval) (zval).u2.extra +#define Z_EXTRA_P(zval_p) Z_EXTRA(*(zval_p)) + +#define Z_COUNTED(zval) (zval).value.counted +#define Z_COUNTED_P(zval_p) Z_COUNTED(*(zval_p)) + +#define Z_TYPE_MASK 0xff +#define Z_TYPE_FLAGS_MASK 0xff00 + +#define Z_TYPE_FLAGS_SHIFT 8 +#define Z_TYPE_INFO_EXTRA_SHIFT 16 + +#define GC_REFCOUNT(p) zend_gc_refcount(&(p)->gc) +#define GC_SET_REFCOUNT(p, rc) zend_gc_set_refcount(&(p)->gc, rc) +#define GC_ADDREF(p) zend_gc_addref(&(p)->gc) +#define GC_DELREF(p) zend_gc_delref(&(p)->gc) +#define GC_ADDREF_EX(p, rc) zend_gc_addref_ex(&(p)->gc, rc) +#define GC_DELREF_EX(p, rc) zend_gc_delref_ex(&(p)->gc, rc) +#define GC_TRY_ADDREF(p) zend_gc_try_addref(&(p)->gc) +#define GC_TRY_DELREF(p) zend_gc_try_delref(&(p)->gc) + +#define GC_DTOR(p) \ + do { \ + zend_refcounted_h *_p = &(p)->gc; \ + if (zend_gc_delref(_p) == 0) { \ + rc_dtor_func((zend_refcounted *)_p); \ + } else { \ + gc_check_possible_root((zend_refcounted *)_p); \ + } \ + } while (0) + +#define GC_DTOR_NO_REF(p) \ + do { \ + zend_refcounted_h *_p = &(p)->gc; \ + if (zend_gc_delref(_p) == 0) { \ + rc_dtor_func((zend_refcounted *)_p); \ + } else { \ + gc_check_possible_root_no_ref((zend_refcounted *)_p); \ + } \ + } while (0) + +#define GC_TYPE_MASK 0x0000000f +#define GC_FLAGS_MASK 0x000003f0 +#define GC_INFO_MASK 0xfffffc00 +#define GC_FLAGS_SHIFT 0 +#define GC_INFO_SHIFT 10 + +static zend_always_inline uint8_t zval_gc_type(uint32_t gc_type_info) { + return (gc_type_info & GC_TYPE_MASK); +} + +static zend_always_inline uint32_t zval_gc_flags(uint32_t gc_type_info) { + return (gc_type_info >> GC_FLAGS_SHIFT) & (GC_FLAGS_MASK >> GC_FLAGS_SHIFT); +} + +static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) { + return (gc_type_info >> GC_INFO_SHIFT); +} + +#define GC_TYPE_INFO(p) (p)->gc.u.type_info +#define GC_TYPE(p) zval_gc_type(GC_TYPE_INFO(p)) +#define GC_FLAGS(p) zval_gc_flags(GC_TYPE_INFO(p)) +#define GC_INFO(p) zval_gc_info(GC_TYPE_INFO(p)) + +#define GC_ADD_FLAGS(p, flags) do { \ + GC_TYPE_INFO(p) |= (flags) << GC_FLAGS_SHIFT; \ + } while (0) +#define GC_DEL_FLAGS(p, flags) do { \ + GC_TYPE_INFO(p) &= ~((flags) << GC_FLAGS_SHIFT); \ + } while (0) + +#define Z_GC_TYPE(zval) GC_TYPE(Z_COUNTED(zval)) +#define Z_GC_TYPE_P(zval_p) Z_GC_TYPE(*(zval_p)) + +#define Z_GC_FLAGS(zval) GC_FLAGS(Z_COUNTED(zval)) +#define Z_GC_FLAGS_P(zval_p) Z_GC_FLAGS(*(zval_p)) + +#define Z_GC_INFO(zval) GC_INFO(Z_COUNTED(zval)) +#define Z_GC_INFO_P(zval_p) Z_GC_INFO(*(zval_p)) +#define Z_GC_TYPE_INFO(zval) GC_TYPE_INFO(Z_COUNTED(zval)) +#define Z_GC_TYPE_INFO_P(zval_p) Z_GC_TYPE_INFO(*(zval_p)) + +/* zval_gc_flags(zval.value->gc.u.type_info) (common flags) */ +#define GC_NOT_COLLECTABLE (1<<4) +#define GC_PROTECTED (1<<5) /* used for recursion detection */ +#define GC_IMMUTABLE (1<<6) /* can't be changed in place */ +#define GC_PERSISTENT (1<<7) /* allocated using malloc */ +#define GC_PERSISTENT_LOCAL (1<<8) /* persistent, but thread-local */ + +#define GC_NULL (IS_NULL | (GC_NOT_COLLECTABLE << GC_FLAGS_SHIFT)) +#define GC_STRING (IS_STRING | (GC_NOT_COLLECTABLE << GC_FLAGS_SHIFT)) +#define GC_ARRAY IS_ARRAY +#define GC_OBJECT IS_OBJECT +#define GC_RESOURCE (IS_RESOURCE | (GC_NOT_COLLECTABLE << GC_FLAGS_SHIFT)) +#define GC_REFERENCE (IS_REFERENCE | (GC_NOT_COLLECTABLE << GC_FLAGS_SHIFT)) +#define GC_CONSTANT_AST (IS_CONSTANT_AST | (GC_NOT_COLLECTABLE << GC_FLAGS_SHIFT)) + +/* zval.u1.v.type_flags */ +#define IS_TYPE_REFCOUNTED (1<<0) +#define IS_TYPE_COLLECTABLE (1<<1) +/* Used for static variables to check if they have been initialized. We can't use IS_UNDEF because + * we can't store IS_UNDEF zvals in the static_variables HashTable. This needs to live in type_info + * so that the ZEND_ASSIGN overrides it but is moved to extra to avoid breaking the Z_REFCOUNTED() + * optimization that only checks for Z_TYPE_FLAGS() without `& (IS_TYPE_COLLECTABLE|IS_TYPE_REFCOUNTED)`. */ +#define IS_STATIC_VAR_UNINITIALIZED (1<<0) + +#if 1 +/* This optimized version assumes that we have a single "type_flag" */ +/* IS_TYPE_COLLECTABLE may be used only with IS_TYPE_REFCOUNTED */ +# define Z_TYPE_INFO_REFCOUNTED(t) (((t) & Z_TYPE_FLAGS_MASK) != 0) +#else +# define Z_TYPE_INFO_REFCOUNTED(t) (((t) & (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT)) != 0) +#endif + +/* extended types */ +#define IS_INTERNED_STRING_EX IS_STRING + +#define IS_STRING_EX (IS_STRING | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT)) +#define IS_ARRAY_EX (IS_ARRAY | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT) | (IS_TYPE_COLLECTABLE << Z_TYPE_FLAGS_SHIFT)) +#define IS_OBJECT_EX (IS_OBJECT | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT) | (IS_TYPE_COLLECTABLE << Z_TYPE_FLAGS_SHIFT)) +#define IS_RESOURCE_EX (IS_RESOURCE | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT)) +#define IS_REFERENCE_EX (IS_REFERENCE | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT)) + +#define IS_CONSTANT_AST_EX (IS_CONSTANT_AST | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT)) + +/* string flags (zval.value->gc.u.flags) */ +#define IS_STR_CLASS_NAME_MAP_PTR GC_PROTECTED /* refcount is a map_ptr offset of class_entry */ +#define IS_STR_INTERNED GC_IMMUTABLE /* interned string */ +#define IS_STR_PERSISTENT GC_PERSISTENT /* allocated using malloc */ +#define IS_STR_PERMANENT (1<<8) /* relives request boundary */ +#define IS_STR_VALID_UTF8 (1<<9) /* valid UTF-8 according to PCRE */ + +/* array flags */ +#define IS_ARRAY_IMMUTABLE GC_IMMUTABLE +#define IS_ARRAY_PERSISTENT GC_PERSISTENT + +/* object flags (zval.value->gc.u.flags) */ +#define IS_OBJ_WEAKLY_REFERENCED GC_PERSISTENT +#define IS_OBJ_DESTRUCTOR_CALLED (1<<8) +#define IS_OBJ_FREE_CALLED (1<<9) + +#define OBJ_FLAGS(obj) GC_FLAGS(obj) + +/* Fast class cache */ +#define ZSTR_HAS_CE_CACHE(s) (GC_FLAGS(s) & IS_STR_CLASS_NAME_MAP_PTR) +#define ZSTR_GET_CE_CACHE(s) ZSTR_GET_CE_CACHE_EX(s, 1) +#define ZSTR_SET_CE_CACHE(s, ce) ZSTR_SET_CE_CACHE_EX(s, ce, 1) + +#define ZSTR_VALID_CE_CACHE(s) EXPECTED((GC_REFCOUNT(s)-1)/sizeof(void *) < CG(map_ptr_last)) + +#define ZSTR_GET_CE_CACHE_EX(s, validate) \ + ((!(validate) || ZSTR_VALID_CE_CACHE(s)) ? GET_CE_CACHE(GC_REFCOUNT(s)) : NULL) + +#define ZSTR_SET_CE_CACHE_EX(s, ce, validate) do { \ + if (!(validate) || ZSTR_VALID_CE_CACHE(s)) { \ + ZEND_ASSERT((validate) || ZSTR_VALID_CE_CACHE(s)); \ + SET_CE_CACHE(GC_REFCOUNT(s), ce); \ + } \ + } while (0) + +#define GET_CE_CACHE(ce_cache) \ + (*(zend_class_entry **)ZEND_MAP_PTR_OFFSET2PTR(ce_cache)) + +#define SET_CE_CACHE(ce_cache, ce) do { \ + *((zend_class_entry **)ZEND_MAP_PTR_OFFSET2PTR(ce_cache)) = ce; \ + } while (0) + +/* Recursion protection macros must be used only for arrays and objects */ +#define GC_IS_RECURSIVE(p) \ + (GC_FLAGS(p) & GC_PROTECTED) + +#define GC_PROTECT_RECURSION(p) do { \ + GC_ADD_FLAGS(p, GC_PROTECTED); \ + } while (0) + +#define GC_UNPROTECT_RECURSION(p) do { \ + GC_DEL_FLAGS(p, GC_PROTECTED); \ + } while (0) + +#define GC_TRY_PROTECT_RECURSION(p) do { \ + if (!(GC_FLAGS(p) & GC_IMMUTABLE)) GC_PROTECT_RECURSION(p); \ + } while (0) + +#define GC_TRY_UNPROTECT_RECURSION(p) do { \ + if (!(GC_FLAGS(p) & GC_IMMUTABLE)) GC_UNPROTECT_RECURSION(p); \ + } while (0) + +#define Z_IS_RECURSIVE(zval) GC_IS_RECURSIVE(Z_COUNTED(zval)) +#define Z_PROTECT_RECURSION(zval) GC_PROTECT_RECURSION(Z_COUNTED(zval)) +#define Z_UNPROTECT_RECURSION(zval) GC_UNPROTECT_RECURSION(Z_COUNTED(zval)) +#define Z_IS_RECURSIVE_P(zv) Z_IS_RECURSIVE(*(zv)) +#define Z_PROTECT_RECURSION_P(zv) Z_PROTECT_RECURSION(*(zv)) +#define Z_UNPROTECT_RECURSION_P(zv) Z_UNPROTECT_RECURSION(*(zv)) + +#define ZEND_GUARD_OR_GC_IS_RECURSIVE(pg, t, zobj) \ + (pg ? ZEND_GUARD_IS_RECURSIVE(pg, t) : GC_IS_RECURSIVE(zobj)) + +#define ZEND_GUARD_OR_GC_PROTECT_RECURSION(pg, t, zobj) do { \ + if (pg) { \ + ZEND_GUARD_PROTECT_RECURSION(pg, t); \ + } else { \ + GC_PROTECT_RECURSION(zobj); \ + } \ + } while(0) + +#define ZEND_GUARD_OR_GC_UNPROTECT_RECURSION(pg, t, zobj) do { \ + if (pg) { \ + ZEND_GUARD_UNPROTECT_RECURSION(pg, t); \ + } else { \ + GC_UNPROTECT_RECURSION(zobj); \ + } \ + } while(0) + +/* All data types < IS_STRING have their constructor/destructors skipped */ +#define Z_CONSTANT(zval) (Z_TYPE(zval) == IS_CONSTANT_AST) +#define Z_CONSTANT_P(zval_p) Z_CONSTANT(*(zval_p)) + +#if 1 +/* This optimized version assumes that we have a single "type_flag" */ +/* IS_TYPE_COLLECTABLE may be used only with IS_TYPE_REFCOUNTED */ +#define Z_REFCOUNTED(zval) (Z_TYPE_FLAGS(zval) != 0) +#else +#define Z_REFCOUNTED(zval) ((Z_TYPE_FLAGS(zval) & IS_TYPE_REFCOUNTED) != 0) +#endif +#define Z_REFCOUNTED_P(zval_p) Z_REFCOUNTED(*(zval_p)) + +#define Z_COLLECTABLE(zval) ((Z_TYPE_FLAGS(zval) & IS_TYPE_COLLECTABLE) != 0) +#define Z_COLLECTABLE_P(zval_p) Z_COLLECTABLE(*(zval_p)) + +/* deprecated: (COPYABLE is the same as IS_ARRAY) */ +#define Z_COPYABLE(zval) (Z_TYPE(zval) == IS_ARRAY) +#define Z_COPYABLE_P(zval_p) Z_COPYABLE(*(zval_p)) + +/* deprecated: (IMMUTABLE is the same as IS_ARRAY && !REFCOUNTED) */ +#define Z_IMMUTABLE(zval) (Z_TYPE_INFO(zval) == IS_ARRAY) +#define Z_IMMUTABLE_P(zval_p) Z_IMMUTABLE(*(zval_p)) +#define Z_OPT_IMMUTABLE(zval) Z_IMMUTABLE(zval_p) +#define Z_OPT_IMMUTABLE_P(zval_p) Z_IMMUTABLE(*(zval_p)) + +/* the following Z_OPT_* macros make better code when Z_TYPE_INFO accessed before */ +#define Z_OPT_TYPE(zval) (Z_TYPE_INFO(zval) & Z_TYPE_MASK) +#define Z_OPT_TYPE_P(zval_p) Z_OPT_TYPE(*(zval_p)) + +#define Z_OPT_CONSTANT(zval) (Z_OPT_TYPE(zval) == IS_CONSTANT_AST) +#define Z_OPT_CONSTANT_P(zval_p) Z_OPT_CONSTANT(*(zval_p)) + +#define Z_OPT_REFCOUNTED(zval) Z_TYPE_INFO_REFCOUNTED(Z_TYPE_INFO(zval)) +#define Z_OPT_REFCOUNTED_P(zval_p) Z_OPT_REFCOUNTED(*(zval_p)) + +/* deprecated: (COPYABLE is the same as IS_ARRAY) */ +#define Z_OPT_COPYABLE(zval) (Z_OPT_TYPE(zval) == IS_ARRAY) +#define Z_OPT_COPYABLE_P(zval_p) Z_OPT_COPYABLE(*(zval_p)) + +#define Z_OPT_ISREF(zval) (Z_OPT_TYPE(zval) == IS_REFERENCE) +#define Z_OPT_ISREF_P(zval_p) Z_OPT_ISREF(*(zval_p)) + +#define Z_ISREF(zval) (Z_TYPE(zval) == IS_REFERENCE) +#define Z_ISREF_P(zval_p) Z_ISREF(*(zval_p)) + +#define Z_ISUNDEF(zval) (Z_TYPE(zval) == IS_UNDEF) +#define Z_ISUNDEF_P(zval_p) Z_ISUNDEF(*(zval_p)) + +#define Z_ISNULL(zval) (Z_TYPE(zval) == IS_NULL) +#define Z_ISNULL_P(zval_p) Z_ISNULL(*(zval_p)) + +#define Z_ISERROR(zval) (Z_TYPE(zval) == _IS_ERROR) +#define Z_ISERROR_P(zval_p) Z_ISERROR(*(zval_p)) + +#define Z_LVAL(zval) (zval).value.lval +#define Z_LVAL_P(zval_p) Z_LVAL(*(zval_p)) + +#define Z_DVAL(zval) (zval).value.dval +#define Z_DVAL_P(zval_p) Z_DVAL(*(zval_p)) + +#define Z_STR(zval) (zval).value.str +#define Z_STR_P(zval_p) Z_STR(*(zval_p)) + +#define Z_STRVAL(zval) ZSTR_VAL(Z_STR(zval)) +#define Z_STRVAL_P(zval_p) Z_STRVAL(*(zval_p)) + +#define Z_STRLEN(zval) ZSTR_LEN(Z_STR(zval)) +#define Z_STRLEN_P(zval_p) Z_STRLEN(*(zval_p)) + +#define Z_STRHASH(zval) ZSTR_HASH(Z_STR(zval)) +#define Z_STRHASH_P(zval_p) Z_STRHASH(*(zval_p)) + +#define Z_ARR(zval) (zval).value.arr +#define Z_ARR_P(zval_p) Z_ARR(*(zval_p)) + +#define Z_ARRVAL(zval) Z_ARR(zval) +#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*(zval_p)) + +#define Z_OBJ(zval) (zval).value.obj +#define Z_OBJ_P(zval_p) Z_OBJ(*(zval_p)) + +#define Z_OBJ_HT(zval) Z_OBJ(zval)->handlers +#define Z_OBJ_HT_P(zval_p) Z_OBJ_HT(*(zval_p)) + +#define Z_OBJ_HANDLER(zval, hf) Z_OBJ_HT((zval))->hf +#define Z_OBJ_HANDLER_P(zv_p, hf) Z_OBJ_HANDLER(*(zv_p), hf) + +#define Z_OBJ_HANDLE(zval) (Z_OBJ((zval)))->handle +#define Z_OBJ_HANDLE_P(zval_p) Z_OBJ_HANDLE(*(zval_p)) + +#define Z_OBJCE(zval) (Z_OBJ(zval)->ce) +#define Z_OBJCE_P(zval_p) Z_OBJCE(*(zval_p)) + +#define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(Z_OBJ(zval)) +#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*(zval_p)) + +#define Z_RES(zval) (zval).value.res +#define Z_RES_P(zval_p) Z_RES(*zval_p) + +#define Z_RES_HANDLE(zval) Z_RES(zval)->handle +#define Z_RES_HANDLE_P(zval_p) Z_RES_HANDLE(*zval_p) + +#define Z_RES_TYPE(zval) Z_RES(zval)->type +#define Z_RES_TYPE_P(zval_p) Z_RES_TYPE(*zval_p) + +#define Z_RES_VAL(zval) Z_RES(zval)->ptr +#define Z_RES_VAL_P(zval_p) Z_RES_VAL(*zval_p) + +#define Z_REF(zval) (zval).value.ref +#define Z_REF_P(zval_p) Z_REF(*(zval_p)) + +#define Z_REFVAL(zval) &Z_REF(zval)->val +#define Z_REFVAL_P(zval_p) Z_REFVAL(*(zval_p)) + +#define Z_AST(zval) (zval).value.ast +#define Z_AST_P(zval_p) Z_AST(*(zval_p)) + +#define GC_AST(p) ((zend_ast*)(((char*)p) + sizeof(zend_ast_ref))) + +#define Z_ASTVAL(zval) GC_AST(Z_AST(zval)) +#define Z_ASTVAL_P(zval_p) Z_ASTVAL(*(zval_p)) + +#define Z_INDIRECT(zval) (zval).value.zv +#define Z_INDIRECT_P(zval_p) Z_INDIRECT(*(zval_p)) + +#define Z_CE(zval) (zval).value.ce +#define Z_CE_P(zval_p) Z_CE(*(zval_p)) + +#define Z_FUNC(zval) (zval).value.func +#define Z_FUNC_P(zval_p) Z_FUNC(*(zval_p)) + +#define Z_PTR(zval) (zval).value.ptr +#define Z_PTR_P(zval_p) Z_PTR(*(zval_p)) + +#define ZVAL_UNDEF(z) do { \ + Z_TYPE_INFO_P(z) = IS_UNDEF; \ + } while (0) + +#define ZVAL_NULL(z) do { \ + Z_TYPE_INFO_P(z) = IS_NULL; \ + } while (0) + +#define ZVAL_FALSE(z) do { \ + Z_TYPE_INFO_P(z) = IS_FALSE; \ + } while (0) + +#define ZVAL_TRUE(z) do { \ + Z_TYPE_INFO_P(z) = IS_TRUE; \ + } while (0) + +#define ZVAL_BOOL(z, b) do { \ + Z_TYPE_INFO_P(z) = \ + (b) ? IS_TRUE : IS_FALSE; \ + } while (0) + +#define ZVAL_LONG(z, l) do { \ + zval *__z = (z); \ + Z_LVAL_P(__z) = l; \ + Z_TYPE_INFO_P(__z) = IS_LONG; \ + } while (0) + +#define ZVAL_DOUBLE(z, d) do { \ + zval *__z = (z); \ + Z_DVAL_P(__z) = d; \ + Z_TYPE_INFO_P(__z) = IS_DOUBLE; \ + } while (0) + +#define ZVAL_STR(z, s) do { \ + zval *__z = (z); \ + zend_string *__s = (s); \ + Z_STR_P(__z) = __s; \ + /* interned strings support */ \ + Z_TYPE_INFO_P(__z) = ZSTR_IS_INTERNED(__s) ? \ + IS_INTERNED_STRING_EX : \ + IS_STRING_EX; \ + } while (0) + +#define ZVAL_INTERNED_STR(z, s) do { \ + zval *__z = (z); \ + zend_string *__s = (s); \ + Z_STR_P(__z) = __s; \ + Z_TYPE_INFO_P(__z) = IS_INTERNED_STRING_EX; \ + } while (0) + +#define ZVAL_NEW_STR(z, s) do { \ + zval *__z = (z); \ + zend_string *__s = (s); \ + Z_STR_P(__z) = __s; \ + Z_TYPE_INFO_P(__z) = IS_STRING_EX; \ + } while (0) + +#define ZVAL_STR_COPY(z, s) do { \ + zval *__z = (z); \ + zend_string *__s = (s); \ + Z_STR_P(__z) = __s; \ + /* interned strings support */ \ + if (ZSTR_IS_INTERNED(__s)) { \ + Z_TYPE_INFO_P(__z) = IS_INTERNED_STRING_EX; \ + } else { \ + GC_ADDREF(__s); \ + Z_TYPE_INFO_P(__z) = IS_STRING_EX; \ + } \ + } while (0) + +#define ZVAL_ARR(z, a) do { \ + zend_array *__arr = (a); \ + zval *__z = (z); \ + Z_ARR_P(__z) = __arr; \ + Z_TYPE_INFO_P(__z) = IS_ARRAY_EX; \ + } while (0) + +#define ZVAL_NEW_PERSISTENT_ARR(z) do { \ + zval *__z = (z); \ + zend_array *_arr = \ + (zend_array *) malloc(sizeof(zend_array)); \ + Z_ARR_P(__z) = _arr; \ + Z_TYPE_INFO_P(__z) = IS_ARRAY_EX; \ + } while (0) + +#define ZVAL_OBJ(z, o) do { \ + zval *__z = (z); \ + Z_OBJ_P(__z) = (o); \ + Z_TYPE_INFO_P(__z) = IS_OBJECT_EX; \ + } while (0) + +#define ZVAL_OBJ_COPY(z, o) do { \ + zval *__z = (z); \ + zend_object *__o = (o); \ + GC_ADDREF(__o); \ + Z_OBJ_P(__z) = __o; \ + Z_TYPE_INFO_P(__z) = IS_OBJECT_EX; \ + } while (0) + +#define ZVAL_RES(z, r) do { \ + zval *__z = (z); \ + Z_RES_P(__z) = (r); \ + Z_TYPE_INFO_P(__z) = IS_RESOURCE_EX; \ + } while (0) + +#define ZVAL_NEW_RES(z, h, p, t) do { \ + zend_resource *_res = \ + (zend_resource *) emalloc(sizeof(zend_resource)); \ + zval *__z; \ + GC_SET_REFCOUNT(_res, 1); \ + GC_TYPE_INFO(_res) = GC_RESOURCE; \ + _res->handle = (h); \ + _res->type = (t); \ + _res->ptr = (p); \ + __z = (z); \ + Z_RES_P(__z) = _res; \ + Z_TYPE_INFO_P(__z) = IS_RESOURCE_EX; \ + } while (0) + +#define ZVAL_NEW_PERSISTENT_RES(z, h, p, t) do { \ + zend_resource *_res = \ + (zend_resource *) malloc(sizeof(zend_resource)); \ + zval *__z; \ + GC_SET_REFCOUNT(_res, 1); \ + GC_TYPE_INFO(_res) = GC_RESOURCE | \ + (GC_PERSISTENT << GC_FLAGS_SHIFT); \ + _res->handle = (h); \ + _res->type = (t); \ + _res->ptr = (p); \ + __z = (z); \ + Z_RES_P(__z) = _res; \ + Z_TYPE_INFO_P(__z) = IS_RESOURCE_EX; \ + } while (0) + +#define ZVAL_REF(z, r) do { \ + zval *__z = (z); \ + Z_REF_P(__z) = (r); \ + Z_TYPE_INFO_P(__z) = IS_REFERENCE_EX; \ + } while (0) + +#define ZVAL_NEW_EMPTY_REF(z) do { \ + zend_reference *_ref = \ + (zend_reference *) emalloc(sizeof(zend_reference)); \ + GC_SET_REFCOUNT(_ref, 1); \ + GC_TYPE_INFO(_ref) = GC_REFERENCE; \ + _ref->sources.ptr = NULL; \ + Z_REF_P(z) = _ref; \ + Z_TYPE_INFO_P(z) = IS_REFERENCE_EX; \ + } while (0) + +#define ZVAL_NEW_REF(z, r) do { \ + zend_reference *_ref = \ + (zend_reference *) emalloc(sizeof(zend_reference)); \ + GC_SET_REFCOUNT(_ref, 1); \ + GC_TYPE_INFO(_ref) = GC_REFERENCE; \ + ZVAL_COPY_VALUE(&_ref->val, r); \ + _ref->sources.ptr = NULL; \ + Z_REF_P(z) = _ref; \ + Z_TYPE_INFO_P(z) = IS_REFERENCE_EX; \ + } while (0) + +#define ZVAL_MAKE_REF_EX(z, refcount) do { \ + zval *_z = (z); \ + zend_reference *_ref = \ + (zend_reference *) emalloc(sizeof(zend_reference)); \ + GC_SET_REFCOUNT(_ref, (refcount)); \ + GC_TYPE_INFO(_ref) = GC_REFERENCE; \ + ZVAL_COPY_VALUE(&_ref->val, _z); \ + _ref->sources.ptr = NULL; \ + Z_REF_P(_z) = _ref; \ + Z_TYPE_INFO_P(_z) = IS_REFERENCE_EX; \ + } while (0) + +#define ZVAL_NEW_PERSISTENT_REF(z, r) do { \ + zend_reference *_ref = \ + (zend_reference *) malloc(sizeof(zend_reference)); \ + GC_SET_REFCOUNT(_ref, 1); \ + GC_TYPE_INFO(_ref) = GC_REFERENCE | \ + (GC_PERSISTENT << GC_FLAGS_SHIFT); \ + ZVAL_COPY_VALUE(&_ref->val, r); \ + _ref->sources.ptr = NULL; \ + Z_REF_P(z) = _ref; \ + Z_TYPE_INFO_P(z) = IS_REFERENCE_EX; \ + } while (0) + +#define ZVAL_AST(z, ast) do { \ + zval *__z = (z); \ + Z_AST_P(__z) = ast; \ + Z_TYPE_INFO_P(__z) = IS_CONSTANT_AST_EX; \ + } while (0) + +#define ZVAL_INDIRECT(z, v) do { \ + Z_INDIRECT_P(z) = (v); \ + Z_TYPE_INFO_P(z) = IS_INDIRECT; \ + } while (0) + +#define ZVAL_PTR(z, p) do { \ + Z_PTR_P(z) = (p); \ + Z_TYPE_INFO_P(z) = IS_PTR; \ + } while (0) + +#define ZVAL_FUNC(z, f) do { \ + Z_FUNC_P(z) = (f); \ + Z_TYPE_INFO_P(z) = IS_PTR; \ + } while (0) + +#define ZVAL_CE(z, c) do { \ + Z_CE_P(z) = (c); \ + Z_TYPE_INFO_P(z) = IS_PTR; \ + } while (0) + +#define ZVAL_ALIAS_PTR(z, p) do { \ + Z_PTR_P(z) = (p); \ + Z_TYPE_INFO_P(z) = IS_ALIAS_PTR; \ + } while (0) + +#define ZVAL_ERROR(z) do { \ + Z_TYPE_INFO_P(z) = _IS_ERROR; \ + } while (0) + +#define Z_REFCOUNT_P(pz) zval_refcount_p(pz) +#define Z_SET_REFCOUNT_P(pz, rc) zval_set_refcount_p(pz, rc) +#define Z_ADDREF_P(pz) zval_addref_p(pz) +#define Z_DELREF_P(pz) zval_delref_p(pz) + +#define Z_REFCOUNT(z) Z_REFCOUNT_P(&(z)) +#define Z_SET_REFCOUNT(z, rc) Z_SET_REFCOUNT_P(&(z), rc) +#define Z_ADDREF(z) Z_ADDREF_P(&(z)) +#define Z_DELREF(z) Z_DELREF_P(&(z)) + +#define Z_TRY_ADDREF_P(pz) do { \ + if (Z_REFCOUNTED_P((pz))) { \ + Z_ADDREF_P((pz)); \ + } \ +} while (0) + +#define Z_TRY_DELREF_P(pz) do { \ + if (Z_REFCOUNTED_P((pz))) { \ + Z_DELREF_P((pz)); \ + } \ +} while (0) + +#define Z_TRY_ADDREF(z) Z_TRY_ADDREF_P(&(z)) +#define Z_TRY_DELREF(z) Z_TRY_DELREF_P(&(z)) + +#ifndef ZEND_RC_DEBUG +# define ZEND_RC_DEBUG 0 +#endif + +#if ZEND_RC_DEBUG +extern ZEND_API bool zend_rc_debug; +/* The GC_PERSISTENT flag is reused for IS_OBJ_WEAKLY_REFERENCED on objects. + * Skip checks for OBJECT/NULL type to avoid interpreting the flag incorrectly. */ +# define ZEND_RC_MOD_CHECK(p) do { \ + if (zend_rc_debug) { \ + uint8_t type = zval_gc_type((p)->u.type_info); \ + if (type != IS_OBJECT && type != IS_NULL) { \ + ZEND_ASSERT(!(zval_gc_flags((p)->u.type_info) & GC_IMMUTABLE)); \ + ZEND_ASSERT((zval_gc_flags((p)->u.type_info) & (GC_PERSISTENT|GC_PERSISTENT_LOCAL)) != GC_PERSISTENT); \ + } \ + } \ + } while (0) +# define GC_MAKE_PERSISTENT_LOCAL(p) do { \ + GC_ADD_FLAGS(p, GC_PERSISTENT_LOCAL); \ + } while (0) +#else +# define ZEND_RC_MOD_CHECK(p) \ + do { } while (0) +# define GC_MAKE_PERSISTENT_LOCAL(p) \ + do { } while (0) +#endif + +static zend_always_inline uint32_t zend_gc_refcount(const zend_refcounted_h *p) { + return p->refcount; +} + +static zend_always_inline uint32_t zend_gc_set_refcount(zend_refcounted_h *p, uint32_t rc) { + p->refcount = rc; + return p->refcount; +} + +static zend_always_inline uint32_t zend_gc_addref(zend_refcounted_h *p) { + ZEND_RC_MOD_CHECK(p); + return ++(p->refcount); +} + +static zend_always_inline void zend_gc_try_addref(zend_refcounted_h *p) { + if (!(p->u.type_info & GC_IMMUTABLE)) { + ZEND_RC_MOD_CHECK(p); + ++p->refcount; + } +} + +static zend_always_inline void zend_gc_try_delref(zend_refcounted_h *p) { + if (!(p->u.type_info & GC_IMMUTABLE)) { + ZEND_RC_MOD_CHECK(p); + --p->refcount; + } +} + +static zend_always_inline uint32_t zend_gc_delref(zend_refcounted_h *p) { + ZEND_ASSERT(p->refcount > 0); + ZEND_RC_MOD_CHECK(p); + return --(p->refcount); +} + +static zend_always_inline uint32_t zend_gc_addref_ex(zend_refcounted_h *p, uint32_t rc) { + ZEND_RC_MOD_CHECK(p); + p->refcount += rc; + return p->refcount; +} + +static zend_always_inline uint32_t zend_gc_delref_ex(zend_refcounted_h *p, uint32_t rc) { + ZEND_RC_MOD_CHECK(p); + p->refcount -= rc; + return p->refcount; +} + +static zend_always_inline uint32_t zval_refcount_p(const zval* pz) { +#if ZEND_DEBUG + ZEND_ASSERT(Z_REFCOUNTED_P(pz) || Z_TYPE_P(pz) == IS_ARRAY); +#endif + return GC_REFCOUNT(Z_COUNTED_P(pz)); +} + +static zend_always_inline uint32_t zval_set_refcount_p(zval* pz, uint32_t rc) { + ZEND_ASSERT(Z_REFCOUNTED_P(pz)); + return GC_SET_REFCOUNT(Z_COUNTED_P(pz), rc); +} + +static zend_always_inline uint32_t zval_addref_p(zval* pz) { + ZEND_ASSERT(Z_REFCOUNTED_P(pz)); + return GC_ADDREF(Z_COUNTED_P(pz)); +} + +static zend_always_inline uint32_t zval_delref_p(zval* pz) { + ZEND_ASSERT(Z_REFCOUNTED_P(pz)); + return GC_DELREF(Z_COUNTED_P(pz)); +} + +#if SIZEOF_SIZE_T == 4 +# define ZVAL_COPY_VALUE_EX(z, v, gc, t) \ + do { \ + uint32_t _w2 = v->value.ww.w2; \ + Z_COUNTED_P(z) = gc; \ + z->value.ww.w2 = _w2; \ + Z_TYPE_INFO_P(z) = t; \ + } while (0) +#elif SIZEOF_SIZE_T == 8 +# define ZVAL_COPY_VALUE_EX(z, v, gc, t) \ + do { \ + Z_COUNTED_P(z) = gc; \ + Z_TYPE_INFO_P(z) = t; \ + } while (0) +#else +# error "Unknown SIZEOF_SIZE_T" +#endif + +#define ZVAL_COPY_VALUE(z, v) \ + do { \ + zval *_z1 = (z); \ + const zval *_z2 = (v); \ + zend_refcounted *_gc = Z_COUNTED_P(_z2); \ + uint32_t _t = Z_TYPE_INFO_P(_z2); \ + ZVAL_COPY_VALUE_EX(_z1, _z2, _gc, _t); \ + } while (0) + +#define ZVAL_COPY(z, v) \ + do { \ + zval *_z1 = (z); \ + const zval *_z2 = (v); \ + zend_refcounted *_gc = Z_COUNTED_P(_z2); \ + uint32_t _t = Z_TYPE_INFO_P(_z2); \ + ZVAL_COPY_VALUE_EX(_z1, _z2, _gc, _t); \ + if (Z_TYPE_INFO_REFCOUNTED(_t)) { \ + GC_ADDREF(_gc); \ + } \ + } while (0) + +#define ZVAL_DUP(z, v) \ + do { \ + zval *_z1 = (z); \ + const zval *_z2 = (v); \ + zend_refcounted *_gc = Z_COUNTED_P(_z2); \ + uint32_t _t = Z_TYPE_INFO_P(_z2); \ + if ((_t & Z_TYPE_MASK) == IS_ARRAY) { \ + ZVAL_ARR(_z1, zend_array_dup((zend_array*)_gc));\ + } else { \ + if (Z_TYPE_INFO_REFCOUNTED(_t)) { \ + GC_ADDREF(_gc); \ + } \ + ZVAL_COPY_VALUE_EX(_z1, _z2, _gc, _t); \ + } \ + } while (0) + + +/* ZVAL_COPY_OR_DUP() should be used instead of ZVAL_COPY() and ZVAL_DUP() + * in all places where the source may be a persistent zval. + */ +#define ZVAL_COPY_OR_DUP(z, v) \ + do { \ + zval *_z1 = (z); \ + const zval *_z2 = (v); \ + zend_refcounted *_gc = Z_COUNTED_P(_z2); \ + uint32_t _t = Z_TYPE_INFO_P(_z2); \ + ZVAL_COPY_VALUE_EX(_z1, _z2, _gc, _t); \ + if (Z_TYPE_INFO_REFCOUNTED(_t)) { \ + /* Objects reuse PERSISTENT as WEAKLY_REFERENCED */ \ + if (EXPECTED(!(GC_FLAGS(_gc) & GC_PERSISTENT) \ + || GC_TYPE(_gc) == IS_OBJECT)) { \ + GC_ADDREF(_gc); \ + } else { \ + zval_copy_ctor_func(_z1); \ + } \ + } \ + } while (0) + +#define ZVAL_DEREF(z) do { \ + if (UNEXPECTED(Z_ISREF_P(z))) { \ + (z) = Z_REFVAL_P(z); \ + } \ + } while (0) + +#define ZVAL_DEINDIRECT(z) do { \ + if (Z_TYPE_P(z) == IS_INDIRECT) { \ + (z) = Z_INDIRECT_P(z); \ + } \ + } while (0) + +#define ZVAL_OPT_DEREF(z) do { \ + if (UNEXPECTED(Z_OPT_ISREF_P(z))) { \ + (z) = Z_REFVAL_P(z); \ + } \ + } while (0) + +#define ZVAL_MAKE_REF(zv) do { \ + zval *__zv = (zv); \ + if (!Z_ISREF_P(__zv)) { \ + ZVAL_NEW_REF(__zv, __zv); \ + } \ + } while (0) + +#define ZVAL_UNREF(z) do { \ + zval *_z = (z); \ + zend_reference *ref; \ + ZEND_ASSERT(Z_ISREF_P(_z)); \ + ref = Z_REF_P(_z); \ + ZVAL_COPY_VALUE(_z, &ref->val); \ + efree_size(ref, sizeof(zend_reference)); \ + } while (0) + +#define ZVAL_COPY_DEREF(z, v) do { \ + zval *_z3 = (v); \ + if (Z_OPT_REFCOUNTED_P(_z3)) { \ + if (UNEXPECTED(Z_OPT_ISREF_P(_z3))) { \ + _z3 = Z_REFVAL_P(_z3); \ + if (Z_OPT_REFCOUNTED_P(_z3)) { \ + Z_ADDREF_P(_z3); \ + } \ + } else { \ + Z_ADDREF_P(_z3); \ + } \ + } \ + ZVAL_COPY_VALUE(z, _z3); \ + } while (0) + + +#define SEPARATE_STRING(zv) do { \ + zval *_zv = (zv); \ + if (Z_REFCOUNT_P(_zv) > 1) { \ + zend_string *_str = Z_STR_P(_zv); \ + ZEND_ASSERT(Z_REFCOUNTED_P(_zv)); \ + ZEND_ASSERT(!ZSTR_IS_INTERNED(_str)); \ + ZVAL_NEW_STR(_zv, zend_string_init( \ + ZSTR_VAL(_str), ZSTR_LEN(_str), 0)); \ + GC_DELREF(_str); \ + } \ + } while (0) + +#define SEPARATE_ARRAY(zv) do { \ + zval *__zv = (zv); \ + zend_array *_arr = Z_ARR_P(__zv); \ + if (UNEXPECTED(GC_REFCOUNT(_arr) > 1)) { \ + ZVAL_ARR(__zv, zend_array_dup(_arr)); \ + GC_TRY_DELREF(_arr); \ + } \ + } while (0) + +#define SEPARATE_ZVAL_NOREF(zv) do { \ + zval *_zv = (zv); \ + ZEND_ASSERT(Z_TYPE_P(_zv) != IS_REFERENCE); \ + if (Z_TYPE_P(_zv) == IS_ARRAY) { \ + SEPARATE_ARRAY(_zv); \ + } \ + } while (0) + +#define SEPARATE_ZVAL(zv) do { \ + zval *_zv = (zv); \ + if (Z_ISREF_P(_zv)) { \ + zend_reference *_r = Z_REF_P(_zv); \ + ZVAL_COPY_VALUE(_zv, &_r->val); \ + if (GC_DELREF(_r) == 0) { \ + efree_size(_r, sizeof(zend_reference)); \ + } else if (Z_OPT_TYPE_P(_zv) == IS_ARRAY) { \ + ZVAL_ARR(_zv, zend_array_dup(Z_ARR_P(_zv)));\ + break; \ + } else if (Z_OPT_REFCOUNTED_P(_zv)) { \ + Z_ADDREF_P(_zv); \ + break; \ + } \ + } \ + if (Z_TYPE_P(_zv) == IS_ARRAY) { \ + SEPARATE_ARRAY(_zv); \ + } \ + } while (0) + +/* Properties store a flag distinguishing unset and uninitialized properties + * (both use IS_UNDEF type) in the Z_EXTRA space. As such we also need to copy + * the Z_EXTRA space when copying property default values etc. We define separate + * macros for this purpose, so this workaround is easier to remove in the future. */ +#define IS_PROP_UNINIT (1<<0) +#define IS_PROP_REINITABLE (1<<1) /* It has impact only on readonly properties */ +#define Z_PROP_FLAG_P(z) Z_EXTRA_P(z) +#define ZVAL_COPY_VALUE_PROP(z, v) \ + do { *(z) = *(v); } while (0) +#define ZVAL_COPY_PROP(z, v) \ + do { ZVAL_COPY(z, v); Z_PROP_FLAG_P(z) = Z_PROP_FLAG_P(v); } while (0) +#define ZVAL_COPY_OR_DUP_PROP(z, v) \ + do { ZVAL_COPY_OR_DUP(z, v); Z_PROP_FLAG_P(z) = Z_PROP_FLAG_P(v); } while (0) + + +static zend_always_inline bool zend_may_modify_arg_in_place(const zval *arg) +{ + return Z_REFCOUNTED_P(arg) && !(GC_FLAGS(Z_COUNTED_P(arg)) & (GC_IMMUTABLE | GC_PERSISTENT)) && Z_REFCOUNT_P(arg) == 1; +} + +#endif /* ZEND_TYPES_H */ diff --git a/include/php/Zend/zend_variables.h b/include/php/Zend/zend_variables.h new file mode 100644 index 0000000..ea3fd9c --- /dev/null +++ b/include/php/Zend/zend_variables.h @@ -0,0 +1,92 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_VARIABLES_H +#define ZEND_VARIABLES_H + +#include "zend_types.h" +#include "zend_gc.h" + +BEGIN_EXTERN_C() + +ZEND_API void ZEND_FASTCALL rc_dtor_func(zend_refcounted *p); +ZEND_API void ZEND_FASTCALL zval_copy_ctor_func(zval *zvalue); + +static zend_always_inline void zval_ptr_dtor_nogc(zval *zval_ptr) +{ + if (Z_REFCOUNTED_P(zval_ptr) && !Z_DELREF_P(zval_ptr)) { + rc_dtor_func(Z_COUNTED_P(zval_ptr)); + } +} + +static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr) +{ + if (Z_REFCOUNTED_P(zval_ptr)) { + zend_refcounted *ref = Z_COUNTED_P(zval_ptr); + if (!GC_DELREF(ref)) { + rc_dtor_func(ref); + } else { + gc_check_possible_root(ref); + } + } +} + +static zend_always_inline void zval_copy_ctor(zval *zvalue) +{ + if (Z_TYPE_P(zvalue) == IS_ARRAY) { + ZVAL_ARR(zvalue, zend_array_dup(Z_ARR_P(zvalue))); + } else if (Z_REFCOUNTED_P(zvalue)) { + Z_ADDREF_P(zvalue); + } +} + +static zend_always_inline void zval_opt_copy_ctor(zval *zvalue) +{ + if (Z_OPT_TYPE_P(zvalue) == IS_ARRAY) { + ZVAL_ARR(zvalue, zend_array_dup(Z_ARR_P(zvalue))); + } else if (Z_OPT_REFCOUNTED_P(zvalue)) { + Z_ADDREF_P(zvalue); + } +} + +static zend_always_inline void zval_ptr_dtor_str(zval *zval_ptr) +{ + if (Z_REFCOUNTED_P(zval_ptr) && !Z_DELREF_P(zval_ptr)) { + ZEND_ASSERT(Z_TYPE_P(zval_ptr) == IS_STRING); + ZEND_ASSERT(!ZSTR_IS_INTERNED(Z_STR_P(zval_ptr))); + ZEND_ASSERT(!(GC_FLAGS(Z_STR_P(zval_ptr)) & IS_STR_PERSISTENT)); + efree(Z_STR_P(zval_ptr)); + } +} + +ZEND_API void zval_ptr_dtor(zval *zval_ptr); +ZEND_API void zval_internal_ptr_dtor(zval *zvalue); + +/* Kept for compatibility */ +#define zval_dtor(zvalue) zval_ptr_dtor_nogc(zvalue) + +ZEND_API void zval_add_ref(zval *p); + +END_EXTERN_C() + +#define ZVAL_PTR_DTOR zval_ptr_dtor +#define ZVAL_INTERNAL_PTR_DTOR zval_internal_ptr_dtor + +#endif diff --git a/include/php/Zend/zend_virtual_cwd.h b/include/php/Zend/zend_virtual_cwd.h new file mode 100644 index 0000000..15c3b98 --- /dev/null +++ b/include/php/Zend/zend_virtual_cwd.h @@ -0,0 +1,394 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Sascha Schumann | + | Pierre Joye | + +----------------------------------------------------------------------+ +*/ + +#ifndef VIRTUAL_CWD_H +#define VIRTUAL_CWD_H + +#include "TSRM.h" + +#include +#include +#include + +#ifdef HAVE_UTIME_H +#include +#endif + +#include +#include + +#if HAVE_SYS_PARAM_H +# include +#endif + +#ifndef MAXPATHLEN +# if _WIN32 +# include "win32/ioutil.h" +# define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN +# elif PATH_MAX +# define MAXPATHLEN PATH_MAX +# elif defined(MAX_PATH) +# define MAXPATHLEN MAX_PATH +# else +# define MAXPATHLEN 256 +# endif +#endif + +#ifdef ZTS +#define VIRTUAL_DIR +#endif + +#ifndef ZEND_WIN32 +#include +#else +#include +#endif + +#if defined(__osf__) || defined(_AIX) +#include +#endif + +#ifdef ZEND_WIN32 +#include "win32/readdir.h" +#include +#include "win32/ioutil.h" +/* mode_t isn't defined on Windows */ +typedef unsigned short mode_t; + +#define DEFAULT_SLASH '\\' +#define DEFAULT_DIR_SEPARATOR ';' +#define IS_SLASH(c) ((c) == '/' || (c) == '\\') +#define IS_SLASH_P(c) (*(c) == '/' || \ + (*(c) == '\\' && !IsDBCSLeadByte(*(c-1)))) + +/* COPY_WHEN_ABSOLUTE is 2 under Win32 because by chance both regular absolute paths + in the file system and UNC paths need copying of two characters */ +#define COPY_WHEN_ABSOLUTE(path) 2 +#define IS_UNC_PATH(path, len) \ + (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1])) +#define IS_ABSOLUTE_PATH(path, len) \ + (len >= 2 && (/* is local */isalpha(path[0]) && path[1] == ':' || /* is UNC */IS_SLASH(path[0]) && IS_SLASH(path[1]))) + +#else +#ifdef HAVE_DIRENT_H +#include + +#ifndef DT_UNKNOWN +# define DT_UNKNOWN 0 +#endif +#ifndef DT_DIR +# define DT_DIR 4 +#endif +#ifndef DT_REG +# define DT_REG 8 +#endif +#endif + +#define DEFAULT_SLASH '/' + +#ifdef __riscos__ +#define DEFAULT_DIR_SEPARATOR ';' +#else +#define DEFAULT_DIR_SEPARATOR ':' +#endif + +#define IS_SLASH(c) ((c) == '/') +#define IS_SLASH_P(c) (*(c) == '/') + +#endif + + +#ifndef COPY_WHEN_ABSOLUTE +#define COPY_WHEN_ABSOLUTE(path) 0 +#endif + +#ifndef IS_ABSOLUTE_PATH +#define IS_ABSOLUTE_PATH(path, len) \ + (IS_SLASH(path[0])) +#endif + +#ifdef TSRM_EXPORTS +#define CWD_EXPORTS +#endif + +#ifdef ZEND_WIN32 +# ifdef CWD_EXPORTS +# define CWD_API __declspec(dllexport) +# else +# define CWD_API __declspec(dllimport) +# endif +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define CWD_API __attribute__ ((visibility("default"))) +#else +# define CWD_API +#endif + +#ifdef ZEND_WIN32 +# define php_sys_stat_ex php_win32_ioutil_stat_ex +# define php_sys_stat php_win32_ioutil_stat +# define php_sys_lstat php_win32_ioutil_lstat +# define php_sys_fstat php_win32_ioutil_fstat +# define php_sys_readlink php_win32_ioutil_readlink +# define php_sys_symlink php_win32_ioutil_symlink +# define php_sys_link php_win32_ioutil_link +#else +# define php_sys_stat stat +# define php_sys_lstat lstat +# define php_sys_fstat fstat +# ifdef HAVE_SYMLINK +# define php_sys_readlink(link, target, target_len) readlink(link, target, target_len) +# define php_sys_symlink symlink +# define php_sys_link link +# endif +#endif + +typedef struct _cwd_state { + char *cwd; + size_t cwd_length; +} cwd_state; + +typedef int (*verify_path_func)(const cwd_state *); + +CWD_API void virtual_cwd_startup(void); +CWD_API void virtual_cwd_shutdown(void); +CWD_API int virtual_cwd_activate(void); +CWD_API int virtual_cwd_deactivate(void); +CWD_API char *virtual_getcwd_ex(size_t *length); +CWD_API char *virtual_getcwd(char *buf, size_t size); +CWD_API zend_result virtual_chdir(const char *path); +CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path)); +CWD_API int virtual_filepath(const char *path, char **filepath); +CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path); +CWD_API char *virtual_realpath(const char *path, char *real_path); +CWD_API FILE *virtual_fopen(const char *path, const char *mode); +CWD_API int virtual_open(const char *path, int flags, ...); +CWD_API int virtual_creat(const char *path, mode_t mode); +CWD_API int virtual_rename(const char *oldname, const char *newname); +CWD_API int virtual_stat(const char *path, zend_stat_t *buf); +CWD_API int virtual_lstat(const char *path, zend_stat_t *buf); +CWD_API int virtual_unlink(const char *path); +CWD_API int virtual_mkdir(const char *pathname, mode_t mode); +CWD_API int virtual_rmdir(const char *pathname); +CWD_API DIR *virtual_opendir(const char *pathname); +CWD_API FILE *virtual_popen(const char *command, const char *type); +CWD_API int virtual_access(const char *pathname, int mode); + +#if HAVE_UTIME +CWD_API int virtual_utime(const char *filename, struct utimbuf *buf); +#endif +CWD_API int virtual_chmod(const char *filename, mode_t mode); +#if !defined(ZEND_WIN32) +CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link); +#endif + +/* One of the following constants must be used as the last argument + in virtual_file_ex() call. */ + +// TODO Make this into an enum +#define CWD_EXPAND 0 /* expand "." and ".." but don't resolve symlinks */ +#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */ +#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */ + +CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath); + +CWD_API char *tsrm_realpath(const char *path, char *real_path); + +#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */ +#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */ + +typedef struct _realpath_cache_bucket { + zend_ulong key; + char *path; + char *realpath; + struct _realpath_cache_bucket *next; + time_t expires; + uint16_t path_len; + uint16_t realpath_len; + uint8_t is_dir:1; +#ifdef ZEND_WIN32 + uint8_t is_rvalid:1; + uint8_t is_readable:1; + uint8_t is_wvalid:1; + uint8_t is_writable:1; +#endif +} realpath_cache_bucket; + +typedef struct _virtual_cwd_globals { + cwd_state cwd; + zend_long realpath_cache_size; + zend_long realpath_cache_size_limit; + zend_long realpath_cache_ttl; + realpath_cache_bucket *realpath_cache[1024]; +} virtual_cwd_globals; + +#ifdef ZTS +extern ts_rsrc_id cwd_globals_id; +extern size_t cwd_globals_offset; +# define CWDG(v) ZEND_TSRMG_FAST(cwd_globals_offset, virtual_cwd_globals *, v) +#else +extern virtual_cwd_globals cwd_globals; +# define CWDG(v) (cwd_globals.v) +#endif + +CWD_API void realpath_cache_clean(void); +CWD_API void realpath_cache_del(const char *path, size_t path_len); +CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, size_t path_len, time_t t); +CWD_API zend_long realpath_cache_size(void); +CWD_API zend_long realpath_cache_max_buckets(void); +CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void); + +#ifdef CWD_EXPORTS +extern void virtual_cwd_main_cwd_init(uint8_t); +#endif + +/* The actual macros to be used in programs using TSRM + * If the program defines VIRTUAL_DIR it will use the + * virtual_* functions + */ + +#ifdef VIRTUAL_DIR + +#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size) +#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode) +/* Because open() has two modes, we have to macros to replace it */ +#define VCWD_OPEN(path, flags) virtual_open(path, flags) +#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path, flags, mode) +#define VCWD_CREAT(path, mode) virtual_creat(path, mode) +#define VCWD_CHDIR(path) virtual_chdir(path) +#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, (int (*)(const char *)) virtual_chdir) +#define VCWD_GETWD(buf) +#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path) +#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname) +#define VCWD_STAT(path, buff) virtual_stat(path, buff) +# define VCWD_LSTAT(path, buff) virtual_lstat(path, buff) +#define VCWD_UNLINK(path) virtual_unlink(path) +#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode) +#define VCWD_RMDIR(pathname) virtual_rmdir(pathname) +#define VCWD_OPENDIR(pathname) virtual_opendir(pathname) +#define VCWD_POPEN(command, type) virtual_popen(command, type) +#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode) +#if HAVE_UTIME +#define VCWD_UTIME(path, time) virtual_utime(path, time) +#endif +#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode) +#if !defined(ZEND_WIN32) +#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0) +#if HAVE_LCHOWN +#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1) +#endif +#endif + +#else + +#define VCWD_CREAT(path, mode) creat(path, mode) +/* rename on windows will fail if newname already exists. + MoveFileEx has to be used */ +#if defined(ZEND_WIN32) +#define VCWD_FOPEN(path, mode) php_win32_ioutil_fopen(path, mode) +#define VCWD_OPEN(path, flags) php_win32_ioutil_open(path, flags) +#define VCWD_OPEN_MODE(path, flags, mode) php_win32_ioutil_open(path, flags, mode) +# define VCWD_RENAME(oldname, newname) php_win32_ioutil_rename(oldname, newname) +#define VCWD_MKDIR(pathname, mode) php_win32_ioutil_mkdir(pathname, mode) +#define VCWD_RMDIR(pathname) php_win32_ioutil_rmdir(pathname) +#define VCWD_UNLINK(path) php_win32_ioutil_unlink(path) +#define VCWD_CHDIR(path) php_win32_ioutil_chdir(path) +#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode) +#define VCWD_GETCWD(buff, size) php_win32_ioutil_getcwd(buff, size) +#define VCWD_CHMOD(path, mode) php_win32_ioutil_chmod(path, mode) +#else +#define VCWD_FOPEN(path, mode) fopen(path, mode) +#define VCWD_OPEN(path, flags) open(path, flags) +#define VCWD_OPEN_MODE(path, flags, mode) open(path, flags, mode) +# define VCWD_RENAME(oldname, newname) rename(oldname, newname) +#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode) +#define VCWD_RMDIR(pathname) rmdir(pathname) +#define VCWD_UNLINK(path) unlink(path) +#define VCWD_CHDIR(path) chdir(path) +#define VCWD_ACCESS(pathname, mode) access(pathname, mode) +#define VCWD_GETCWD(buff, size) getcwd(buff, size) +#define VCWD_CHMOD(path, mode) chmod(path, mode) +#endif + +#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir) +#define VCWD_GETWD(buf) getwd(buf) +#define VCWD_STAT(path, buff) php_sys_stat(path, buff) +#define VCWD_LSTAT(path, buff) lstat(path, buff) +#define VCWD_OPENDIR(pathname) opendir(pathname) +#define VCWD_POPEN(command, type) popen(command, type) + +#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path) + +#if HAVE_UTIME +# ifdef ZEND_WIN32 +# define VCWD_UTIME(path, time) win32_utime(path, time) +# else +# define VCWD_UTIME(path, time) utime(path, time) +# endif +#endif + +#if !defined(ZEND_WIN32) +#define VCWD_CHOWN(path, owner, group) chown(path, owner, group) +#if HAVE_LCHOWN +#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group) +#endif +#endif + +#endif + +/* Global stat declarations */ +#ifndef _S_IFDIR +#define _S_IFDIR S_IFDIR +#endif + +#ifndef _S_IFREG +#define _S_IFREG S_IFREG +#endif + +#ifndef S_IFLNK +#define _IFLNK 0120000 /* symbolic link */ +#define S_IFLNK _IFLNK +#endif + +#ifndef S_ISDIR +#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif + +#ifndef S_ISREG +#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#endif + +#ifndef S_ISLNK +#define S_ISLNK(mode) (((mode)&S_IFMT) == S_IFLNK) +#endif + +#ifndef S_IXROOT +#define S_IXROOT ( S_IXUSR | S_IXGRP | S_IXOTH ) +#endif + +/* XXX should be _S_IFIFO? */ +#ifndef S_IFIFO +#define _IFIFO 0010000 /* fifo */ +#define S_IFIFO _IFIFO +#endif + +#ifndef S_IFBLK +#define _IFBLK 0060000 /* block special */ +#define S_IFBLK _IFBLK +#endif + +#endif /* VIRTUAL_CWD_H */ diff --git a/include/php/Zend/zend_vm.h b/include/php/Zend/zend_vm.h new file mode 100644 index 0000000..1b7cf13 --- /dev/null +++ b/include/php/Zend/zend_vm.h @@ -0,0 +1,41 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_VM_H +#define ZEND_VM_H + +BEGIN_EXTERN_C() + +ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* opcode); +ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* opcode, uint32_t op1_info, uint32_t op2_info, uint32_t res_info); +ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op); +ZEND_API void ZEND_FASTCALL zend_deserialize_opcode_handler(zend_op *op); +ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *op); +ZEND_API const zend_op *zend_get_halt_op(void); +ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data *ex); +ZEND_API int zend_vm_kind(void); +ZEND_API bool zend_gcc_global_regs(void); + +void zend_vm_init(void); +void zend_vm_dtor(void); + +END_EXTERN_C() + +#define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline) + +#endif diff --git a/include/php/Zend/zend_vm_def.h b/include/php/Zend/zend_vm_def.h new file mode 100644 index 0000000..f731653 --- /dev/null +++ b/include/php/Zend/zend_vm_def.h @@ -0,0 +1,10142 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +/* If you change this file, please regenerate the zend_vm_execute.h and + * zend_vm_opcodes.h files by running: + * php zend_vm_gen.php + */ + +ZEND_VM_HELPER(zend_add_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + add_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_NOCONSTCONST_HANDLER(1, ZEND_ADD, CONST|TMPVARCV, CONST|TMPVARCV) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_add_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + ZEND_VM_C_GOTO(add_double); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +ZEND_VM_C_LABEL(add_double): + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 + d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + ZEND_VM_C_GOTO(add_double); + } + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_add_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_sub_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + sub_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_NOCONSTCONST_HANDLER(2, ZEND_SUB, CONST|TMPVARCV, CONST|TMPVARCV) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + ZEND_VM_C_GOTO(sub_double); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +ZEND_VM_C_LABEL(sub_double): + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 - d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + ZEND_VM_C_GOTO(sub_double); + } + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_sub_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_mul_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + mul_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(3, ZEND_MUL, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + zend_long overflow; + + result = EX_VAR(opline->result.var); + ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow); + Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG; + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + ZEND_VM_C_GOTO(mul_double); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +ZEND_VM_C_LABEL(mul_double): + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 * d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + ZEND_VM_C_GOTO(mul_double); + } + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_mul_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(4, ZEND_DIV, CONST|TMPVAR|CV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR(BP_VAR_R); + div_function(EX_VAR(opline->result.var), op1, op2); + FREE_OP1(); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_HELPER(zend_mod_by_zero_helper, ANY, ANY) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); +} + +ZEND_VM_HELPER(zend_mod_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + mod_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(5, ZEND_MOD, CONST|TMPVARCV, CONST|TMPVARCV) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + if (UNEXPECTED(Z_LVAL_P(op2) == 0)) { + ZEND_VM_DISPATCH_TO_HELPER(zend_mod_by_zero_helper); + } else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) { + /* Prevent overflow error/crash if op1==ZEND_LONG_MIN */ + ZVAL_LONG(result, 0); + } else { + ZVAL_LONG(result, Z_LVAL_P(op1) % Z_LVAL_P(op2)); + } + ZEND_VM_NEXT_OPCODE(); + } + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_mod_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_shift_left_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + shift_left_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(6, ZEND_SL, CONST|TMPVARCV, CONST|TMPVARCV) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + /* Perform shift on unsigned numbers to get well-defined wrap behavior. */ + ZVAL_LONG(EX_VAR(opline->result.var), + (zend_long) ((zend_ulong) Z_LVAL_P(op1) << Z_LVAL_P(op2))); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_shift_left_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_shift_right_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + shift_right_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(7, ZEND_SR, CONST|TMPVARCV, CONST|TMPVARCV) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) >> Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_shift_right_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(12, ZEND_POW, CONST|TMPVAR|CV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR(BP_VAR_R); + pow_function(EX_VAR(opline->result.var), op1, op2); + FREE_OP1(); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(8, ZEND_CONCAT, CONST|TMPVAR|CV, CONST|TMPVAR|CV, SPEC(NO_CONST_CONST)) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + + if ((OP1_TYPE == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (OP2_TYPE == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (OP1_TYPE != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (OP2_TYPE == IS_CONST || OP2_TYPE == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (OP2_TYPE != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + FREE_OP1(); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(16, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV, SPEC(COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R); + result = fast_is_identical_function(op1, op2); + FREE_OP1(); + FREE_OP2(); + ZEND_VM_SMART_BRANCH(result, 1); +} + +ZEND_VM_HANDLER(196, ZEND_CASE_STRICT, TMP|VAR, CONST|TMP|VAR|CV) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R); + result = fast_is_identical_function(op1, op2); + FREE_OP2(); + ZEND_VM_SMART_BRANCH(result, 1); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(17, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV, SPEC(COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R); + result = fast_is_not_identical_function(op1, op2); + FREE_OP1(); + FREE_OP2(); + ZEND_VM_SMART_BRANCH(result, 1); +} + +ZEND_VM_HELPER(zend_is_equal_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret == 0, 1); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(18, ZEND_IS_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV, SPEC(SMART_BRANCH,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +ZEND_VM_C_LABEL(is_equal_true): + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +ZEND_VM_C_LABEL(is_equal_false): + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + ZEND_VM_C_GOTO(is_equal_double); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +ZEND_VM_C_LABEL(is_equal_double): + if (d1 == d2) { + ZEND_VM_C_GOTO(is_equal_true); + } else { + ZEND_VM_C_GOTO(is_equal_false); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + ZEND_VM_C_GOTO(is_equal_double); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + ZEND_VM_C_GOTO(is_equal_true); + } else { + ZEND_VM_C_GOTO(is_equal_false); + } + } + } + ZEND_VM_DISPATCH_TO_HELPER(zend_is_equal_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_is_not_equal_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret != 0, 1); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(19, ZEND_IS_NOT_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV, SPEC(SMART_BRANCH,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +ZEND_VM_C_LABEL(is_not_equal_true): + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +ZEND_VM_C_LABEL(is_not_equal_false): + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + ZEND_VM_C_GOTO(is_not_equal_double); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +ZEND_VM_C_LABEL(is_not_equal_double): + if (d1 != d2) { + ZEND_VM_C_GOTO(is_not_equal_true); + } else { + ZEND_VM_C_GOTO(is_not_equal_false); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + ZEND_VM_C_GOTO(is_not_equal_double); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + ZEND_VM_C_GOTO(is_not_equal_true); + } else { + ZEND_VM_C_GOTO(is_not_equal_false); + } + } + } + ZEND_VM_DISPATCH_TO_HELPER(zend_is_not_equal_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_is_smaller_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret < 0, 1); +} + +ZEND_VM_HOT_NOCONSTCONST_HANDLER(20, ZEND_IS_SMALLER, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH)) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +ZEND_VM_C_LABEL(is_smaller_true): + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +ZEND_VM_C_LABEL(is_smaller_false): + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + ZEND_VM_C_GOTO(is_smaller_double); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +ZEND_VM_C_LABEL(is_smaller_double): + if (d1 < d2) { + ZEND_VM_C_GOTO(is_smaller_true); + } else { + ZEND_VM_C_GOTO(is_smaller_false); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + ZEND_VM_C_GOTO(is_smaller_double); + } + } + ZEND_VM_DISPATCH_TO_HELPER(zend_is_smaller_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_is_smaller_or_equal_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret <= 0, 1); +} + +ZEND_VM_HOT_NOCONSTCONST_HANDLER(21, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH)) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +ZEND_VM_C_LABEL(is_smaller_or_equal_true): + ZEND_VM_SMART_BRANCH_TRUE(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +ZEND_VM_C_LABEL(is_smaller_or_equal_false): + ZEND_VM_SMART_BRANCH_FALSE(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + ZEND_VM_C_GOTO(is_smaller_or_equal_double); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +ZEND_VM_C_LABEL(is_smaller_or_equal_double): + if (d1 <= d2) { + ZEND_VM_C_GOTO(is_smaller_or_equal_true); + } else { + ZEND_VM_C_GOTO(is_smaller_or_equal_false); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + ZEND_VM_C_GOTO(is_smaller_or_equal_double); + } + } + ZEND_VM_DISPATCH_TO_HELPER(zend_is_smaller_or_equal_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(170, ZEND_SPACESHIP, CONST|TMPVAR|CV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR(BP_VAR_R); + compare_function(EX_VAR(opline->result.var), op1, op2); + FREE_OP1(); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HELPER(zend_bw_or_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + bitwise_or_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_NOCONSTCONST_HANDLER(9, ZEND_BW_OR, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) | Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_bw_or_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_bw_and_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + bitwise_and_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_NOCONSTCONST_HANDLER(10, ZEND_BW_AND, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) & Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_bw_and_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HELPER(zend_bw_xor_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + bitwise_xor_function(EX_VAR(opline->result.var), op_1, op_2); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_NOCONSTCONST_HANDLER(11, ZEND_BW_XOR, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (ZEND_VM_SPEC && OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) ^ Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_bw_xor_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(15, ZEND_BOOL_XOR, CONST|TMPVAR|CV, CONST|TMPVAR|CV, SPEC(COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR(BP_VAR_R); + boolean_xor_function(EX_VAR(opline->result.var), op1, op2); + FREE_OP1(); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HELPER(zend_bw_not_helper, ANY, ANY, zval *op_1) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + bitwise_not_function(EX_VAR(opline->result.var), op_1); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_NOCONST_HANDLER(13, ZEND_BW_NOT, CONST|TMPVARCV, ANY) +{ + USE_OPLINE + zval *op1; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), ~Z_LVAL_P(op1)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_bw_not_helper, op_1, op1); +} + +ZEND_VM_COLD_CONST_HANDLER(14, ZEND_BOOL_NOT, CONST|TMPVAR|CV, ANY) +{ + USE_OPLINE + zval *val; + + val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + /* The result and op1 can be the same cv zval */ + const uint32_t orig_val_type = Z_TYPE_INFO_P(val); + ZVAL_TRUE(EX_VAR(opline->result.var)); + if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } else { + SAVE_OPLINE(); + ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val)); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_HELPER(zend_this_not_in_object_context_helper, ANY, ANY) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_error(NULL, "Using $this when not in object context"); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); +} + +ZEND_VM_COLD_HELPER(zend_undefined_function_helper, ANY, ANY) +{ + USE_OPLINE + zval *function_name; + + SAVE_OPLINE(); + function_name = RT_CONSTANT(opline, opline->op2); + zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name)); + HANDLE_EXCEPTION(); +} + +ZEND_VM_HANDLER(28, ZEND_ASSIGN_OBJ_OP, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, OP) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + + do { + value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R); + + if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + ZEND_VM_C_GOTO(assign_op_object); + } + if (OP1_TYPE == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +ZEND_VM_C_LABEL(assign_op_object): + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (OP2_TYPE == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (OP2_TYPE == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP_DATA(); + FREE_OP2(); + FREE_OP1(); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +ZEND_VM_HANDLER(29, ZEND_ASSIGN_STATIC_PROP_OP, ANY, ANY, OP) +{ + /* This helper actually never will receive IS_VAR as second op, and has the same handling for VAR and TMP in the first op, but for interoperability with the other binary_assign_op helpers, it is necessary to "include" it */ + + USE_OPLINE + zval *prop, *value; + zend_property_info *prop_info; + zend_reference *ref; + + SAVE_OPLINE(); + + if (UNEXPECTED(zend_fetch_static_property_address(&prop, &prop_info, (opline+1)->extended_value, BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS)) { + UNDEF_RESULT(); + FREE_OP_DATA(); + HANDLE_EXCEPTION(); + } + + value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R); + + do { + if (UNEXPECTED(Z_ISREF_P(prop))) { + ref = Z_REF_P(prop); + prop = Z_REFVAL_P(prop); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, prop, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(prop, prop, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), prop); + } + + FREE_OP_DATA(); + /* assign_static_prop has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +ZEND_VM_HANDLER(27, ZEND_ASSIGN_DIM_OP, VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV, OP) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +ZEND_VM_C_LABEL(assign_dim_op_array): + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +ZEND_VM_C_LABEL(assign_dim_op_new_array): + dim = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP2_TYPE == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + ZEND_VM_C_GOTO(assign_dim_op_ret_null); + } + } else { + if (OP2_TYPE == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + ZEND_VM_C_GOTO(assign_dim_op_ret_null); + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if (OP2_TYPE != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + ZEND_VM_C_GOTO(assign_dim_op_array); + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP2_TYPE == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + ZEND_VM_C_GOTO(assign_dim_op_ret_null); + } + } + ZEND_VM_C_GOTO(assign_dim_op_new_array); + } else { + dim = GET_OP2_ZVAL_PTR(BP_VAR_R); + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +ZEND_VM_C_LABEL(assign_dim_op_ret_null): + FREE_OP_DATA(); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +ZEND_VM_HANDLER(26, ZEND_ASSIGN_OP, VAR|CV, CONST|TMPVAR|CV, OP) +{ + USE_OPLINE + zval *var_ptr; + zval *value; + + SAVE_OPLINE(); + value = GET_OP2_ZVAL_PTR(BP_VAR_R); + var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(132, ZEND_PRE_INC_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + + do { + if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + ZEND_VM_C_GOTO(pre_incdec_object); + } + if (OP1_TYPE == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +ZEND_VM_C_LABEL(pre_incdec_object): + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if (OP2_TYPE == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(133, ZEND_PRE_DEC_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_PRE_INC_OBJ); +} + +ZEND_VM_HANDLER(134, ZEND_POST_INC_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + + do { + if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + ZEND_VM_C_GOTO(post_incdec_object); + } + if (OP1_TYPE == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +ZEND_VM_C_LABEL(post_incdec_object): + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if (OP2_TYPE == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(135, ZEND_POST_DEC_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_POST_INC_OBJ); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +ZEND_VM_HANDLER(38, ZEND_PRE_INC_STATIC_PROP, ANY, ANY, CACHE_SLOT) +{ + USE_OPLINE + zval *prop; + zend_property_info *prop_info; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + zend_pre_incdec_property_zval(prop, + ZEND_TYPE_IS_SET(prop_info->type) ? prop_info : NULL OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +ZEND_VM_HANDLER(39, ZEND_PRE_DEC_STATIC_PROP, ANY, ANY, CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_PRE_INC_STATIC_PROP); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +ZEND_VM_HANDLER(40, ZEND_POST_INC_STATIC_PROP, ANY, ANY, CACHE_SLOT) +{ + USE_OPLINE + zval *prop; + zend_property_info *prop_info; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + zend_post_incdec_property_zval(prop, + ZEND_TYPE_IS_SET(prop_info->type) ? prop_info : NULL OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +ZEND_VM_HANDLER(41, ZEND_POST_DEC_STATIC_PROP, ANY, ANY, CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_POST_INC_STATIC_PROP); +} + +ZEND_VM_HELPER(zend_pre_inc_helper, VAR|CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + SAVE_OPLINE(); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, NULL OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + increment_function(var_ptr); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY, SPEC(RETVAL)) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_increment_function(var_ptr); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_pre_inc_helper); +} + +ZEND_VM_HELPER(zend_pre_dec_helper, VAR|CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + SAVE_OPLINE(); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, NULL OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + decrement_function(var_ptr); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY, SPEC(RETVAL)) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_decrement_function(var_ptr); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_pre_dec_helper); +} + +ZEND_VM_HELPER(zend_post_inc_helper, VAR|CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + SAVE_OPLINE(); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, EX_VAR(opline->result.var) OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + + increment_function(var_ptr); + } while (0); + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_increment_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_post_inc_helper); +} + +ZEND_VM_HELPER(zend_post_dec_helper, VAR|CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + SAVE_OPLINE(); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, EX_VAR(opline->result.var) OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + + decrement_function(var_ptr); + } while (0); + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_decrement_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_post_dec_helper); +} + +ZEND_VM_HANDLER(136, ZEND_ECHO, CONST|TMPVAR|CV, ANY) +{ + USE_OPLINE + zval *z; + + SAVE_OPLINE(); + z = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (Z_TYPE_P(z) == IS_STRING) { + zend_string *str = Z_STR_P(z); + + if (ZSTR_LEN(str) != 0) { + zend_write(ZSTR_VAL(str), ZSTR_LEN(str)); + } + } else { + zend_string *str = zval_get_string_func(z); + + if (ZSTR_LEN(str) != 0) { + zend_write(ZSTR_VAL(str), ZSTR_LEN(str)); + } else if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(z) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_string_release_ex(str, 0); + } + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HELPER(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED, int type) +{ + USE_OPLINE + zval *varname; + zval *retval; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + varname = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (OP1_TYPE == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + tmp_name = NULL; + } else { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + if (!(opline->extended_value & ZEND_FETCH_GLOBAL_LOCK)) { + FREE_OP1(); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + retval = zend_hash_find_ex(target_symbol_table, name, OP1_TYPE == IS_CONST); + if (retval == NULL) { + if (UNEXPECTED(zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS)))) { +ZEND_VM_C_LABEL(fetch_this): + zend_fetch_this_var(type OPLINE_CC EXECUTE_DATA_CC); + if (OP1_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + if (type == BP_VAR_W) { + retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval)); + } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) { + retval = &EG(uninitialized_zval); + } else { + if (OP1_TYPE == IS_CV) { + /* Keep name alive in case an error handler tries to free it. */ + zend_string_addref(name); + } + zend_error(E_WARNING, "Undefined %svariable $%s", + (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name)); + if (type == BP_VAR_RW && !EG(exception)) { + retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval)); + } else { + retval = &EG(uninitialized_zval); + } + if (OP1_TYPE == IS_CV) { + zend_string_release(name); + } + } + /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */ + } else if (Z_TYPE_P(retval) == IS_INDIRECT) { + retval = Z_INDIRECT_P(retval); + if (Z_TYPE_P(retval) == IS_UNDEF) { + if (UNEXPECTED(zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS)))) { + ZEND_VM_C_GOTO(fetch_this); + } + if (type == BP_VAR_W) { + ZVAL_NULL(retval); + } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) { + retval = &EG(uninitialized_zval); + } else { + zend_error(E_WARNING, "Undefined %svariable $%s", + (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name)); + if (type == BP_VAR_RW && !EG(exception)) { + ZVAL_NULL(retval); + } else { + retval = &EG(uninitialized_zval); + } + } + } + } + + if (!(opline->extended_value & ZEND_FETCH_GLOBAL_LOCK)) { + FREE_OP1(); + } + + if (OP1_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + ZEND_ASSERT(retval != NULL); + if (type == BP_VAR_R || type == BP_VAR_IS) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else { + ZVAL_INDIRECT(EX_VAR(opline->result.var), retval); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(80, ZEND_FETCH_R, CONST|TMPVAR|CV, UNUSED, VAR_FETCH) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_var_address_helper, type, BP_VAR_R); +} + +ZEND_VM_HANDLER(83, ZEND_FETCH_W, CONST|TMPVAR|CV, UNUSED, VAR_FETCH) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_var_address_helper, type, BP_VAR_W); +} + +ZEND_VM_HANDLER(86, ZEND_FETCH_RW, CONST|TMPVAR|CV, UNUSED, VAR_FETCH) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_var_address_helper, type, BP_VAR_RW); +} + +ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMPVAR|CV, UNUSED, VAR_FETCH) +{ + int fetch_type = + (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ? + BP_VAR_W : BP_VAR_R; + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_var_address_helper, type, fetch_type); +} + +ZEND_VM_HANDLER(95, ZEND_FETCH_UNSET, CONST|TMPVAR|CV, UNUSED, VAR_FETCH) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_var_address_helper, type, BP_VAR_UNSET); +} + +ZEND_VM_HANDLER(89, ZEND_FETCH_IS, CONST|TMPVAR|CV, UNUSED, VAR_FETCH) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_var_address_helper, type, BP_VAR_IS); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +ZEND_VM_HELPER(zend_fetch_static_prop_helper, ANY, ANY, int type) +{ + USE_OPLINE + zval *prop; + + SAVE_OPLINE(); + + if (UNEXPECTED(zend_fetch_static_property_address(&prop, NULL, opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS, type, opline->extended_value OPLINE_CC EXECUTE_DATA_CC) != SUCCESS)) { + ZEND_ASSERT(EG(exception) || (type == BP_VAR_IS)); + prop = &EG(uninitialized_zval); + } + + if (type == BP_VAR_R || type == BP_VAR_IS) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), prop); + } else { + ZVAL_INDIRECT(EX_VAR(opline->result.var), prop); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +ZEND_VM_HANDLER(173, ZEND_FETCH_STATIC_PROP_R, ANY, CLASS_FETCH, CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_static_prop_helper, type, BP_VAR_R); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +ZEND_VM_HANDLER(174, ZEND_FETCH_STATIC_PROP_W, ANY, CLASS_FETCH, FETCH_REF|DIM_WRITE|CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_static_prop_helper, type, BP_VAR_W); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +ZEND_VM_HANDLER(175, ZEND_FETCH_STATIC_PROP_RW, ANY, CLASS_FETCH, CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_static_prop_helper, type, BP_VAR_RW); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +ZEND_VM_HANDLER(177, ZEND_FETCH_STATIC_PROP_FUNC_ARG, ANY, CLASS_FETCH, FETCH_REF|CACHE_SLOT) +{ + int fetch_type = + (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ? + BP_VAR_W : BP_VAR_R; + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_static_prop_helper, type, fetch_type); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +ZEND_VM_HANDLER(178, ZEND_FETCH_STATIC_PROP_UNSET, ANY, CLASS_FETCH, CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_static_prop_helper, type, BP_VAR_UNSET); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +ZEND_VM_HANDLER(176, ZEND_FETCH_STATIC_PROP_IS, ANY, CLASS_FETCH, CACHE_SLOT) +{ + ZEND_VM_DISPATCH_TO_HELPER(zend_fetch_static_prop_helper, type, BP_VAR_IS); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(81, ZEND_FETCH_DIM_R, CONST|TMPVAR|CV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + dim = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP1_TYPE != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +ZEND_VM_C_LABEL(fetch_dim_r_array): + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, OP2_TYPE, BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + ZEND_VM_C_GOTO(fetch_dim_r_array); + } else { + ZEND_VM_C_GOTO(fetch_dim_r_slow); + } + } else { +ZEND_VM_C_LABEL(fetch_dim_r_slow): + if (OP2_TYPE == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + } + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + zend_fetch_dimension_address_W(container, GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R), OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + FREE_OP2(); + if (OP1_TYPE == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + zend_fetch_dimension_address_RW(container, GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R), OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + FREE_OP2(); + if (OP1_TYPE == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(90, ZEND_FETCH_DIM_IS, CONST|TMPVAR|CV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_IS); + zend_fetch_dimension_address_read_IS(container, GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R), OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_HELPER(zend_use_tmp_in_write_context_helper, ANY, ANY) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot use temporary expression in write context"); + FREE_OP2(); + FREE_OP1(); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); +} + +ZEND_VM_COLD_HELPER(zend_use_undef_in_read_context_helper, ANY, ANY) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot use [] for reading"); + FREE_OP2(); + FREE_OP1(); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV) +{ +#if !ZEND_VM_SPEC + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_DISPATCH_TO_HELPER(zend_use_tmp_in_write_context_helper); + } + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_FETCH_DIM_W); + } else { + if (OP2_TYPE == IS_UNUSED) { + ZEND_VM_DISPATCH_TO_HELPER(zend_use_undef_in_read_context_helper); + } + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_FETCH_DIM_R); + } +} + +ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_UNSET); + zend_fetch_dimension_address_UNSET(container, GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R), OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + FREE_OP2(); + if (OP1_TYPE == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_OBJ_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMPVAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (OP1_TYPE == IS_CONST || + (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, GET_OP2_ZVAL_PTR(BP_VAR_R)); + ZVAL_NULL(EX_VAR(opline->result.var)); + ZEND_VM_C_GOTO(fetch_obj_r_finish); + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (OP2_TYPE == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (!ZEND_VM_SPEC || (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) != 0) { + ZEND_VM_C_GOTO(fetch_obj_r_copy); + } else { +ZEND_VM_C_LABEL(fetch_obj_r_fast_copy): + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (!ZEND_VM_SPEC || (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) != 0) { + ZEND_VM_C_GOTO(fetch_obj_r_copy); + } else { + ZEND_VM_C_GOTO(fetch_obj_r_fast_copy); + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (!ZEND_VM_SPEC || (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) != 0) { + ZEND_VM_C_GOTO(fetch_obj_r_copy); + } else { + ZEND_VM_C_GOTO(fetch_obj_r_fast_copy); + } + } + } + } + name = Z_STR_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + } else { + name = zval_try_get_tmp_string(GET_OP2_ZVAL_PTR(BP_VAR_R), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +ZEND_VM_C_LABEL(fetch_obj_r_copy): + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +ZEND_VM_C_LABEL(fetch_obj_r_finish): + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, FETCH_REF|DIM_WRITE|CACHE_SLOT) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, OP1_TYPE, property, OP2_TYPE, + ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + FREE_OP2(); + if (OP1_TYPE == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + FREE_OP2(); + if (OP1_TYPE == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_CONST_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS); + + if (OP1_TYPE == IS_CONST || + (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (OP2_TYPE == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + ZEND_VM_C_GOTO(fetch_obj_is_finish); + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (OP2_TYPE == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (!ZEND_VM_SPEC || (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) != 0) { + ZEND_VM_C_GOTO(fetch_obj_is_copy); + } else { +ZEND_VM_C_LABEL(fetch_obj_is_fast_copy): + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (!ZEND_VM_SPEC || (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) != 0) { + ZEND_VM_C_GOTO(fetch_obj_is_copy); + } else { + ZEND_VM_C_GOTO(fetch_obj_is_fast_copy); + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (!ZEND_VM_SPEC || (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) != 0) { + ZEND_VM_C_GOTO(fetch_obj_is_copy); + } else { + ZEND_VM_C_GOTO(fetch_obj_is_fast_copy); + } + } + } + } + name = Z_STR_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + } else { + name = zval_try_get_tmp_string(GET_OP2_ZVAL_PTR(BP_VAR_R), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +ZEND_VM_C_LABEL(fetch_obj_is_copy): + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +ZEND_VM_C_LABEL(fetch_obj_is_finish): + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_CONST_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, FETCH_REF|CACHE_SLOT) +{ +#if !ZEND_VM_SPEC + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_DISPATCH_TO_HELPER(zend_use_tmp_in_write_context_helper); + } + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_FETCH_OBJ_W); + } else { + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_FETCH_OBJ_R); + } +} + +ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_UNSET); + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + FREE_OP2(); + if (OP1_TYPE == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(98, ZEND_FETCH_LIST_R, CONST|TMPVARCV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + zend_fetch_dimension_address_LIST_r(container, GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R), OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(155, ZEND_FETCH_LIST_W, VAR, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *container, *dim; + + SAVE_OPLINE(); + container = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + dim = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (OP1_TYPE == IS_VAR + && Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT + && UNEXPECTED(!Z_ISREF_P(container)) + ) { + zend_error(E_NOTICE, "Attempting to set reference to non referenceable value"); + zend_fetch_dimension_address_LIST_r(container, dim, OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_fetch_dimension_address_W(container, dim, OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + } + + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(24, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT, SPEC(OP_DATA=CONST|TMP|VAR|CV)) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R); + + if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + ZEND_VM_C_GOTO(assign_object); + } + zend_throw_non_object_error(object, GET_OP2_ZVAL_PTR(BP_VAR_R) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + ZEND_VM_C_GOTO(free_and_exit_assign_obj); + } + +ZEND_VM_C_LABEL(assign_object): + zobj = Z_OBJ_P(object); + if (OP2_TYPE == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + ZEND_VM_C_GOTO(free_and_exit_assign_obj); + } else { +ZEND_VM_C_LABEL(fast_assign_obj): + value = zend_assign_to_variable_ex(property_val, value, OP_DATA_TYPE, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + ZEND_VM_C_GOTO(exit_assign_obj); + } + } + } else { + name = Z_STR_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + ZEND_VM_C_GOTO(fast_assign_obj); + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (OP_DATA_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (OP_DATA_TYPE != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (OP_DATA_TYPE == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (OP_DATA_TYPE == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + ZEND_VM_C_GOTO(exit_assign_obj); + } + } + } + name = Z_STR_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + } else { + name = zval_try_get_tmp_string(GET_OP2_ZVAL_PTR(BP_VAR_R), &tmp_name); + if (UNEXPECTED(!name)) { + FREE_OP_DATA(); + UNDEF_RESULT(); + ZEND_VM_C_GOTO(exit_assign_obj); + } + } + + if (OP_DATA_TYPE == IS_CV || OP_DATA_TYPE == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +ZEND_VM_C_LABEL(free_and_exit_assign_obj): + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + FREE_OP_DATA(); +ZEND_VM_C_LABEL(exit_assign_obj): + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + FREE_OP2(); + FREE_OP1(); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +ZEND_VM_HANDLER(25, ZEND_ASSIGN_STATIC_PROP, ANY, ANY, CACHE_SLOT, SPEC(OP_DATA=CONST|TMP|VAR|CV)) +{ + USE_OPLINE + zval *prop, *value; + zend_property_info *prop_info; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + FREE_OP_DATA(); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R); + + if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC); + FREE_OP_DATA(); + } else { + value = zend_assign_to_variable_ex(prop, value, OP_DATA_TYPE, EX_USES_STRICT_TYPES(), &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + /* assign_static_prop has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +ZEND_VM_HANDLER(23, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV, SPEC(OP_DATA=CONST|TMP|VAR|CV)) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +ZEND_VM_C_LABEL(try_assign_dim_array): + SEPARATE_ARRAY(object_ptr); + if (OP2_TYPE == IS_UNUSED) { + value = GET_OP_DATA_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP_DATA_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + ZEND_VM_C_GOTO(assign_dim_error); + } + } + if (OP_DATA_TYPE == IS_CV || OP_DATA_TYPE == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + ZEND_VM_C_GOTO(assign_dim_error); + } else if (OP_DATA_TYPE == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (OP_DATA_TYPE == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (OP_DATA_TYPE == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP2_TYPE == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + ZEND_VM_C_GOTO(assign_dim_error); + } + value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R); + value = zend_assign_to_variable_ex(variable_ptr, value, OP_DATA_TYPE, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + ZEND_VM_C_GOTO(try_assign_dim_array); + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (OP2_TYPE == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = GET_OP_DATA_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP_DATA_TYPE == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (OP_DATA_TYPE & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + FREE_OP_DATA(); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (OP2_TYPE == IS_UNUSED) { + zend_use_new_element_for_string(); + FREE_OP_DATA(); + UNDEF_RESULT(); + } else { + dim = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + value = GET_OP_DATA_ZVAL_PTR_UNDEF(BP_VAR_R); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + FREE_OP_DATA(); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = GET_OP2_ZVAL_PTR(BP_VAR_R); + FREE_OP_DATA(); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + ZEND_VM_C_GOTO(assign_dim_error); + } + } + ZEND_VM_C_GOTO(try_assign_dim_array); + } + } else { + zend_use_scalar_as_array(); + dim = GET_OP2_ZVAL_PTR(BP_VAR_R); +ZEND_VM_C_LABEL(assign_dim_error): + FREE_OP_DATA(); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (OP2_TYPE != IS_UNUSED) { + FREE_OP2(); + } + FREE_OP1(); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +ZEND_VM_HANDLER(22, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV, SPEC(RETVAL)) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = GET_OP2_ZVAL_PTR(BP_VAR_R); + variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + + if (!ZEND_VM_SPEC || UNEXPECTED(RETURN_VALUE_USED(opline))) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, OP2_TYPE, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, OP2_TYPE, EX_USES_STRICT_TYPES()); + } + FREE_OP1(); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(30, ZEND_ASSIGN_REF, VAR|CV, VAR|CV, SRC) +{ + USE_OPLINE + zval *variable_ptr; + zval *value_ptr; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + value_ptr = GET_OP2_ZVAL_PTR_PTR(BP_VAR_W); + variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + + if (OP1_TYPE == IS_VAR && + UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT)) { + + zend_throw_error(NULL, "Cannot assign by reference to an array dimension of an object"); + variable_ptr = &EG(uninitialized_zval); + } else if (OP2_TYPE == IS_VAR && + opline->extended_value == ZEND_RETURNS_FUNCTION && + UNEXPECTED(!Z_ISREF_P(value_ptr))) { + + variable_ptr = zend_wrong_assign_to_variable_reference( + variable_ptr, value_ptr, &garbage OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_variable_reference(variable_ptr, value_ptr, &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), variable_ptr); + } + + if (garbage) { + GC_DTOR(garbage); + } + + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(32, ZEND_ASSIGN_OBJ_REF, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT|SRC, SPEC(OP_DATA=VAR|CV)) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + + value_ptr = GET_OP_DATA_ZVAL_PTR_PTR(BP_VAR_W); + + if (ZEND_VM_SPEC) { + if (OP1_TYPE == IS_UNUSED) { + if (OP2_TYPE == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (OP2_TYPE == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, OP1_TYPE, property, OP2_TYPE, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + FREE_OP1(); + FREE_OP2(); + FREE_OP_DATA(); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +ZEND_VM_HANDLER(33, ZEND_ASSIGN_STATIC_PROP_REF, ANY, ANY, CACHE_SLOT|SRC) +{ + USE_OPLINE + zval *prop, *value_ptr; + zend_property_info *prop_info; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value & ~ZEND_RETURNS_FUNCTION, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + FREE_OP_DATA(); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + value_ptr = GET_OP_DATA_ZVAL_PTR_PTR(BP_VAR_W); + + if (OP_DATA_TYPE == IS_VAR && (opline->extended_value & ZEND_RETURNS_FUNCTION) && UNEXPECTED(!Z_ISREF_P(value_ptr))) { + if (UNEXPECTED(!zend_wrong_assign_to_variable_reference(prop, value_ptr, &garbage OPLINE_CC EXECUTE_DATA_CC))) { + prop = &EG(uninitialized_zval); + } + } else if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + prop = zend_assign_to_typed_property_reference(prop_info, prop, value_ptr, &garbage EXECUTE_DATA_CC); + } else { + zend_assign_to_variable_reference(prop, value_ptr, &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), prop); + } + + if (garbage) { + GC_DTOR(garbage); + } + + FREE_OP_DATA(); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY) +{ + zend_execute_data *old_execute_data; + uint32_t call_info = EX_CALL_INFO(); + SAVE_OPLINE(); + + if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED|ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); + +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(execute_data->This)); + } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + EG(vm_stack_top) = (zval*)execute_data; + execute_data = EX(prev_execute_data); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); + +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) { + zend_clean_and_cache_symbol_table(EX(symbol_table)); + } + + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(EX(extra_named_params)); + } + + /* Free extra args before releasing the closure, + * as that may free the op_array. */ + zend_vm_stack_free_extra_args_ex(call_info, execute_data); + + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(execute_data->This)); + } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + + old_execute_data = execute_data; + execute_data = EX(prev_execute_data); + zend_vm_stack_free_call_frame_ex(call_info, old_execute_data); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else if (EXPECTED((call_info & ZEND_CALL_TOP) == 0)) { + if (EX(func)->op_array.last_var > 0) { + zend_detach_symbol_table(execute_data); + call_info |= ZEND_CALL_NEEDS_REATTACH; + } + zend_destroy_static_vars(&EX(func)->op_array); + destroy_op_array(&EX(func)->op_array); + efree_size(EX(func), sizeof(zend_op_array)); + old_execute_data = execute_data; + execute_data = EG(current_execute_data) = EX(prev_execute_data); + zend_vm_stack_free_call_frame_ex(call_info, old_execute_data); + + if (call_info & ZEND_CALL_NEEDS_REATTACH) { + if (EX(func)->op_array.last_var > 0) { + zend_attach_symbol_table(execute_data); + } else { + ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_NEEDS_REATTACH); + } + } + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else { + if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_HAS_EXTRA_NAMED_PARAMS))) { + if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) { + zend_clean_and_cache_symbol_table(EX(symbol_table)); + } + zend_vm_stack_free_extra_args_ex(call_info, execute_data); + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(EX(extra_named_params)); + } + } + if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + ZEND_VM_RETURN(); + } else /* if (call_kind == ZEND_CALL_TOP_CODE) */ { + zend_array *symbol_table = EX(symbol_table); + + if (EX(func)->op_array.last_var > 0) { + zend_detach_symbol_table(execute_data); + call_info |= ZEND_CALL_NEEDS_REATTACH; + } + if (call_info & ZEND_CALL_NEEDS_REATTACH) { + old_execute_data = EX(prev_execute_data); + while (old_execute_data) { + if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) { + if (old_execute_data->symbol_table == symbol_table) { + if (old_execute_data->func->op_array.last_var > 0) { + zend_attach_symbol_table(old_execute_data); + } else { + ZEND_ADD_CALL_FLAG(old_execute_data, ZEND_CALL_NEEDS_REATTACH); + } + } + break; + } + old_execute_data = old_execute_data->prev_execute_data; + } + } + EG(current_execute_data) = EX(prev_execute_data); + ZEND_VM_RETURN(); + } + } +} + +ZEND_VM_HOT_HANDLER(42, ZEND_JMP, JMP_ADDR, ANY) +{ + USE_OPLINE + + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op1), 0); +} + +ZEND_VM_HOT_NOCONST_HANDLER(43, ZEND_JMPZ, CONST|TMPVAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *val; + uint8_t op1_type; + + val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + SAVE_OPLINE(); + op1_type = OP1_TYPE; + if (i_zend_is_true(val)) { + opline++; + } else { + opline = OP_JMP_ADDR(opline, opline->op2); + } + if (op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(val); + } + ZEND_VM_JMP(opline); +} + +ZEND_VM_HOT_NOCONST_HANDLER(44, ZEND_JMPNZ, CONST|TMPVAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *val; + uint8_t op1_type; + + val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + op1_type = OP1_TYPE; + if (i_zend_is_true(val)) { + opline = OP_JMP_ADDR(opline, opline->op2); + } else { + opline++; + } + if (op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(val); + } + ZEND_VM_JMP(opline); +} + +ZEND_VM_COLD_CONST_HANDLER(46, ZEND_JMPZ_EX, CONST|TMPVAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *val; + bool ret; + + val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + SAVE_OPLINE(); + ret = i_zend_is_true(val); + FREE_OP1(); + if (ret) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + opline++; + } else { + ZVAL_FALSE(EX_VAR(opline->result.var)); + opline = OP_JMP_ADDR(opline, opline->op2); + } + ZEND_VM_JMP(opline); +} + +ZEND_VM_COLD_CONST_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMPVAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *val; + bool ret; + + val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + ret = i_zend_is_true(val); + FREE_OP1(); + if (ret) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + opline = OP_JMP_ADDR(opline, opline->op2); + } else { + ZVAL_FALSE(EX_VAR(opline->result.var)); + opline++; + } + ZEND_VM_JMP(opline); +} + +ZEND_VM_HANDLER(70, ZEND_FREE, TMPVAR, ANY) +{ + USE_OPLINE + + SAVE_OPLINE(); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(127, ZEND_FE_FREE, TMPVAR, ANY) +{ + zval *var; + USE_OPLINE + + var = EX_VAR(opline->op1.var); + if (Z_TYPE_P(var) != IS_ARRAY) { + SAVE_OPLINE(); + if (Z_FE_ITER_P(var) != (uint32_t)-1) { + zend_hash_iterator_del(Z_FE_ITER_P(var)); + } + zval_ptr_dtor_nogc(var); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + /* This is freeing an array. Use an inlined version of zval_ptr_dtor_nogc. */ + /* PHP only needs to save the opline and check for an exception if the last reference to the array was garbage collected (destructors of elements in the array could throw an exception) */ + if (Z_REFCOUNTED_P(var) && !Z_DELREF_P(var)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(53, ZEND_FAST_CONCAT, CONST|TMPVAR|CV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if ((OP1_TYPE == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (OP2_TYPE == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (OP1_TYPE != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (OP2_TYPE == IS_CONST || OP2_TYPE == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (OP2_TYPE != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if (OP1_TYPE == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if (OP2_TYPE == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if (OP1_TYPE != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (OP2_TYPE == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if (OP2_TYPE != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (OP1_TYPE != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if (OP2_TYPE != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + FREE_OP1(); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(54, ZEND_ROPE_INIT, UNUSED, CONST|TMPVAR|CV, NUM) +{ + USE_OPLINE + zend_string **rope; + zval *var; + + /* Compiler allocates the necessary number of zval slots to keep the rope */ + rope = (zend_string**)EX_VAR(opline->result.var); + if (OP2_TYPE == IS_CONST) { + var = GET_OP2_ZVAL_PTR(BP_VAR_R); + rope[0] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (OP2_TYPE == IS_CV) { + rope[0] = zend_string_copy(Z_STR_P(var)); + } else { + rope[0] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[0] = zval_get_string_func(var); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(55, ZEND_ROPE_ADD, TMP, CONST|TMPVAR|CV, NUM) +{ + USE_OPLINE + zend_string **rope; + zval *var; + + /* op1 and result are the same */ + rope = (zend_string**)EX_VAR(opline->op1.var); + if (OP2_TYPE == IS_CONST) { + var = GET_OP2_ZVAL_PTR(BP_VAR_R); + rope[opline->extended_value] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (OP2_TYPE == IS_CV) { + rope[opline->extended_value] = zend_string_copy(Z_STR_P(var)); + } else { + rope[opline->extended_value] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[opline->extended_value] = zval_get_string_func(var); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(56, ZEND_ROPE_END, TMP, CONST|TMPVAR|CV, NUM) +{ + USE_OPLINE + zend_string **rope; + zval *var, *ret; + uint32_t i; + + rope = (zend_string**)EX_VAR(opline->op1.var); + if (OP2_TYPE == IS_CONST) { + var = GET_OP2_ZVAL_PTR(BP_VAR_R); + rope[opline->extended_value] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (OP2_TYPE == IS_CV) { + rope[opline->extended_value] = zend_string_copy(Z_STR_P(var)); + } else { + rope[opline->extended_value] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[opline->extended_value] = zval_get_string_func(var); + FREE_OP2(); + if (UNEXPECTED(EG(exception))) { + for (i = 0; i <= opline->extended_value; i++) { + zend_string_release_ex(rope[i], 0); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + size_t len = 0; + uint32_t flags = ZSTR_COPYABLE_CONCAT_PROPERTIES; + for (i = 0; i <= opline->extended_value; i++) { + flags &= ZSTR_GET_COPYABLE_CONCAT_PROPERTIES(rope[i]); + len += ZSTR_LEN(rope[i]); + } + ret = EX_VAR(opline->result.var); + ZVAL_STR(ret, zend_string_alloc(len, 0)); + GC_ADD_FLAGS(Z_STR_P(ret), flags); + + char *target = Z_STRVAL_P(ret); + for (i = 0; i <= opline->extended_value; i++) { + memcpy(target, ZSTR_VAL(rope[i]), ZSTR_LEN(rope[i])); + target += ZSTR_LEN(rope[i]); + zend_string_release_ex(rope[i], 0); + } + *target = '\0'; + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, UNUSED|CLASS_FETCH, CONST|TMPVAR|UNUSED|CV, CACHE_SLOT) +{ + zval *class_name; + USE_OPLINE + + SAVE_OPLINE(); + if (OP2_TYPE == IS_UNUSED) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->op1.num); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else if (OP2_TYPE == IS_CONST) { + zend_class_entry *ce = CACHED_PTR(opline->extended_value); + + if (UNEXPECTED(ce == NULL)) { + class_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + ce = zend_fetch_class_by_name(Z_STR_P(class_name), Z_STR_P(class_name + 1), opline->op1.num); + CACHE_PTR(opline->extended_value, ce); + } + Z_CE_P(EX_VAR(opline->result.var)) = ce; + } else { + class_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); +ZEND_VM_C_LABEL(try_class_name): + if (Z_TYPE_P(class_name) == IS_OBJECT) { + Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name); + } else if (Z_TYPE_P(class_name) == IS_STRING) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->op1.num); + } else if ((OP2_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) { + class_name = Z_REFVAL_P(class_name); + ZEND_VM_C_GOTO(try_class_name); + } else { + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Class name must be a valid object or a string"); + } + } + + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_OBJ_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, NUM|CACHE_SLOT) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (OP2_TYPE != IS_CONST) { + function_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + } + + if (OP2_TYPE != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((OP2_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + FREE_OP2(); + FREE_OP1(); + HANDLE_EXCEPTION(); + } while (0); + } + + if (OP1_TYPE == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((OP1_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (OP1_TYPE & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (OP2_TYPE != IS_CONST) { + FREE_OP2(); + } + HANDLE_EXCEPTION(); + } + } + if (OP2_TYPE == IS_CONST) { + function_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + } + zend_invalid_method_call(object, function_name); + FREE_OP2(); + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (OP2_TYPE == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (OP2_TYPE == IS_CONST) { + function_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + FREE_OP2(); + if ((OP1_TYPE & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (OP2_TYPE == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((OP1_TYPE & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (OP2_TYPE != IS_CONST) { + FREE_OP2(); + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((OP1_TYPE & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (OP1_TYPE & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (OP1_TYPE == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, UNUSED|CLASS_FETCH|CONST|VAR, CONST|TMPVAR|UNUSED|CONSTRUCTOR|CV, NUM|CACHE_SLOT) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (OP1_TYPE == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + FREE_OP2(); + HANDLE_EXCEPTION(); + } + if (OP2_TYPE != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (OP1_TYPE == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + FREE_OP2(); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (OP1_TYPE == IS_CONST && + OP2_TYPE == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (OP1_TYPE != IS_CONST && + OP2_TYPE == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (OP2_TYPE != IS_UNUSED) { + function_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP2_TYPE != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (OP2_TYPE & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + FREE_OP2(); + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + FREE_OP2(); + HANDLE_EXCEPTION(); + } + if (OP2_TYPE == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (OP2_TYPE != IS_CONST) { + FREE_OP2(); + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (OP1_TYPE == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT) +{ + USE_OPLINE + zend_function *fbc; + zval *function_name, *func; + zend_execute_data *call; + + fbc = CACHED_PTR(opline->result.num); + if (UNEXPECTED(fbc == NULL)) { + function_name = (zval*)RT_CONSTANT(opline, opline->op2); + func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(function_name+1)); + if (UNEXPECTED(func == NULL)) { + ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper); + } + fbc = Z_FUNC_P(func); + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + CACHE_PTR(opline->result.num, fbc); + } + call = _zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION, + fbc, opline->extended_value, NULL); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(128, ZEND_INIT_DYNAMIC_CALL, ANY, CONST|TMPVAR|CV, NUM) +{ + USE_OPLINE + zval *function_name; + zend_execute_data *call; + + SAVE_OPLINE(); + function_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + +ZEND_VM_C_LABEL(try_function_name): + if (OP2_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + call = zend_init_dynamic_call_string(Z_STR_P(function_name), opline->extended_value); + } else if (OP2_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT)) { + call = zend_init_dynamic_call_object(Z_OBJ_P(function_name), opline->extended_value); + } else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY)) { + call = zend_init_dynamic_call_array(Z_ARRVAL_P(function_name), opline->extended_value); + } else if ((OP2_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(function_name) == IS_REFERENCE)) { + function_name = Z_REFVAL_P(function_name); + ZEND_VM_C_GOTO(try_function_name); + } else { + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + function_name = ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Value of type %s is not callable", + zend_zval_type_name(function_name)); + call = NULL; + } + + if (OP2_TYPE & (IS_VAR|IS_TMP_VAR)) { + FREE_OP2(); + if (UNEXPECTED(EG(exception))) { + if (call) { + if (call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) { + zend_string_release_ex(call->func->common.function_name, 0); + zend_free_trampoline(call->func); + } + zend_vm_stack_free_call_frame(call); + } + HANDLE_EXCEPTION(); + } + } else if (!call) { + HANDLE_EXCEPTION(); + } + + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV, NUM) +{ + USE_OPLINE + zval *function_name; + zend_fcall_info_cache fcc; + char *error = NULL; + zend_function *func; + void *object_or_called_scope; + zend_execute_data *call; + uint32_t call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_DYNAMIC; + + SAVE_OPLINE(); + function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) { + ZEND_ASSERT(!error); + func = fcc.function_handler; + object_or_called_scope = fcc.called_scope; + if (func->common.fn_flags & ZEND_ACC_CLOSURE) { + /* Delay closure destruction until its invocation */ + GC_ADDREF(ZEND_CLOSURE_OBJECT(func)); + call_info |= ZEND_CALL_CLOSURE; + if (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) { + call_info |= ZEND_CALL_FAKE_CLOSURE; + } + if (fcc.object) { + object_or_called_scope = fcc.object; + call_info |= ZEND_CALL_HAS_THIS; + } + } else if (fcc.object) { + GC_ADDREF(fcc.object); /* For $this pointer */ + object_or_called_scope = fcc.object; + call_info |= ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_THIS; + } + + FREE_OP2(); + if ((OP2_TYPE & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) { + if (call_info & ZEND_CALL_CLOSURE) { + zend_object_release(ZEND_CLOSURE_OBJECT(func)); + } else if (call_info & ZEND_CALL_RELEASE_THIS) { + zend_object_release(fcc.object); + } + HANDLE_EXCEPTION(); + } + + if (EXPECTED(func->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&func->op_array))) { + init_func_run_time_cache(&func->op_array); + } + } else { + zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + efree(error); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + + call = zend_vm_stack_push_call_frame(call_info, + func, opline->extended_value, object_or_called_scope); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT) +{ + USE_OPLINE + zval *func_name; + zval *func; + zend_function *fbc; + zend_execute_data *call; + + fbc = CACHED_PTR(opline->result.num); + if (UNEXPECTED(fbc == NULL)) { + func_name = (zval *)RT_CONSTANT(opline, opline->op2); + func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 1)); + if (func == NULL) { + func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 2)); + if (UNEXPECTED(func == NULL)) { + ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper); + } + } + fbc = Z_FUNC_P(func); + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + CACHE_PTR(opline->result.num, fbc); + } + + call = _zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION, + fbc, opline->extended_value, NULL); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT) +{ + USE_OPLINE + zval *fname; + zval *func; + zend_function *fbc; + zend_execute_data *call; + + fbc = CACHED_PTR(opline->result.num); + if (UNEXPECTED(fbc == NULL)) { + fname = (zval*)RT_CONSTANT(opline, opline->op2); + func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname)); + ZEND_ASSERT(func != NULL && "Function existence must be checked at compile time"); + fbc = Z_FUNC_P(func); + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + CACHE_PTR(opline->result.num, fbc); + } + + call = _zend_vm_stack_push_call_frame_ex( + opline->op1.num, ZEND_CALL_NESTED_FUNCTION, + fbc, opline->extended_value, NULL); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(129, ZEND_DO_ICALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + zval retval; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + ZEND_OBSERVER_FCALL_BEGIN(call); + fbc->internal_function.handler(call, ret); + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret); + + EG(current_execute_data) = execute_data; + zend_vm_stack_free_args(call); + + uint32_t call_info = ZEND_CALL_INFO(call); + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { + if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_free_extra_named_params(call->extra_named_params); + } + zend_vm_stack_free_call_frame_ex(call_info, call); + } else { + EG(vm_stack_top) = (zval*)call; + } + + if (!RETURN_VALUE_USED(opline)) { + i_zval_ptr_dtor(ret); + } + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +ZEND_VM_HOT_HANDLER(130, ZEND_DO_UCALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + ret = NULL; + if (RETURN_VALUE_USED(opline)) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + LOAD_OPLINE_EX(); + ZEND_OBSERVER_SAVE_OPLINE(); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); + + ZEND_VM_ENTER_EX(); +} + +ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL,OBSERVER)) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + ret = NULL; + if (RETURN_VALUE_USED(opline)) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + LOAD_OPLINE_EX(); + ZEND_OBSERVER_SAVE_OPLINE(); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); + + ZEND_VM_ENTER_EX(); + } else { + zval retval; + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (ZEND_OBSERVER_ENABLED) { + ret = NULL; + } + + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + if (!RETURN_VALUE_USED(opline)) { + ret = &retval; + ZVAL_UNDEF(ret); + } + ZEND_VM_C_GOTO(fcall_by_name_end); + } + } + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + ZEND_OBSERVER_FCALL_BEGIN(call); + fbc->internal_function.handler(call, ret); + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret); + + EG(current_execute_data) = execute_data; + +ZEND_VM_C_LABEL(fcall_by_name_end): + zend_vm_stack_free_args(call); + + uint32_t call_info = ZEND_CALL_INFO(call); + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { + if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_free_extra_named_params(call->extra_named_params); + } + zend_vm_stack_free_call_frame_ex(call_info, call); + } else { + EG(vm_stack_top) = (zval*)call; + } + + if (!RETURN_VALUE_USED(opline)) { + i_zval_ptr_dtor(ret); + } + } + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + ret = NULL; + if (RETURN_VALUE_USED(opline)) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + LOAD_OPLINE_EX(); + ZEND_OBSERVER_SAVE_OPLINE(); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); + ZEND_VM_ENTER_EX(); + } else { + SAVE_OPLINE_EX(); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); + execute_data = EX(prev_execute_data); + LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } + } else { + zval retval; + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (ZEND_OBSERVER_ENABLED) { + ret = NULL; + } + + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + if (!RETURN_VALUE_USED(opline)) { + ret = &retval; + ZVAL_UNDEF(ret); + } + ZEND_VM_C_GOTO(fcall_end); + } + } + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + ZEND_OBSERVER_FCALL_BEGIN(call); + if (!zend_execute_internal) { + /* saves one function call if zend_execute_internal is not used */ + fbc->internal_function.handler(call, ret); + } else { + zend_execute_internal(call, ret); + } + +#if ZEND_DEBUG + if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret); + + EG(current_execute_data) = execute_data; + +ZEND_VM_C_LABEL(fcall_end): + zend_vm_stack_free_args(call); + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(call->extra_named_params); + } + + if (!RETURN_VALUE_USED(opline)) { + i_zval_ptr_dtor(ret); + } + } + + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(call->This)); + } + + zend_vm_stack_free_call_frame(call); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV, UNUSED|CACHE_SLOT) +{ + if (OP1_TYPE == IS_UNUSED) { + SAVE_OPLINE(); + zend_verify_missing_return_type(EX(func)); + HANDLE_EXCEPTION(); + } else { +/* prevents "undefined variable opline" errors */ +#if !ZEND_VM_SPEC || (OP1_TYPE != IS_UNUSED) + USE_OPLINE + zval *retval_ref, *retval_ptr; + zend_arg_info *ret_info = EX(func)->common.arg_info - 1; + retval_ref = retval_ptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (OP1_TYPE == IS_CONST) { + ZVAL_COPY(EX_VAR(opline->result.var), retval_ptr); + retval_ref = retval_ptr = EX_VAR(opline->result.var); + } else if (OP1_TYPE == IS_VAR) { + if (UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_INDIRECT)) { + retval_ref = retval_ptr = Z_INDIRECT_P(retval_ptr); + } + ZVAL_DEREF(retval_ptr); + } else if (OP1_TYPE == IS_CV) { + ZVAL_DEREF(retval_ptr); + } + + if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(retval_ptr)))) { + ZEND_VM_NEXT_OPCODE(); + } + + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) { + SAVE_OPLINE(); + retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) { + ZEND_VM_NEXT_OPCODE(); + } + } + + zend_reference *ref = NULL; + void *cache_slot = CACHE_ADDR(opline->op2.num); + if (UNEXPECTED(retval_ref != retval_ptr)) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + ref = Z_REF_P(retval_ref); + } else { + /* A cast might happen - unwrap the reference if this is a by-value return */ + if (Z_REFCOUNT_P(retval_ref) == 1) { + ZVAL_UNREF(retval_ref); + } else { + Z_DELREF_P(retval_ref); + ZVAL_COPY(retval_ref, retval_ptr); + } + retval_ptr = retval_ref; + } + } + + SAVE_OPLINE(); + if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) { + zend_verify_return_error(EX(func), retval_ptr); + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +#endif + } +} + +ZEND_VM_COLD_HANDLER(201, ZEND_VERIFY_NEVER_TYPE, UNUSED, UNUSED) +{ + SAVE_OPLINE(); + zend_verify_never_error(EX(func)); + HANDLE_EXCEPTION(); +} + +ZEND_VM_INLINE_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY, SPEC(OBSERVER)) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + ZEND_OBSERVER_USE_RETVAL; + + retval_ptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + return_value = EX(return_value); + ZEND_OBSERVER_SET_RETVAL(); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (OP1_TYPE & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (OP1_TYPE == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (OP1_TYPE == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + ZEND_OBSERVER_SAVE_OPLINE(); + ZEND_OBSERVER_FCALL_END(execute_data, return_value); + ZEND_OBSERVER_FREE_RETVAL(); + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); +} + +ZEND_VM_COLD_CONST_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY, SRC, SPEC(OBSERVER)) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + ZEND_OBSERVER_USE_RETVAL; + + SAVE_OPLINE(); + + return_value = EX(return_value); + ZEND_OBSERVER_SET_RETVAL(); + do { + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR)) || + (OP1_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { + /* Not supposed to happen, but we'll allow it */ + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + + retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + if (!return_value) { + FREE_OP1(); + } else { + if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + break; + } + + ZVAL_NEW_REF(return_value, retval_ptr); + if (OP1_TYPE == IS_CONST) { + Z_TRY_ADDREF_P(retval_ptr); + } + } + break; + } + + retval_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); + + if (OP1_TYPE == IS_VAR) { + ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + if (return_value) { + ZVAL_NEW_REF(return_value, retval_ptr); + } else { + FREE_OP1(); + } + break; + } + } + + if (return_value) { + if (Z_ISREF_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } else { + ZVAL_MAKE_REF_EX(retval_ptr, 2); + } + ZVAL_REF(return_value, Z_REF_P(retval_ptr)); + } + + FREE_OP1(); + } while (0); + + ZEND_OBSERVER_FCALL_END(execute_data, return_value); + ZEND_OBSERVER_FREE_RETVAL(); + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); +} + +ZEND_VM_HANDLER(139, ZEND_GENERATOR_CREATE, ANY, ANY) +{ + zval *return_value = EX(return_value); + + if (EXPECTED(return_value)) { + USE_OPLINE + zend_generator *generator; + zend_execute_data *gen_execute_data; + uint32_t num_args, used_stack, call_info; + + SAVE_OPLINE(); + object_init_ex(return_value, zend_ce_generator); + + /* + * Normally the execute_data is allocated on the VM stack (because it does + * not actually do any allocation and thus is faster). For generators + * though this behavior would be suboptimal, because the (rather large) + * structure would have to be copied back and forth every time execution is + * suspended or resumed. That's why for generators the execution context + * is allocated on heap. + */ + num_args = EX_NUM_ARGS(); + if (EXPECTED(num_args <= EX(func)->op_array.num_args)) { + used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval); + gen_execute_data = (zend_execute_data*)emalloc(used_stack); + used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval); + } else { + used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - EX(func)->op_array.num_args) * sizeof(zval); + gen_execute_data = (zend_execute_data*)emalloc(used_stack); + } + memcpy(gen_execute_data, execute_data, used_stack); + + /* Save execution context in generator object. */ + generator = (zend_generator *) Z_OBJ_P(EX(return_value)); + generator->execute_data = gen_execute_data; + generator->frozen_call_stack = NULL; + generator->execute_fake.opline = NULL; + generator->execute_fake.func = NULL; + generator->execute_fake.prev_execute_data = NULL; + ZVAL_OBJ(&generator->execute_fake.This, (zend_object *) generator); + + gen_execute_data->opline = opline + 1; + /* EX(return_value) keeps pointer to zend_object (not a real zval) */ + gen_execute_data->return_value = (zval*)generator; + call_info = Z_TYPE_INFO(EX(This)); + if ((call_info & Z_TYPE_MASK) == IS_OBJECT + && (!(call_info & (ZEND_CALL_CLOSURE|ZEND_CALL_RELEASE_THIS)) + /* Bug #72523 */ + || UNEXPECTED(zend_execute_ex != execute_ex))) { + ZEND_ADD_CALL_FLAG_EX(call_info, ZEND_CALL_RELEASE_THIS); + Z_ADDREF(gen_execute_data->This); + } + ZEND_ADD_CALL_FLAG_EX(call_info, (ZEND_CALL_TOP_FUNCTION | ZEND_CALL_ALLOCATED | ZEND_CALL_GENERATOR)); + Z_TYPE_INFO(gen_execute_data->This) = call_info; + gen_execute_data->prev_execute_data = NULL; + + call_info = EX_CALL_INFO(); + EG(current_execute_data) = EX(prev_execute_data); + if (EXPECTED(!(call_info & (ZEND_CALL_TOP|ZEND_CALL_ALLOCATED)))) { + EG(vm_stack_top) = (zval*)execute_data; + execute_data = EX(prev_execute_data); + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else if (EXPECTED(!(call_info & ZEND_CALL_TOP))) { + zend_execute_data *old_execute_data = execute_data; + execute_data = EX(prev_execute_data); + zend_vm_stack_free_call_frame_ex(call_info, old_execute_data); + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else { + ZEND_VM_RETURN(); + } + } else { + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); + } +} + +ZEND_VM_HANDLER(161, ZEND_GENERATOR_RETURN, CONST|TMP|VAR|CV, ANY, SPEC(OBSERVER)) +{ + USE_OPLINE + zval *retval; + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + retval = GET_OP1_ZVAL_PTR(BP_VAR_R); + + /* Copy return value into generator->retval */ + if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(&generator->retval, retval); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { + Z_ADDREF(generator->retval); + } + } + } else if (OP1_TYPE == IS_CV) { + ZVAL_COPY_DEREF(&generator->retval, retval); + } else /* if (OP1_TYPE == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_refcounted *ref = Z_COUNTED_P(retval); + + retval = Z_REFVAL_P(retval); + ZVAL_COPY_VALUE(&generator->retval, retval); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval)) { + Z_ADDREF_P(retval); + } + } else { + ZVAL_COPY_VALUE(&generator->retval, retval); + } + } + + ZEND_OBSERVER_FCALL_END(generator->execute_data, &generator->retval); + + EG(current_execute_data) = EX(prev_execute_data); + + /* Close the generator to free up resources */ + zend_generator_close(generator, 1); + + /* Pass execution back to handling code */ + ZEND_VM_RETURN(); +} + +ZEND_VM_COLD_CONST_HANDLER(108, ZEND_THROW, CONST|TMPVAR|CV, ANY) +{ + USE_OPLINE + zval *value; + + SAVE_OPLINE(); + value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + do { + if (OP1_TYPE == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) { + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + if (EXPECTED(Z_TYPE_P(value) == IS_OBJECT)) { + break; + } + } + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Can only throw objects"); + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } while (0); + + zend_exception_save(); + Z_TRY_ADDREF_P(value); + zend_throw_exception_object(value); + zend_exception_restore(); + FREE_OP1(); + HANDLE_EXCEPTION(); +} + +ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, JMP_ADDR, LAST_CATCH|CACHE_SLOT) +{ + USE_OPLINE + zend_class_entry *ce, *catch_ce; + zend_object *exception; + + SAVE_OPLINE(); + /* Check whether an exception has been thrown, if not, jump over code */ + zend_exception_restore(); + if (EG(exception) == NULL) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + catch_ce = CACHED_PTR(opline->extended_value & ~ZEND_LAST_CATCH); + if (UNEXPECTED(catch_ce == NULL)) { + catch_ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD | ZEND_FETCH_CLASS_SILENT); + + CACHE_PTR(opline->extended_value & ~ZEND_LAST_CATCH, catch_ce); + } + ce = EG(exception)->ce; + +#ifdef HAVE_DTRACE + if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) { + DTRACE_EXCEPTION_CAUGHT((char *)ce->name); + } +#endif /* HAVE_DTRACE */ + + if (ce != catch_ce) { + if (!catch_ce || !instanceof_function(ce, catch_ce)) { + if (opline->extended_value & ZEND_LAST_CATCH) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + } + + exception = EG(exception); + EG(exception) = NULL; + if (RETURN_VALUE_USED(opline)) { + /* Always perform a strict assignment. There is a reasonable expectation that if you + * write "catch (Exception $e)" then $e will actually be instanceof Exception. As such, + * we should not permit coercion to string here. */ + zval tmp; + ZVAL_OBJ(&tmp, exception); + zend_assign_to_variable(EX_VAR(opline->result.var), &tmp, IS_TMP_VAR, /* strict */ 1); + } else { + OBJ_RELEASE(exception); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(65, ZEND_SEND_VAL, CONST|TMPVAR, CONST|UNUSED|NUM) +{ + USE_OPLINE + zval *value, *arg; + + if (OP2_TYPE == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + value = GET_OP1_ZVAL_PTR(BP_VAR_R); + ZVAL_COPY_VALUE(arg, value); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_HELPER(zend_cannot_pass_by_ref_helper, ANY, ANY, uint32_t _arg_num, zval *_arg) +{ + USE_OPLINE + + SAVE_OPLINE(); + + zend_cannot_pass_by_reference(_arg_num); + FREE_OP1(); + ZVAL_UNDEF(_arg); + HANDLE_EXCEPTION(); +} + +ZEND_VM_HOT_SEND_HANDLER(116, ZEND_SEND_VAL_EX, CONST|TMP, CONST|UNUSED|NUM, SPEC(QUICK_ARG)) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num; + + if (OP2_TYPE == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_C_GOTO(send_val_by_ref); + } + } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +ZEND_VM_C_LABEL(send_val_by_ref): + ZEND_VM_DISPATCH_TO_HELPER(zend_cannot_pass_by_ref_helper, _arg_num, arg_num, _arg, arg); + } + value = GET_OP1_ZVAL_PTR(BP_VAR_R); + ZVAL_COPY_VALUE(arg, value); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(117, ZEND_SEND_VAR, VAR|CV, CONST|UNUSED|NUM) +{ + USE_OPLINE + zval *varptr, *arg; + + if (OP2_TYPE == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (OP1_TYPE == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (OP1_TYPE == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR, CONST|UNUSED|NUM) +{ + USE_OPLINE + zval *varptr, *arg; + + if (OP2_TYPE == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr))) { + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + ZVAL_NEW_REF(arg, arg); + zend_error(E_NOTICE, "Only variables should be passed by reference"); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_SEND_HANDLER(50, ZEND_SEND_VAR_NO_REF_EX, VAR, CONST|UNUSED|NUM, SPEC(QUICK_ARG)) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (OP2_TYPE == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (!QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_C_GOTO(send_var); + } + + varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr) || + QUICK_ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num))) { + ZEND_VM_NEXT_OPCODE(); + } + } else { + if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_C_GOTO(send_var); + } + + varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr) || + ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num))) { + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + ZVAL_NEW_REF(arg, arg); + zend_error(E_NOTICE, "Only variables should be passed by reference"); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + +ZEND_VM_C_LABEL(send_var): + varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, CONST|UNUSED|NUM) +{ + USE_OPLINE + zval *varptr, *arg; + + SAVE_OPLINE(); + if (OP2_TYPE == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_SEND_HANDLER(66, ZEND_SEND_VAR_EX, VAR|CV, CONST|UNUSED|NUM, SPEC(QUICK_ARG)) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (OP2_TYPE == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_C_GOTO(send_var_by_ref); + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +ZEND_VM_C_LABEL(send_var_by_ref): + varptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE(); + } + + varptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (OP1_TYPE == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (OP1_TYPE == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_SEND_HANDLER(100, ZEND_CHECK_FUNC_ARG, UNUSED, CONST|UNUSED|NUM, SPEC(QUICK_ARG)) +{ + USE_OPLINE + uint32_t arg_num; + + if (OP2_TYPE == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg_num = zend_get_arg_offset_by_name( + EX(call)->func, arg_name, CACHE_ADDR(opline->result.num)) + 1; + if (UNEXPECTED(arg_num == 0)) { + /* Treat this as a by-value argument, and throw an error during SEND. */ + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + ZEND_VM_NEXT_OPCODE(); + } + } else { + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } else { + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } else { + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(185, ZEND_SEND_FUNC_ARG, VAR, CONST|UNUSED|NUM) +{ + USE_OPLINE + zval *varptr, *arg; + + if (OP2_TYPE == IS_CONST) { + // TODO: Would it make sense to share the cache slot with CHECK_FUNC_ARG? + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + varptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE(); + } + + varptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(165, ZEND_SEND_UNPACK, ANY, ANY) +{ + USE_OPLINE + zval *args; + uint32_t arg_num; + + SAVE_OPLINE(); + args = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + arg_num = ZEND_CALL_NUM_ARGS(EX(call)) + 1; + +ZEND_VM_C_LABEL(send_again): + if (EXPECTED(Z_TYPE_P(args) == IS_ARRAY)) { + HashTable *ht = Z_ARRVAL_P(args); + zval *arg, *top; + zend_string *name; + bool have_named_params = 0; + + zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht)); + + // TODO: Speed this up using a flag that specifies whether there are any ref parameters. + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_REFCOUNT_P(args) > 1) { + uint32_t tmp_arg_num = arg_num; + bool separate = 0; + + /* check if any of arguments are going to be passed by reference */ + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) { + if (UNEXPECTED(name)) { + void *cache_slot[2] = {NULL, NULL}; + tmp_arg_num = zend_get_arg_offset_by_name( + EX(call)->func, name, cache_slot) + 1; + } + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, tmp_arg_num)) { + separate = 1; + break; + } + tmp_arg_num++; + } ZEND_HASH_FOREACH_END(); + if (separate) { + SEPARATE_ARRAY(args); + ht = Z_ARRVAL_P(args); + } + } + + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) { + if (UNEXPECTED(name)) { + void *cache_slot[2] = {NULL, NULL}; + have_named_params = 1; + top = zend_handle_named_arg(&EX(call), name, &arg_num, cache_slot); + if (UNEXPECTED(!top)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + if (have_named_params) { + zend_throw_error(NULL, + "Cannot use positional argument after named argument during unpacking"); + FREE_OP1(); + HANDLE_EXCEPTION(); + } + + top = ZEND_CALL_ARG(EX(call), arg_num); + ZEND_CALL_NUM_ARGS(EX(call))++; + } + + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + if (Z_ISREF_P(arg)) { + Z_ADDREF_P(arg); + ZVAL_REF(top, Z_REF_P(arg)); + } else if (OP1_TYPE & (IS_VAR|IS_CV)) { + /* array is already separated above */ + ZVAL_MAKE_REF_EX(arg, 2); + ZVAL_REF(top, Z_REF_P(arg)); + } else { + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(top, arg); + } + } else { + ZVAL_COPY_DEREF(top, arg); + } + + arg_num++; + } ZEND_HASH_FOREACH_END(); + + } else if (EXPECTED(Z_TYPE_P(args) == IS_OBJECT)) { + zend_class_entry *ce = Z_OBJCE_P(args); + zend_object_iterator *iter; + bool have_named_params = 0; + + if (!ce || !ce->get_iterator) { + zend_type_error("Only arrays and Traversables can be unpacked"); + } else { + + iter = ce->get_iterator(ce, args, 0); + if (UNEXPECTED(!iter)) { + FREE_OP1(); + if (!EG(exception)) { + zend_throw_exception_ex( + NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name) + ); + } + HANDLE_EXCEPTION(); + } + + const zend_object_iterator_funcs *funcs = iter->funcs; + if (funcs->rewind) { + funcs->rewind(iter); + } + + for (; funcs->valid(iter) == SUCCESS; ++arg_num) { + zval *arg, *top; + + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + arg = funcs->get_current_data(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + zend_string *name = NULL; + if (funcs->get_current_key) { + zval key; + funcs->get_current_key(iter, &key); + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + if (UNEXPECTED(Z_TYPE(key) != IS_LONG)) { + if (UNEXPECTED(Z_TYPE(key) != IS_STRING)) { + zend_throw_error(NULL, + "Keys must be of type int|string during argument unpacking"); + zval_ptr_dtor(&key); + break; + } + + name = Z_STR_P(&key); + } + } + + if (UNEXPECTED(name)) { + void *cache_slot[2] = {NULL, NULL}; + have_named_params = 1; + top = zend_handle_named_arg(&EX(call), name, &arg_num, cache_slot); + if (UNEXPECTED(!top)) { + zend_string_release(name); + break; + } + + ZVAL_DEREF(arg); + Z_TRY_ADDREF_P(arg); + + if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + zend_error( + E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()" + " by unpacking a Traversable, passing by-value instead", arg_num, + EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "", + EX(call)->func->common.scope ? "::" : "", + ZSTR_VAL(EX(call)->func->common.function_name) + ); + ZVAL_NEW_REF(top, arg); + } else { + ZVAL_COPY_VALUE(top, arg); + } + + zend_string_release(name); + } else { + if (have_named_params) { + zend_throw_error(NULL, + "Cannot use positional argument after named argument during unpacking"); + break; + } + + zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1); + top = ZEND_CALL_ARG(EX(call), arg_num); + ZVAL_DEREF(arg); + Z_TRY_ADDREF_P(arg); + + if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + zend_error( + E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()" + " by unpacking a Traversable, passing by-value instead", arg_num, + EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "", + EX(call)->func->common.scope ? "::" : "", + ZSTR_VAL(EX(call)->func->common.function_name) + ); + ZVAL_NEW_REF(top, arg); + } else { + ZVAL_COPY_VALUE(top, arg); + } + + ZEND_CALL_NUM_ARGS(EX(call))++; + } + + funcs->move_forward(iter); + } + + zend_iterator_dtor(iter); + } + } else if (EXPECTED(Z_ISREF_P(args))) { + args = Z_REFVAL_P(args); + ZEND_VM_C_GOTO(send_again); + } else { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(args) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_type_error("Only arrays and Traversables can be unpacked"); + } + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY, NUM) +{ + USE_OPLINE + zval *args; + + SAVE_OPLINE(); + args = GET_OP1_ZVAL_PTR(BP_VAR_R); + + if (UNEXPECTED(Z_TYPE_P(args) != IS_ARRAY)) { + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(args)) { + args = Z_REFVAL_P(args); + if (EXPECTED(Z_TYPE_P(args) == IS_ARRAY)) { + ZEND_VM_C_GOTO(send_array); + } + } + zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_zval_value_name(args)); + FREE_OP2(); + FREE_OP1(); + HANDLE_EXCEPTION(); + } else { + uint32_t arg_num; + HashTable *ht; + zval *arg, *param; + +ZEND_VM_C_LABEL(send_array): + ht = Z_ARRVAL_P(args); + if (OP2_TYPE != IS_UNUSED) { + /* We don't need to handle named params in this case, + * because array_slice() is called with $preserve_keys == false. */ + zval *op2 = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R); + uint32_t skip = opline->extended_value; + uint32_t count = zend_hash_num_elements(ht); + zend_long len; + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + len = Z_LVAL_P(op2); + } else if (Z_TYPE_P(op2) == IS_NULL) { + len = count - skip; + } else if (EX_USES_STRICT_TYPES() + || !zend_parse_arg_long_weak(op2, &len, /* arg_num */ 3)) { + zend_type_error( + "array_slice(): Argument #3 ($length) must be of type ?int, %s given", + zend_zval_value_name(op2)); + FREE_OP2(); + FREE_OP1(); + HANDLE_EXCEPTION(); + } + + if (len < 0) { + len += (zend_long)(count - skip); + } + if (skip < count && len > 0) { + if (len > (zend_long)(count - skip)) { + len = (zend_long)(count - skip); + } + zend_vm_stack_extend_call_frame(&EX(call), 0, len); + arg_num = 1; + param = ZEND_CALL_ARG(EX(call), 1); + ZEND_HASH_FOREACH_VAL(ht, arg) { + bool must_wrap = 0; + if (skip > 0) { + skip--; + continue; + } else if ((zend_long)(arg_num - 1) >= len) { + break; + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + if (UNEXPECTED(!Z_ISREF_P(arg))) { + if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + /* By-value send is not allowed -- emit a warning, + * but still perform the call. */ + zend_param_must_be_ref(EX(call)->func, arg_num); + must_wrap = 1; + } + } + } else { + if (Z_ISREF_P(arg) && + !(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + /* don't separate references for __call */ + arg = Z_REFVAL_P(arg); + } + } + if (EXPECTED(!must_wrap)) { + ZVAL_COPY(param, arg); + } else { + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } + ZEND_CALL_NUM_ARGS(EX(call))++; + arg_num++; + param++; + } ZEND_HASH_FOREACH_END(); + } + FREE_OP2(); + } else { + zend_string *name; + bool have_named_params; + zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht)); + arg_num = 1; + param = ZEND_CALL_ARG(EX(call), 1); + have_named_params = 0; + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) { + if (name) { + void *cache_slot[2] = {NULL, NULL}; + have_named_params = 1; + param = zend_handle_named_arg(&EX(call), name, &arg_num, cache_slot); + if (!param) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else if (have_named_params) { + zend_throw_error(NULL, + "Cannot use positional argument after named argument"); + FREE_OP1(); + HANDLE_EXCEPTION(); + } + + bool must_wrap = 0; + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + if (UNEXPECTED(!Z_ISREF_P(arg))) { + if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + /* By-value send is not allowed -- emit a warning, + * but still perform the call. */ + zend_param_must_be_ref(EX(call)->func, arg_num); + must_wrap = 1; + } + } + } else { + if (Z_ISREF_P(arg) && + !(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + /* don't separate references for __call */ + arg = Z_REFVAL_P(arg); + } + } + + if (EXPECTED(!must_wrap)) { + ZVAL_COPY(param, arg); + } else { + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } + if (!name) { + ZEND_CALL_NUM_ARGS(EX(call))++; + arg_num++; + param++; + } + } ZEND_HASH_FOREACH_END(); + } + } + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(120, ZEND_SEND_USER, CONST|TMP|VAR|CV, NUM) +{ + USE_OPLINE + zval *arg, *param; + + SAVE_OPLINE(); + + arg = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R); + param = ZEND_CALL_VAR(EX(call), opline->result.var); + if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) { + zend_param_must_be_ref(EX(call)->func, opline->op2.num); + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } else { + ZVAL_COPY(param, arg); + } + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(199, ZEND_CHECK_UNDEF_ARGS, UNUSED, UNUSED) +{ + USE_OPLINE + + zend_execute_data *call = execute_data->call; + if (EXPECTED(!(ZEND_CALL_INFO(call) & ZEND_CALL_MAY_HAVE_UNDEF))) { + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + zend_handle_undef_args(call); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_HELPER(zend_missing_arg_helper, ANY, ANY) +{ +#ifdef ZEND_VM_IP_GLOBAL_REG + USE_OPLINE + + SAVE_OPLINE(); +#endif + zend_missing_arg_error(execute_data); + HANDLE_EXCEPTION(); +} + +ZEND_VM_HELPER(zend_verify_recv_arg_type_helper, ANY, ANY, zval *op_1) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), opline->op1.num, op_1, CACHE_ADDR(opline->extended_value)))) { + HANDLE_EXCEPTION(); + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(63, ZEND_RECV, NUM, UNUSED, CACHE_SLOT) +{ + USE_OPLINE + uint32_t arg_num = opline->op1.num; + zval *param; + + if (UNEXPECTED(arg_num > EX_NUM_ARGS())) { + ZEND_VM_DISPATCH_TO_HELPER(zend_missing_arg_helper); + } + + param = EX_VAR(opline->result.var); + + if (UNEXPECTED(!(opline->op2.num & (1u << Z_TYPE_P(param))))) { + ZEND_VM_DISPATCH_TO_HELPER(zend_verify_recv_arg_type_helper, op_1, param); + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_RECV, op->op2.num == MAY_BE_ANY, ZEND_RECV_NOTYPE, NUM, NUM, CACHE_SLOT) +{ + USE_OPLINE + uint32_t arg_num = opline->op1.num; + + if (UNEXPECTED(arg_num > EX_NUM_ARGS())) { + ZEND_VM_DISPATCH_TO_HELPER(zend_missing_arg_helper); + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(64, ZEND_RECV_INIT, NUM, CONST, CACHE_SLOT) +{ + USE_OPLINE + uint32_t arg_num; + zval *param; + + ZEND_VM_REPEATABLE_OPCODE + + arg_num = opline->op1.num; + param = EX_VAR(opline->result.var); + if (arg_num > EX_NUM_ARGS()) { + zval *default_value = RT_CONSTANT(opline, opline->op2); + + if (Z_OPT_TYPE_P(default_value) == IS_CONSTANT_AST) { + zval *cache_val = (zval*)CACHE_ADDR(Z_CACHE_SLOT_P(default_value)); + + /* we keep in cache only not refcounted values */ + if (Z_TYPE_P(cache_val) != IS_UNDEF) { + ZVAL_COPY_VALUE(param, cache_val); + } else { + SAVE_OPLINE(); + ZVAL_COPY(param, default_value); + zend_ast_evaluate_ctx ctx = {0}; + if (UNEXPECTED(zval_update_constant_with_ctx(param, EX(func)->op_array.scope, &ctx) != SUCCESS)) { + zval_ptr_dtor_nogc(param); + ZVAL_UNDEF(param); + HANDLE_EXCEPTION(); + } + if (!Z_REFCOUNTED_P(param) && !ctx.had_side_effects) { + ZVAL_COPY_VALUE(cache_val, param); + } + } + ZEND_VM_C_GOTO(recv_init_check_type); + } else { + ZVAL_COPY(param, default_value); + } + } else { +ZEND_VM_C_LABEL(recv_init_check_type): + if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) { + SAVE_OPLINE(); + if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), arg_num, param, CACHE_ADDR(opline->extended_value)))) { + HANDLE_EXCEPTION(); + } + } + } + + ZEND_VM_REPEAT_OPCODE(ZEND_RECV_INIT); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, NUM, UNUSED, CACHE_SLOT) +{ + USE_OPLINE + uint32_t arg_num = opline->op1.num; + uint32_t arg_count = EX_NUM_ARGS(); + zval *params; + + SAVE_OPLINE(); + + params = EX_VAR(opline->result.var); + + if (arg_num <= arg_count) { + ZEND_ASSERT(EX(func)->common.fn_flags & ZEND_ACC_VARIADIC); + ZEND_ASSERT(EX(func)->common.num_args == arg_num - 1); + zend_arg_info *arg_info = &EX(func)->common.arg_info[arg_num - 1]; + + array_init_size(params, arg_count - arg_num + 1); + zend_hash_real_init_packed(Z_ARRVAL_P(params)); + ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(params)) { + zval *param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T); + if (UNEXPECTED(ZEND_TYPE_IS_SET(arg_info->type))) { + ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS); + do { + if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) { + ZEND_HASH_FILL_FINISH(); + HANDLE_EXCEPTION(); + } + + if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param); + ZEND_HASH_FILL_ADD(param); + param++; + } while (++arg_num <= arg_count); + } else { + do { + if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param); + ZEND_HASH_FILL_ADD(param); + param++; + } while (++arg_num <= arg_count); + } + } ZEND_HASH_FILL_END(); + } else { + ZVAL_EMPTY_ARRAY(params); + } + + if (EX_CALL_INFO() & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_string *name; + zval *param; + zend_arg_info *arg_info = &EX(func)->common.arg_info[EX(func)->common.num_args]; + if (ZEND_TYPE_IS_SET(arg_info->type)) { + SEPARATE_ARRAY(params); + ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EX(extra_named_params), name, param) { + if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) { + HANDLE_EXCEPTION(); + } + Z_TRY_ADDREF_P(param); + zend_hash_add_new(Z_ARRVAL_P(params), name, param); + } ZEND_HASH_FOREACH_END(); + } else if (zend_hash_num_elements(Z_ARRVAL_P(params)) == 0) { + GC_ADDREF(EX(extra_named_params)); + ZVAL_ARR(params, EX(extra_named_params)); + } else { + SEPARATE_ARRAY(params); + ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EX(extra_named_params), name, param) { + Z_TRY_ADDREF_P(param); + zend_hash_add_new(Z_ARRVAL_P(params), name, param); + } ZEND_HASH_FOREACH_END(); + } + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_COLD_CONST_HANDLER(52, ZEND_BOOL, CONST|TMPVAR|CV, ANY) +{ + USE_OPLINE + zval *val; + + val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + /* The result and op1 can be the same cv zval */ + const uint32_t orig_val_type = Z_TYPE_INFO_P(val); + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } else { + SAVE_OPLINE(); + ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val)); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HELPER(zend_case_helper, ANY, ANY, zval *op_1, zval *op_2) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (OP2_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret == 0, 1); +} + +ZEND_VM_HANDLER(48, ZEND_CASE, TMPVAR, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +ZEND_VM_C_LABEL(case_true): + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +ZEND_VM_C_LABEL(case_false): + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + ZEND_VM_C_GOTO(case_double); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +ZEND_VM_C_LABEL(case_double): + if (d1 == d2) { + ZEND_VM_C_GOTO(case_true); + } else { + ZEND_VM_C_GOTO(case_false); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + ZEND_VM_C_GOTO(case_double); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + FREE_OP2(); + if (result) { + ZEND_VM_C_GOTO(case_true); + } else { + ZEND_VM_C_GOTO(case_false); + } + } + } + ZEND_VM_DISPATCH_TO_HELPER(zend_case_helper, op_1, op1, op_2, op2); +} + +ZEND_VM_HANDLER(68, ZEND_NEW, UNUSED|CLASS_FETCH|CONST|VAR, UNUSED|CACHE_SLOT, NUM) +{ + USE_OPLINE + zval *result; + zend_function *constructor; + zend_class_entry *ce; + zend_execute_data *call; + + SAVE_OPLINE(); + if (OP1_TYPE == IS_CONST) { + ce = CACHED_PTR(opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->op2.num, ce); + } + } else if (OP1_TYPE == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + result = EX_VAR(opline->result.var); + if (UNEXPECTED(object_init_ex(result, ce) != SUCCESS)) { + ZVAL_UNDEF(result); + HANDLE_EXCEPTION(); + } + + constructor = Z_OBJ_HT_P(result)->get_constructor(Z_OBJ_P(result)); + if (constructor == NULL) { + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + + /* If there are no arguments, skip over the DO_FCALL opcode. We check if the next + * opcode is DO_FCALL in case EXT instructions are used. */ + if (EXPECTED(opline->extended_value == 0 && (opline+1)->opcode == ZEND_DO_FCALL)) { + ZEND_VM_NEXT_OPCODE_EX(1, 2); + } + + /* Perform a dummy function call */ + call = zend_vm_stack_push_call_frame( + ZEND_CALL_FUNCTION, (zend_function *) &zend_pass_function, + opline->extended_value, NULL); + } else { + if (EXPECTED(constructor->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&constructor->op_array))) { + init_func_run_time_cache(&constructor->op_array); + } + /* We are not handling overloaded classes right now */ + call = zend_vm_stack_push_call_frame( + ZEND_CALL_FUNCTION | ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_THIS, + constructor, + opline->extended_value, + Z_OBJ_P(result)); + Z_ADDREF_P(result); + } + + call->prev_execute_data = EX(call); + EX(call) = call; + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_CONST_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|THIS|CV, ANY) +{ + USE_OPLINE + zval *obj; + zend_object *zobj; + zend_class_entry *ce, *scope; + zend_function *clone; + zend_object_clone_obj_t clone_call; + + SAVE_OPLINE(); + obj = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_R); + + do { + if (OP1_TYPE == IS_CONST || + (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) { + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(obj)) { + obj = Z_REFVAL_P(obj); + if (EXPECTED(Z_TYPE_P(obj) == IS_OBJECT)) { + break; + } + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(obj) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "__clone method called on non-object"); + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } while (0); + + zobj = Z_OBJ_P(obj); + ce = zobj->ce; + clone = ce->clone; + clone_call = zobj->handlers->clone_obj; + if (UNEXPECTED(clone_call == NULL)) { + zend_throw_error(NULL, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + FREE_OP1(); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (clone && !(clone->common.fn_flags & ZEND_ACC_PUBLIC)) { + scope = EX(func)->op_array.scope; + if (clone->common.scope != scope) { + if (UNEXPECTED(clone->common.fn_flags & ZEND_ACC_PRIVATE) + || UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) { + zend_wrong_clone_call(clone, scope); + FREE_OP1(); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(zobj)); + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(99, ZEND_FETCH_CONSTANT, UNUSED|CONST_FETCH, CONST, CACHE_SLOT) +{ + USE_OPLINE + zend_constant *c; + + c = CACHED_PTR(opline->extended_value); + if (EXPECTED(c != NULL) && EXPECTED(!IS_SPECIAL_CACHE_VAL(c))) { + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value); + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + zend_quick_get_constant(RT_CONSTANT(opline, opline->op2) + 1, opline->op1.num OPLINE_CC EXECUTE_DATA_CC); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CONST|TMPVARCV, CACHE_SLOT) +{ + zend_class_entry *ce, *scope; + zend_class_constant *c; + zval *value, *zv, *constant_zv; + zend_string *constant_name; + USE_OPLINE + + SAVE_OPLINE(); + + do { + if (OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value + sizeof(void*)))) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + } + if (OP1_TYPE == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value))) { + ce = CACHED_PTR(opline->extended_value); + } else { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->extended_value, ce); + } + } else if (OP1_TYPE == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + if (OP1_TYPE != IS_CONST + && OP2_TYPE == IS_CONST + && EXPECTED(CACHED_PTR(opline->extended_value) == ce)) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + + constant_zv = GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R); + if (UNEXPECTED(Z_TYPE_P(constant_zv) != IS_STRING)) { + zend_invalid_class_constant_type_error(Z_TYPE_P(constant_zv)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + constant_name = Z_STR_P(constant_zv); + /* Magic 'class' for constant OP2 is caught at compile-time */ + if (OP2_TYPE != IS_CONST && UNEXPECTED(zend_string_equals_literal_ci(constant_name, "class"))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE(); + } + zv = OP2_TYPE == IS_CONST + ? zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), constant_name) + : zend_hash_find(CE_CONSTANTS_TABLE(ce), constant_name); + + if (EXPECTED(zv != NULL)) { + c = Z_PTR_P(zv); + scope = EX(func)->op_array.scope; + if (!zend_verify_const_access(c, scope)) { + zend_throw_error(NULL, "Cannot access %s constant %s::%s", zend_visibility_string(ZEND_CLASS_CONST_FLAGS(c)), ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + + if (ce->ce_flags & ZEND_ACC_TRAIT) { + zend_throw_error(NULL, "Cannot access trait constant %s::%s directly", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + + bool is_constant_deprecated = ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED; + if (UNEXPECTED(is_constant_deprecated)) { + zend_error(E_DEPRECATED, "Constant %s::%s is deprecated", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + + if (EG(exception)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + } + + value = &c->value; + // Enums require loading of all class constants to build the backed enum table + if (ce->ce_flags & ZEND_ACC_ENUM && ce->enum_backing_type != IS_UNDEF && ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { + if (UNEXPECTED(zend_update_class_constants(ce) == FAILURE)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + } + if (Z_TYPE_P(value) == IS_CONSTANT_AST) { + if (UNEXPECTED(zend_update_class_constant(c, constant_name, c->ce) != SUCCESS)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + } + if (OP2_TYPE == IS_CONST && !is_constant_deprecated) { + CACHE_POLYMORPHIC_PTR(opline->extended_value, ce, value); + } + } else { + zend_throw_error(NULL, "Undefined constant %s::%s", + ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + } while (0); + + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), value); + + FREE_OP2(); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV, REF) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + FREE_OP1(); + } else { + expr_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE == IS_TMP_VAR) { + /* pass */ + } else if (OP1_TYPE == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (OP1_TYPE == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (OP1_TYPE == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (OP2_TYPE != IS_UNUSED) { + zval *offset = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + zend_string *str; + zend_ulong hval; + +ZEND_VM_C_LABEL(add_again): + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (OP2_TYPE != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + ZEND_VM_C_GOTO(num_index); + } + } +ZEND_VM_C_LABEL(str_index): + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +ZEND_VM_C_LABEL(num_index): + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((OP2_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + ZEND_VM_C_GOTO(add_again); + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + ZEND_VM_C_GOTO(str_index); + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + ZEND_VM_C_GOTO(num_index); + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + ZEND_VM_C_GOTO(num_index); + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + ZEND_VM_C_GOTO(num_index); + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + ZEND_VM_C_GOTO(num_index); + } else if (OP2_TYPE == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + ZEND_VM_C_GOTO(str_index); + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + FREE_OP2(); + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(147, ZEND_ADD_ARRAY_UNPACK, ANY, ANY) +{ + USE_OPLINE + zval *op1; + HashTable *result_ht; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR(BP_VAR_R); + result_ht = Z_ARRVAL_P(EX_VAR(opline->result.var)); + +ZEND_VM_C_LABEL(add_unpack_again): + if (EXPECTED(Z_TYPE_P(op1) == IS_ARRAY)) { + HashTable *ht = Z_ARRVAL_P(op1); + zval *val; + + if (HT_IS_PACKED(ht) && (zend_hash_num_elements(result_ht) == 0 || HT_IS_PACKED(result_ht))) { + zend_hash_extend(result_ht, result_ht->nNumUsed + zend_hash_num_elements(ht), 1); + ZEND_HASH_FILL_PACKED(result_ht) { + ZEND_HASH_PACKED_FOREACH_VAL(ht, val) { + if (UNEXPECTED(Z_ISREF_P(val)) && + UNEXPECTED(Z_REFCOUNT_P(val) == 1)) { + val = Z_REFVAL_P(val); + } + Z_TRY_ADDREF_P(val); + ZEND_HASH_FILL_ADD(val); + } ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FILL_END(); + } else { + zend_string *key; + + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, key, val) { + if (UNEXPECTED(Z_ISREF_P(val)) && + UNEXPECTED(Z_REFCOUNT_P(val) == 1)) { + val = Z_REFVAL_P(val); + } + Z_TRY_ADDREF_P(val); + if (key) { + zend_hash_update(result_ht, key, val); + } else { + if (!zend_hash_next_index_insert(result_ht, val)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(val); + break; + } + } + } ZEND_HASH_FOREACH_END(); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_OBJECT)) { + zend_class_entry *ce = Z_OBJCE_P(op1); + zend_object_iterator *iter; + + if (!ce || !ce->get_iterator) { + zend_type_error("Only arrays and Traversables can be unpacked"); + } else { + iter = ce->get_iterator(ce, op1, 0); + if (UNEXPECTED(!iter)) { + FREE_OP1(); + if (!EG(exception)) { + zend_throw_exception_ex( + NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name) + ); + } + HANDLE_EXCEPTION(); + } + + const zend_object_iterator_funcs *funcs = iter->funcs; + if (funcs->rewind) { + funcs->rewind(iter); + } + + for (; funcs->valid(iter) == SUCCESS; ) { + zval *val; + + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + val = funcs->get_current_data(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + zval key; + if (funcs->get_current_key) { + funcs->get_current_key(iter, &key); + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + if (UNEXPECTED(Z_TYPE(key) != IS_LONG && Z_TYPE(key) != IS_STRING)) { + zend_throw_error(NULL, + "Keys must be of type int|string during array unpacking"); + zval_ptr_dtor(&key); + break; + } + } else { + ZVAL_UNDEF(&key); + } + + ZVAL_DEREF(val); + Z_TRY_ADDREF_P(val); + + zend_ulong num_key; + if (Z_TYPE(key) == IS_STRING && !ZEND_HANDLE_NUMERIC(Z_STR(key), num_key)) { + zend_hash_update(result_ht, Z_STR(key), val); + zval_ptr_dtor_str(&key); + } else { + zval_ptr_dtor(&key); + if (!zend_hash_next_index_insert(result_ht, val)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(val); + break; + } + } + + funcs->move_forward(iter); + if (UNEXPECTED(EG(exception))) { + break; + } + } + + zend_iterator_dtor(iter); + } + } else if (EXPECTED(Z_ISREF_P(op1))) { + op1 = Z_REFVAL_P(op1); + ZEND_VM_C_GOTO(add_unpack_again); + } else { + zend_throw_error(NULL, "Only arrays and Traversables can be unpacked"); + } + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|CV|UNUSED, CONST|TMPVAR|UNUSED|NEXT|CV, ARRAY_INIT|REF) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (OP1_TYPE != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ADD_ARRAY_ELEMENT); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +ZEND_VM_COLD_CONST_HANDLER(51, ZEND_CAST, CONST|TMP|VAR|CV, ANY, TYPE) +{ + USE_OPLINE + zval *expr; + zval *result = EX_VAR(opline->result.var); + HashTable *ht; + + SAVE_OPLINE(); + expr = GET_OP1_ZVAL_PTR(BP_VAR_R); + + switch (opline->extended_value) { + case IS_LONG: + ZVAL_LONG(result, zval_get_long(expr)); + break; + case IS_DOUBLE: + ZVAL_DOUBLE(result, zval_get_double(expr)); + break; + case IS_STRING: + ZVAL_STR(result, zval_get_string(expr)); + break; + default: + ZEND_ASSERT(opline->extended_value != _IS_BOOL && "Must use ZEND_BOOL instead"); + if (OP1_TYPE & (IS_VAR|IS_CV)) { + ZVAL_DEREF(expr); + } + /* If value is already of correct type, return it directly */ + if (Z_TYPE_P(expr) == opline->extended_value) { + ZVAL_COPY_VALUE(result, expr); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (OP1_TYPE != IS_TMP_VAR) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } + + FREE_OP1_IF_VAR(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (opline->extended_value == IS_ARRAY) { + if (OP1_TYPE == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) { + if (Z_TYPE_P(expr) != IS_NULL) { + ZVAL_ARR(result, zend_new_array(1)); + expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } else { + ZVAL_EMPTY_ARRAY(result); + } + } else if (Z_OBJ_P(expr)->properties == NULL + && Z_OBJ_HT_P(expr)->get_properties_for == NULL + && Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) { + /* Optimized version without rebuilding properties HashTable */ + ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr))); + } else { + HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST); + if (obj_ht) { + /* fast copy */ + ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht, + (Z_OBJCE_P(expr)->default_properties_count || + Z_OBJ_P(expr)->handlers != &std_object_handlers || + GC_IS_RECURSIVE(obj_ht)))); + zend_release_properties(obj_ht); + } else { + ZVAL_EMPTY_ARRAY(result); + } + } + } else { + ZEND_ASSERT(opline->extended_value == IS_OBJECT); + ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def)); + if (Z_TYPE_P(expr) == IS_ARRAY) { + ht = zend_symtable_to_proptable(Z_ARR_P(expr)); + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + /* TODO: try not to duplicate immutable arrays as well ??? */ + ht = zend_array_dup(ht); + } + Z_OBJ_P(result)->properties = ht; + } else if (Z_TYPE_P(expr) != IS_NULL) { + Z_OBJ_P(result)->properties = ht = zend_new_array(1); + expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } + } + } + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY, EVAL, SPEC(OBSERVER)) +{ + USE_OPLINE + zend_op_array *new_op_array; + zval *inc_filename; + + SAVE_OPLINE(); + inc_filename = GET_OP1_ZVAL_PTR(BP_VAR_R); + new_op_array = zend_include_or_eval(inc_filename, opline->extended_value); + if (UNEXPECTED(EG(exception) != NULL)) { + FREE_OP1(); + if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) { + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (new_op_array == ZEND_FAKE_OP_ARRAY) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } + } else if (UNEXPECTED(new_op_array == NULL)) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } + } else if (new_op_array->last == 1 + && new_op_array->opcodes[0].opcode == ZEND_RETURN + && new_op_array->opcodes[0].op1_type == IS_CONST + && EXPECTED(zend_execute_ex == execute_ex)) { + if (RETURN_VALUE_USED(opline)) { + const zend_op *op = new_op_array->opcodes; + + ZVAL_COPY(EX_VAR(opline->result.var), RT_CONSTANT(op, op->op1)); + } + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } else { + zval *return_value = NULL; + zend_execute_data *call; + if (RETURN_VALUE_USED(opline)) { + return_value = EX_VAR(opline->result.var); + } + + new_op_array->scope = EX(func)->op_array.scope; + + call = zend_vm_stack_push_call_frame( + (Z_TYPE_INFO(EX(This)) & ZEND_CALL_HAS_THIS) | ZEND_CALL_NESTED_CODE | ZEND_CALL_HAS_SYMBOL_TABLE, + (zend_function*)new_op_array, 0, + Z_PTR(EX(This))); + + if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) { + call->symbol_table = EX(symbol_table); + } else { + call->symbol_table = zend_rebuild_symbol_table(); + } + + call->prev_execute_data = execute_data; + i_init_code_execute_data(call, new_op_array, return_value); + ZEND_OBSERVER_FCALL_BEGIN(call); + if (EXPECTED(zend_execute_ex == execute_ex)) { + FREE_OP1(); + ZEND_VM_ENTER(); + } else { + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + zend_vm_stack_free_call_frame(call); + } + + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + FREE_OP1(); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + FREE_OP1(); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(153, ZEND_UNSET_CV, CV, UNUSED) +{ + USE_OPLINE + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + ZVAL_UNDEF(var); + SAVE_OPLINE(); + GC_DTOR(garbage); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZVAL_UNDEF(var); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMPVAR|CV, UNUSED, VAR_FETCH) +{ + USE_OPLINE + zval *varname; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + + varname = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (OP1_TYPE == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + tmp_name = NULL; + } else { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + varname = ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + zend_hash_del_ind(target_symbol_table, name); + + if (OP1_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +ZEND_VM_COLD_HANDLER(179, ZEND_UNSET_STATIC_PROP, ANY, ANY, CACHE_SLOT) +{ + USE_OPLINE + zval *varname; + zend_string *name, *tmp_name = NULL; + zend_class_entry *ce; + + SAVE_OPLINE(); + + if (OP2_TYPE == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + /*CACHE_PTR(opline->extended_value, ce);*/ + } + } else if (OP2_TYPE == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + + varname = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP1_TYPE == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + } else { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + varname = ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } + + zend_std_unset_static_property(ce, name); + + zend_tmp_string_release(tmp_name); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|CV, CONST|TMPVAR|CV) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_ulong hval; + zend_string *key; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_UNSET); + offset = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + + do { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + +ZEND_VM_C_LABEL(unset_dim_array): + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +ZEND_VM_C_LABEL(offset_again): + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + key = Z_STR_P(offset); + if (OP2_TYPE != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(key, hval)) { + ZEND_VM_C_GOTO(num_index_dim); + } + } +ZEND_VM_C_LABEL(str_index_dim): + ZEND_ASSERT(ht != &EG(symbol_table)); + zend_hash_del(ht, key); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +ZEND_VM_C_LABEL(num_index_dim): + zend_hash_index_del(ht, hval); + } else if ((OP2_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + ZEND_VM_C_GOTO(offset_again); + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + ZEND_VM_C_GOTO(num_index_dim); + } else if (Z_TYPE_P(offset) == IS_NULL) { + key = ZSTR_EMPTY_ALLOC(); + ZEND_VM_C_GOTO(str_index_dim); + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + ZEND_VM_C_GOTO(num_index_dim); + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + ZEND_VM_C_GOTO(num_index_dim); + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + ZEND_VM_C_GOTO(num_index_dim); + } else if (OP2_TYPE == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + key = ZSTR_EMPTY_ALLOC(); + ZEND_VM_C_GOTO(str_index_dim); + } else { + zend_illegal_array_offset_unset(offset); + } + break; + } else if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + ZEND_VM_C_GOTO(unset_dim_array); + } + } + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + container = ZVAL_UNDEFINED_OP1(); + } + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + offset = ZVAL_UNDEFINED_OP2(); + } + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if (OP2_TYPE == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + Z_OBJ_HT_P(container)->unset_dimension(Z_OBJ_P(container), offset); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { + zend_throw_error(NULL, "Cannot unset string offsets"); + } else if (UNEXPECTED(Z_TYPE_P(container) > IS_FALSE)) { + zend_throw_error(NULL, "Cannot unset offset in a non-array variable"); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_FALSE)) { + zend_false_to_array_deprecated(); + } + } while (0); + + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_SLOT) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_UNSET); + offset = GET_OP2_ZVAL_PTR(BP_VAR_R); + + do { + if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (OP1_TYPE == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP2(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *array_ptr, *result; + + SAVE_OPLINE(); + + array_ptr = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R); + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (OP1_TYPE != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(array_ptr); + } + Z_FE_POS_P(result) = 0; + + FREE_OP1_IF_VAR(); + ZEND_VM_NEXT_OPCODE(); + } else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + zend_object *zobj = Z_OBJ_P(array_ptr); + if (!zobj->ce->get_iterator) { + HashTable *properties = zobj->properties; + if (properties) { + if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(properties); + } + properties = zobj->properties = zend_array_dup(properties); + } + } else { + properties = zobj->handlers->get_properties(zobj); + } + + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (OP1_TYPE != IS_TMP_VAR) { + Z_ADDREF_P(array_ptr); + } + + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(result) = (uint32_t) -1; + FREE_OP1_IF_VAR(); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0); + FREE_OP1_IF_VAR(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC); + + FREE_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + FREE_OP1(); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *array_ptr, *array_ref; + + SAVE_OPLINE(); + + if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { + array_ref = array_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); + if (Z_ISREF_P(array_ref)) { + array_ptr = Z_REFVAL_P(array_ref); + } + } else { + array_ref = array_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + } + + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ref = EX_VAR(opline->result.var); + ZVAL_NEW_REF(array_ref, array_ptr); + array_ptr = Z_REFVAL_P(array_ref); + } + if (OP1_TYPE == IS_CONST) { + ZVAL_ARR(array_ptr, zend_array_dup(Z_ARRVAL_P(array_ptr))); + } else { + SEPARATE_ARRAY(array_ptr); + } + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_ARRVAL_P(array_ptr), 0); + + FREE_OP1_IF_VAR(); + ZEND_VM_NEXT_OPCODE(); + } else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + if (!Z_OBJCE_P(array_ptr)->get_iterator) { + HashTable *properties; + if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ptr = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(array_ptr, array_ref); + } + if (Z_OBJ_P(array_ptr)->properties + && UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(Z_OBJ_P(array_ptr)->properties); + } + Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties); + } + + properties = Z_OBJPROP_P(array_ptr); + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1; + FREE_OP1_IF_VAR(); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0); + FREE_OP1_IF_VAR(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC); + FREE_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + FREE_OP1(); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +ZEND_VM_HELPER(zend_fe_fetch_object_helper, ANY, ANY) +{ + USE_OPLINE + zval *array; + zval *value; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + Bucket *p; + zend_object_iterator *iter; + + array = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + + ZEND_ASSERT(Z_TYPE_P(array) == IS_OBJECT); + if ((iter = zend_iterator_unwrap(array)) == NULL) { + /* plain object */ + + fe_ht = Z_OBJPROP_P(array); + pos = zend_hash_iterator_pos(Z_FE_ITER_P(array), fe_ht); + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_C_GOTO(fe_fetch_r_exit); + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + if (EXPECTED(value_type != IS_UNDEF)) { + if (UNEXPECTED(value_type == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + value_type = Z_TYPE_INFO_P(value); + if (EXPECTED(value_type != IS_UNDEF) + && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) { + break; + } + } else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0) + || !p->key + || zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) { + break; + } + } + p++; + } + EG(ht_iterators)[Z_FE_ITER_P(array)].pos = pos; + if (RETURN_VALUE_USED(opline)) { + if (UNEXPECTED(!p->key)) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else if (ZSTR_VAL(p->key)[0]) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } else { + const char *class_name, *prop_name; + size_t prop_name_len; + zend_unmangle_property_name_ex( + p->key, &class_name, &prop_name, &prop_name_len); + ZVAL_STRINGL(EX_VAR(opline->result.var), prop_name, prop_name_len); + } + } + } else { + const zend_object_iterator_funcs *funcs = iter->funcs; + if (EXPECTED(++iter->index > 0)) { + /* This could cause an endless loop if index becomes zero again. + * In case that ever happens we need an additional flag. */ + funcs->move_forward(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(funcs->valid(iter) == FAILURE)) { + /* reached end of iteration */ + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } +ZEND_VM_C_LABEL(fe_fetch_r_exit): + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + } + value = funcs->get_current_data(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (!value) { + /* failure in get_current_data */ + ZEND_VM_C_GOTO(fe_fetch_r_exit); + } + if (RETURN_VALUE_USED(opline)) { + if (funcs->get_current_key) { + funcs->get_current_key(iter, EX_VAR(opline->result.var)); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } else { + ZVAL_LONG(EX_VAR(opline->result.var), iter->index); + } + } + value_type = Z_TYPE_INFO_P(value); + } + + if (EXPECTED(OP2_TYPE == IS_CV)) { + zval *variable_ptr = EX_VAR(opline->op2.var); + zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + } else { + zval *res = EX_VAR(opline->op2.var); + zend_refcounted *gc = Z_COUNTED_P(value); + + ZVAL_COPY_VALUE_EX(res, value, gc, value_type); + if (Z_TYPE_INFO_REFCOUNTED(value_type)) { + GC_ADDREF(gc); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(78, ZEND_FE_FETCH_R, VAR, ANY, JMP_ADDR) +{ + USE_OPLINE + zval *array; + zval *value; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + + array = EX_VAR(opline->op1.var); + if (UNEXPECTED(Z_TYPE_P(array) != IS_ARRAY)) { + ZEND_VM_DISPATCH_TO_HELPER(zend_fe_fetch_object_helper); + } + fe_ht = Z_ARRVAL_P(array); + pos = Z_FE_POS_P(array); + if (HT_IS_PACKED(fe_ht)) { + value = fe_ht->arPacked + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + pos++; + value++; + } + Z_FE_POS_P(array) = pos + 1; + if (RETURN_VALUE_USED(opline)) { + ZVAL_LONG(EX_VAR(opline->result.var), pos); + } + } else { + Bucket *p; + + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + p++; + } + Z_FE_POS_P(array) = pos; + if (RETURN_VALUE_USED(opline)) { + if (!p->key) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } + } + } + if (EXPECTED(OP2_TYPE == IS_CV)) { + zval *variable_ptr = EX_VAR(opline->op2.var); + SAVE_OPLINE(); + zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + zval *res = EX_VAR(opline->op2.var); + zend_refcounted *gc = Z_COUNTED_P(value); + + ZVAL_COPY_VALUE_EX(res, value, gc, value_type); + if (Z_TYPE_INFO_REFCOUNTED(value_type)) { + GC_ADDREF(gc); + } + ZEND_VM_NEXT_OPCODE(); + } +} + +ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY, JMP_ADDR) +{ + USE_OPLINE + zval *array; + zval *value; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + Bucket *p; + + array = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + + ZVAL_DEREF(array); + if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) { + pos = zend_hash_iterator_pos_ex(Z_FE_ITER_P(EX_VAR(opline->op1.var)), array); + fe_ht = Z_ARRVAL_P(array); + if (HT_IS_PACKED(fe_ht)) { + value = fe_ht->arPacked + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_C_GOTO(fe_fetch_w_exit); + } + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + pos++; + value++; + } + EG(ht_iterators)[Z_FE_ITER_P(EX_VAR(opline->op1.var))].pos = pos + 1; + if (RETURN_VALUE_USED(opline)) { + ZVAL_LONG(EX_VAR(opline->result.var), pos); + } + } else { + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_C_GOTO(fe_fetch_w_exit); + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + p++; + } + EG(ht_iterators)[Z_FE_ITER_P(EX_VAR(opline->op1.var))].pos = pos; + if (RETURN_VALUE_USED(opline)) { + if (!p->key) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } + } + } + } else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) { + zend_object_iterator *iter; + + if ((iter = zend_iterator_unwrap(array)) == NULL) { + /* plain object */ + + fe_ht = Z_OBJPROP_P(array); + pos = zend_hash_iterator_pos(Z_FE_ITER_P(EX_VAR(opline->op1.var)), fe_ht); + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_C_GOTO(fe_fetch_w_exit); + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + if (EXPECTED(value_type != IS_UNDEF)) { + if (UNEXPECTED(value_type == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + value_type = Z_TYPE_INFO_P(value); + if (EXPECTED(value_type != IS_UNDEF) + && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) { + if ((value_type & Z_TYPE_MASK) != IS_REFERENCE) { + zend_property_info *prop_info = + zend_get_property_info_for_slot(Z_OBJ_P(array), value); + if (UNEXPECTED(prop_info)) { + if (UNEXPECTED(prop_info->flags & ZEND_ACC_READONLY)) { + zend_throw_error(NULL, + "Cannot acquire reference to readonly property %s::$%s", + ZSTR_VAL(prop_info->ce->name), ZSTR_VAL(p->key)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_NEW_REF(value, value); + ZEND_REF_ADD_TYPE_SOURCE(Z_REF_P(value), prop_info); + value_type = IS_REFERENCE_EX; + } + } + } + break; + } + } else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0) + || !p->key + || zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) { + break; + } + } + p++; + } + EG(ht_iterators)[Z_FE_ITER_P(EX_VAR(opline->op1.var))].pos = pos; + if (RETURN_VALUE_USED(opline)) { + if (UNEXPECTED(!p->key)) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else if (ZSTR_VAL(p->key)[0]) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } else { + const char *class_name, *prop_name; + size_t prop_name_len; + zend_unmangle_property_name_ex( + p->key, &class_name, &prop_name, &prop_name_len); + ZVAL_STRINGL(EX_VAR(opline->result.var), prop_name, prop_name_len); + } + } + } else { + const zend_object_iterator_funcs *funcs = iter->funcs; + if (++iter->index > 0) { + /* This could cause an endless loop if index becomes zero again. + * In case that ever happens we need an additional flag. */ + funcs->move_forward(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(funcs->valid(iter) == FAILURE)) { + /* reached end of iteration */ + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + ZEND_VM_C_GOTO(fe_fetch_w_exit); + } + } + value = funcs->get_current_data(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (!value) { + /* failure in get_current_data */ + ZEND_VM_C_GOTO(fe_fetch_w_exit); + } + if (RETURN_VALUE_USED(opline)) { + if (funcs->get_current_key) { + funcs->get_current_key(iter, EX_VAR(opline->result.var)); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } else { + ZVAL_LONG(EX_VAR(opline->result.var), iter->index); + } + } + value_type = Z_TYPE_INFO_P(value); + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array)); + if (UNEXPECTED(EG(exception))) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } +ZEND_VM_C_LABEL(fe_fetch_w_exit): + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + + if (EXPECTED((value_type & Z_TYPE_MASK) != IS_REFERENCE)) { + zend_refcounted *gc = Z_COUNTED_P(value); + zval *ref; + ZVAL_NEW_EMPTY_REF(value); + ref = Z_REFVAL_P(value); + ZVAL_COPY_VALUE_EX(ref, value, gc, value_type); + } + if (EXPECTED(OP2_TYPE == IS_CV)) { + zval *variable_ptr = EX_VAR(opline->op2.var); + if (EXPECTED(variable_ptr != value)) { + zend_reference *ref; + + ref = Z_REF_P(value); + GC_ADDREF(ref); + i_zval_ptr_dtor(variable_ptr); + ZVAL_REF(variable_ptr, ref); + } + } else { + Z_ADDREF_P(value); + ZVAL_REF(EX_VAR(opline->op2.var), Z_REF_P(value)); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_HANDLER(154, ZEND_ISSET_ISEMPTY_CV, CV, UNUSED, ISSET, SPEC(ISSET)) +{ + USE_OPLINE + zval *value; + + value = EX_VAR(opline->op1.var); + if (!(opline->extended_value & ZEND_ISEMPTY)) { + if (Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL)) { + ZEND_VM_SMART_BRANCH_TRUE(); + } else { + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else { + bool result; + + SAVE_OPLINE(); + result = !i_zend_is_true(value); + ZEND_VM_SMART_BRANCH(result, 1); + } +} + +ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED, VAR_FETCH|ISSET) +{ + USE_OPLINE + zval *value; + /* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */ + int result; + zval *varname; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + varname = GET_OP1_ZVAL_PTR(BP_VAR_IS); + if (OP1_TYPE == IS_CONST) { + name = Z_STR_P(varname); + } else { + name = zval_get_tmp_string(varname, &tmp_name); + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + value = zend_hash_find_ex(target_symbol_table, name, OP1_TYPE == IS_CONST); + + if (OP1_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + FREE_OP1(); + + if (!value) { + result = (opline->extended_value & ZEND_ISEMPTY); + } else { + if (Z_TYPE_P(value) == IS_INDIRECT) { + value = Z_INDIRECT_P(value); + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + if (Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + } + result = Z_TYPE_P(value) > IS_NULL; + } else { + result = !i_zend_is_true(value); + } + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +ZEND_VM_HANDLER(180, ZEND_ISSET_ISEMPTY_STATIC_PROP, ANY, CLASS_FETCH, ISSET|CACHE_SLOT) +{ + USE_OPLINE + zval *value; + zend_result fetch_result; + bool result; + + SAVE_OPLINE(); + + fetch_result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = fetch_result == SUCCESS && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + } else { + result = fetch_result != SUCCESS || !i_zend_is_true(value); + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, CONST|TMPVAR|CV, CONST|TMPVAR|CV, ISSET) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_IS); + offset = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +ZEND_VM_C_LABEL(isset_dim_obj_array): + ht = Z_ARRVAL_P(container); +ZEND_VM_C_LABEL(isset_again): + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (OP2_TYPE != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + ZEND_VM_C_GOTO(num_index_prop); + } + } + value = zend_hash_find_ex(ht, str, OP2_TYPE == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +ZEND_VM_C_LABEL(num_index_prop): + value = zend_hash_index_find(ht, hval); + } else if ((OP2_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + ZEND_VM_C_GOTO(isset_again); + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + ZEND_VM_C_GOTO(isset_dim_obj_exit); + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if (OP1_TYPE & (IS_CONST|IS_CV)) { + /* avoid exception check */ + FREE_OP2(); + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + ZEND_VM_C_GOTO(isset_dim_obj_exit); + } else if ((OP1_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + ZEND_VM_C_GOTO(isset_dim_obj_array); + } + } + + if (OP2_TYPE == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +ZEND_VM_C_LABEL(isset_dim_obj_exit): + FREE_OP2(); + FREE_OP1(); + ZEND_VM_SMART_BRANCH(result, 1); +} + +ZEND_VM_COLD_CONST_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, CONST|TMPVAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, ISSET|CACHE_SLOT) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS); + offset = GET_OP2_ZVAL_PTR(BP_VAR_R); + + if (OP1_TYPE == IS_CONST || + (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + ZEND_VM_C_GOTO(isset_object_finish); + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + ZEND_VM_C_GOTO(isset_object_finish); + } + } + + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + ZEND_VM_C_GOTO(isset_object_finish); + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +ZEND_VM_C_LABEL(isset_object_finish): + FREE_OP2(); + FREE_OP1(); + ZEND_VM_SMART_BRANCH(result, 1); +} + +ZEND_VM_HANDLER(194, ZEND_ARRAY_KEY_EXISTS, CV|TMPVAR|CONST, CV|TMPVAR|CONST) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + subject = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +ZEND_VM_C_LABEL(array_key_exists_array): + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if ((OP2_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + ZEND_VM_C_GOTO(array_key_exists_array); + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + FREE_OP2(); + FREE_OP1(); + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +ZEND_VM_COLD_HANDLER(79, ZEND_EXIT, ANY, ANY) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (OP1_TYPE != IS_UNUSED) { + zval *ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + + do { + if (Z_TYPE_P(ptr) == IS_LONG) { + EG(exit_status) = Z_LVAL_P(ptr); + } else { + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) { + ptr = Z_REFVAL_P(ptr); + if (Z_TYPE_P(ptr) == IS_LONG) { + EG(exit_status) = Z_LVAL_P(ptr); + break; + } + } + zend_print_zval(ptr, 0); + } + } while (0); + FREE_OP1(); + } + + if (!EG(exception)) { + zend_throw_unwind_exit(); + } + HANDLE_EXCEPTION(); +} + +ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY) +{ + USE_OPLINE + + ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting)); + + if (!E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))) { + do { + /* Do not silence fatal errors */ + EG(error_reporting) &= E_FATAL_ERRORS; + if (!EG(error_reporting_ini_entry)) { + zval *zv = zend_hash_find_known_hash(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING)); + if (zv) { + EG(error_reporting_ini_entry) = (zend_ini_entry *)Z_PTR_P(zv); + } else { + break; + } + } + if (!EG(error_reporting_ini_entry)->modified) { + if (!EG(modified_ini_directives)) { + ALLOC_HASHTABLE(EG(modified_ini_directives)); + zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0); + } + if (EXPECTED(zend_hash_add_ptr(EG(modified_ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), EG(error_reporting_ini_entry)) != NULL)) { + EG(error_reporting_ini_entry)->orig_value = EG(error_reporting_ini_entry)->value; + EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable; + EG(error_reporting_ini_entry)->modified = 1; + } + } + } while (0); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY) +{ + USE_OPLINE + + if (E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting)) + && !E_HAS_ONLY_FATAL_ERRORS(Z_LVAL_P(EX_VAR(opline->op1.var)))) { + EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var)); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_CONST_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + bool ret; + + SAVE_OPLINE(); + value = GET_OP1_ZVAL_PTR(BP_VAR_R); + + if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && Z_ISREF_P(value)) { + if (OP1_TYPE == IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + ret = i_zend_is_true(value); + + if (UNEXPECTED(EG(exception))) { + FREE_OP1(); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (ret) { + zval *result = EX_VAR(opline->result.var); + + ZVAL_COPY_VALUE(result, value); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (OP1_TYPE == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if (OP1_TYPE == IS_VAR && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + FREE_OP1(); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_CONST_HANDLER(169, ZEND_COALESCE, CONST|TMP|VAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + + SAVE_OPLINE(); + value = GET_OP1_ZVAL_PTR(BP_VAR_IS); + + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + if (OP1_TYPE & IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { + zval *result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, value); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (OP1_TYPE == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if ((OP1_TYPE & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + if ((OP1_TYPE & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_NOCONST_HANDLER(198, ZEND_JMP_NULL, CONST|TMP|VAR|CV, JMP_ADDR) +{ + USE_OPLINE + zval *val, *result; + + val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (Z_TYPE_P(val) > IS_NULL) { + do { + if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + if (Z_TYPE_P(val) <= IS_NULL) { + FREE_OP1(); + break; + } + } + ZEND_VM_NEXT_OPCODE(); + } while (0); + } + + result = EX_VAR(opline->result.var); + uint32_t short_circuiting_type = opline->extended_value & ZEND_SHORT_CIRCUITING_CHAIN_MASK; + if (EXPECTED(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EXPR)) { + ZVAL_NULL(result); + if (OP1_TYPE == IS_CV + && UNEXPECTED(Z_TYPE_P(val) == IS_UNDEF) + && (opline->extended_value & ZEND_JMP_NULL_BP_VAR_IS) == 0 + ) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + } else if (short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_ISSET) { + ZVAL_FALSE(result); + } else { + ZEND_ASSERT(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EMPTY); + ZVAL_TRUE(result); + } + + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); +} + +ZEND_VM_HOT_HANDLER(31, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY) +{ + USE_OPLINE + zval *value; + zval *result = EX_VAR(opline->result.var); + + value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(result); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (OP1_TYPE == IS_CV) { + ZVAL_COPY_DEREF(result, value); + } else if (OP1_TYPE == IS_VAR) { + if (UNEXPECTED(Z_ISREF_P(value))) { + ZVAL_COPY_VALUE(result, Z_REFVAL_P(value)); + if (UNEXPECTED(Z_DELREF_P(value) == 0)) { + efree_size(Z_REF_P(value), sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } else { + ZVAL_COPY_VALUE(result, value); + } + } else { + ZVAL_COPY_VALUE(result, value); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) { + Z_ADDREF_P(result); + } + } + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_HANDLER(101, ZEND_EXT_STMT, ANY, ANY) +{ + USE_OPLINE + + if (!EG(no_extensions)) { + SAVE_OPLINE(); + zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, execute_data); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_HANDLER(102, ZEND_EXT_FCALL_BEGIN, ANY, ANY) +{ + USE_OPLINE + + if (!EG(no_extensions)) { + SAVE_OPLINE(); + zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, execute_data); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_HANDLER(103, ZEND_EXT_FCALL_END, ANY, ANY) +{ + USE_OPLINE + + if (!EG(no_extensions)) { + SAVE_OPLINE(); + zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, execute_data); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(144, ZEND_DECLARE_CLASS, CONST, ANY) +{ + USE_OPLINE + + SAVE_OPLINE(); + do_bind_class(RT_CONSTANT(opline, opline->op1), (OP2_TYPE == IS_CONST) ? Z_STR_P(RT_CONSTANT(opline, opline->op2)) : NULL); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(145, ZEND_DECLARE_CLASS_DELAYED, CONST, CONST) +{ + USE_OPLINE + + zend_class_entry *ce = CACHED_PTR(opline->extended_value); + if (ce == NULL) { + zval *lcname = RT_CONSTANT(opline, opline->op1); + zval *zv = zend_hash_find_known_hash(EG(class_table), Z_STR_P(lcname + 1)); + if (zv) { + SAVE_OPLINE(); + ce = zend_bind_class_in_slot(zv, lcname, Z_STR_P(RT_CONSTANT(opline, opline->op2))); + if (!ce) { + HANDLE_EXCEPTION(); + } + } + CACHE_PTR(opline->extended_value, ce); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(146, ZEND_DECLARE_ANON_CLASS, ANY, ANY, CACHE_SLOT) +{ + zval *zv; + zend_class_entry *ce; + USE_OPLINE + + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + zend_string *rtd_key = Z_STR_P(RT_CONSTANT(opline, opline->op1)); + zv = zend_hash_find_known_hash(EG(class_table), rtd_key); + ZEND_ASSERT(zv != NULL); + ce = Z_CE_P(zv); + if (!(ce->ce_flags & ZEND_ACC_LINKED)) { + SAVE_OPLINE(); + ce = zend_do_link_class(ce, (OP2_TYPE == IS_CONST) ? Z_STR_P(RT_CONSTANT(opline, opline->op2)) : NULL, rtd_key); + if (!ce) { + HANDLE_EXCEPTION(); + } + } + CACHE_PTR(opline->extended_value, ce); + } + Z_CE_P(EX_VAR(opline->result.var)) = ce; + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(141, ZEND_DECLARE_FUNCTION, ANY, NUM) +{ + zend_function *func; + USE_OPLINE + + SAVE_OPLINE(); + func = (zend_function *) EX(func)->op_array.dynamic_func_defs[opline->op2.num]; + do_bind_function(func, RT_CONSTANT(opline, opline->op1)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY, NUM) +{ + USE_OPLINE + + if ((uint32_t)++EG(ticks_count) >= opline->extended_value) { + EG(ticks_count) = 0; + if (zend_ticks_function) { + SAVE_OPLINE(); + zend_fiber_switch_block(); + zend_ticks_function(opline->extended_value); + zend_fiber_switch_unblock(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(138, ZEND_INSTANCEOF, TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR, CACHE_SLOT) +{ + USE_OPLINE + zval *expr; + bool result; + + SAVE_OPLINE(); + expr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + +ZEND_VM_C_LABEL(try_instanceof): + if (Z_TYPE_P(expr) == IS_OBJECT) { + zend_class_entry *ce; + + if (OP2_TYPE == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_lookup_class_ex(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD); + if (EXPECTED(ce)) { + CACHE_PTR(opline->extended_value, ce); + } + } + } else if (OP2_TYPE == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + FREE_OP1(); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + result = ce && instanceof_function(Z_OBJCE_P(expr), ce); + } else if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) { + expr = Z_REFVAL_P(expr); + ZEND_VM_C_GOTO(try_instanceof); + } else { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(expr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + result = 0; + } + FREE_OP1(); + ZEND_VM_SMART_BRANCH(result, 1); +} + +ZEND_VM_HOT_HANDLER(104, ZEND_EXT_NOP, ANY, ANY) +{ + USE_OPLINE + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_HANDLER(0, ZEND_NOP, ANY, ANY) +{ + USE_OPLINE + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HELPER(zend_dispatch_try_catch_finally_helper, ANY, ANY, uint32_t try_catch_offset, uint32_t op_num) +{ + /* May be NULL during generator closing (only finally blocks are executed) */ + zend_object *ex = EG(exception); + + /* Walk try/catch/finally structures upwards, performing the necessary actions */ + for (; try_catch_offset != (uint32_t) -1; try_catch_offset--) { + zend_try_catch_element *try_catch = + &EX(func)->op_array.try_catch_array[try_catch_offset]; + + if (op_num < try_catch->catch_op && ex) { + /* Go to catch block */ + cleanup_live_vars(execute_data, op_num, try_catch->catch_op); + ZEND_VM_JMP_EX(&EX(func)->op_array.opcodes[try_catch->catch_op], 0); + + } else if (op_num < try_catch->finally_op) { + if (ex && zend_is_unwind_exit(ex)) { + /* Don't execute finally blocks on exit (for now) */ + continue; + } + + /* Go to finally block */ + zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[try_catch->finally_end].op1.var); + cleanup_live_vars(execute_data, op_num, try_catch->finally_op); + Z_OBJ_P(fast_call) = EG(exception); + EG(exception) = NULL; + Z_OPLINE_NUM_P(fast_call) = (uint32_t)-1; + ZEND_VM_JMP_EX(&EX(func)->op_array.opcodes[try_catch->finally_op], 0); + + } else if (op_num < try_catch->finally_end) { + zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[try_catch->finally_end].op1.var); + + /* cleanup incomplete RETURN statement */ + if (Z_OPLINE_NUM_P(fast_call) != (uint32_t)-1 + && (EX(func)->op_array.opcodes[Z_OPLINE_NUM_P(fast_call)].op2_type & (IS_TMP_VAR | IS_VAR))) { + zval *return_value = EX_VAR(EX(func)->op_array.opcodes[Z_OPLINE_NUM_P(fast_call)].op2.var); + + zval_ptr_dtor(return_value); + } + + /* Chain potential exception from wrapping finally block */ + if (Z_OBJ_P(fast_call)) { + if (ex) { + if (zend_is_unwind_exit(ex) || zend_is_graceful_exit(ex)) { + /* discard the previously thrown exception */ + OBJ_RELEASE(Z_OBJ_P(fast_call)); + } else { + zend_exception_set_previous(ex, Z_OBJ_P(fast_call)); + } + } else { + ex = EG(exception) = Z_OBJ_P(fast_call); + } + } + } + } + + /* Uncaught exception */ + if (zend_observer_fcall_op_array_extension != -1) { + zend_observer_fcall_end(execute_data, NULL); + } + cleanup_live_vars(execute_data, op_num, 0); + if (UNEXPECTED((EX_CALL_INFO() & ZEND_CALL_GENERATOR) != 0)) { + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + EG(current_execute_data) = EX(prev_execute_data); + zend_generator_close(generator, 1); + ZEND_VM_RETURN(); + } else { + /* We didn't execute RETURN, and have to initialize return_value */ + if (EX(return_value)) { + ZVAL_UNDEF(EX(return_value)); + } + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); + } +} + +ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) +{ + const zend_op *throw_op = EG(opline_before_exception); + + /* Exception was thrown before executing any op */ + if (UNEXPECTED(!throw_op)) { + ZEND_VM_DISPATCH_TO_HELPER(zend_dispatch_try_catch_finally_helper, try_catch_offset, -1, 0, 0); + } + + uint32_t throw_op_num = throw_op - EX(func)->op_array.opcodes; + int i, current_try_catch_offset = -1; + + if ((throw_op->opcode == ZEND_FREE || throw_op->opcode == ZEND_FE_FREE) + && throw_op->extended_value & ZEND_FREE_ON_RETURN) { + /* exceptions thrown because of loop var destruction on return/break/... + * are logically thrown at the end of the foreach loop, so adjust the + * throw_op_num. + */ + const zend_live_range *range = find_live_range( + &EX(func)->op_array, throw_op_num, throw_op->op1.var); + /* free op1 of the corresponding RETURN */ + for (i = throw_op_num; i < range->end; i++) { + if (EX(func)->op_array.opcodes[i].opcode == ZEND_FREE + || EX(func)->op_array.opcodes[i].opcode == ZEND_FE_FREE) { + /* pass */ + } else { + if (EX(func)->op_array.opcodes[i].opcode == ZEND_RETURN + && (EX(func)->op_array.opcodes[i].op1_type & (IS_VAR|IS_TMP_VAR))) { + zval_ptr_dtor(EX_VAR(EX(func)->op_array.opcodes[i].op1.var)); + } + break; + } + } + throw_op_num = range->end; + } + + /* Find the innermost try/catch/finally the exception was thrown in */ + for (i = 0; i < EX(func)->op_array.last_try_catch; i++) { + zend_try_catch_element *try_catch = &EX(func)->op_array.try_catch_array[i]; + if (try_catch->try_op > throw_op_num) { + /* further blocks will not be relevant... */ + break; + } + if (throw_op_num < try_catch->catch_op || throw_op_num < try_catch->finally_end) { + current_try_catch_offset = i; + } + } + + cleanup_unfinished_calls(execute_data, throw_op_num); + + if (throw_op->result_type & (IS_VAR | IS_TMP_VAR)) { + switch (throw_op->opcode) { + case ZEND_ADD_ARRAY_ELEMENT: + case ZEND_ADD_ARRAY_UNPACK: + case ZEND_ROPE_INIT: + case ZEND_ROPE_ADD: + break; /* exception while building structures, live range handling will free those */ + + case ZEND_FETCH_CLASS: + case ZEND_DECLARE_ANON_CLASS: + break; /* return value is zend_class_entry pointer */ + + default: + /* smart branch opcodes may not initialize result */ + if (!zend_is_smart_branch(throw_op)) { + zval_ptr_dtor_nogc(EX_VAR(throw_op->result.var)); + } + } + } + + ZEND_VM_DISPATCH_TO_HELPER(zend_dispatch_try_catch_finally_helper, try_catch_offset, current_try_catch_offset, op_num, throw_op_num); +} + +ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY) +{ + USE_OPLINE + int ret; + + SAVE_OPLINE(); + ret = zend_user_opcode_handlers[opline->opcode](execute_data); + opline = EX(opline); + + switch (ret) { + case ZEND_USER_OPCODE_CONTINUE: + ZEND_VM_CONTINUE(); + case ZEND_USER_OPCODE_RETURN: + if (UNEXPECTED((EX_CALL_INFO() & ZEND_CALL_GENERATOR) != 0)) { + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + EG(current_execute_data) = EX(prev_execute_data); + zend_generator_close(generator, 1); + ZEND_VM_RETURN(); + } else { + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); + } + case ZEND_USER_OPCODE_ENTER: + ZEND_VM_ENTER(); + case ZEND_USER_OPCODE_LEAVE: + ZEND_VM_LEAVE(); + case ZEND_USER_OPCODE_DISPATCH: + ZEND_VM_DISPATCH(opline->opcode, opline); + default: + ZEND_VM_DISPATCH((uint8_t)(ret & 0xff), opline); + } +} + +ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST) +{ + USE_OPLINE + zval *name; + zval *val; + zend_constant c; + + SAVE_OPLINE(); + name = GET_OP1_ZVAL_PTR(BP_VAR_R); + val = GET_OP2_ZVAL_PTR(BP_VAR_R); + + ZVAL_COPY(&c.value, val); + if (Z_OPT_CONSTANT(c.value)) { + if (UNEXPECTED(zval_update_constant_ex(&c.value, EX(func)->op_array.scope) != SUCCESS)) { + zval_ptr_dtor_nogc(&c.value); + FREE_OP1(); + FREE_OP2(); + HANDLE_EXCEPTION(); + } + } + /* non persistent, case sensitive */ + ZEND_CONSTANT_SET_FLAGS(&c, 0, PHP_USER_CONSTANT); + c.name = zend_string_copy(Z_STR_P(name)); + + if (zend_register_constant(&c) == FAILURE) { + } + + FREE_OP1(); + FREE_OP2(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(142, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, NUM) +{ + USE_OPLINE + zend_function *func; + zval *object; + zend_class_entry *called_scope; + + func = (zend_function *) EX(func)->op_array.dynamic_func_defs[opline->op2.num]; + if (Z_TYPE(EX(This)) == IS_OBJECT) { + called_scope = Z_OBJCE(EX(This)); + if (UNEXPECTED((func->common.fn_flags & ZEND_ACC_STATIC) || + (EX(func)->common.fn_flags & ZEND_ACC_STATIC))) { + object = NULL; + } else { + object = &EX(This); + } + } else { + called_scope = Z_CE(EX(This)); + object = NULL; + } + SAVE_OPLINE(); + zend_create_closure(EX_VAR(opline->result.var), func, + EX(func)->op_array.scope, called_scope, object); + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(156, ZEND_SEPARATE, VAR, UNUSED) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + if (UNEXPECTED(Z_ISREF_P(var_ptr))) { + if (UNEXPECTED(Z_REFCOUNT_P(var_ptr) == 1)) { + ZVAL_UNREF(var_ptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_HELPER(zend_yield_in_closed_generator_helper, ANY, ANY) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot yield from finally in a force-closed generator"); + FREE_OP2(); + FREE_OP1(); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); +} + +ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMPVAR|CV|UNUSED, SRC) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_DISPATCH_TO_HELPER(zend_yield_in_closed_generator_helper); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (OP1_TYPE != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (OP1_TYPE & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = GET_OP1_ZVAL_PTR(BP_VAR_R); + ZVAL_COPY_VALUE(&generator->value, value); + if (OP1_TYPE == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (OP1_TYPE == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + FREE_OP1(); + } + } else { + zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R); + + /* Consts, temporary variables and references need copying */ + if (OP1_TYPE == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (OP1_TYPE == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + FREE_OP1_IF_VAR(); + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (OP1_TYPE == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (OP2_TYPE != IS_UNUSED) { + zval *key = GET_OP2_ZVAL_PTR(BP_VAR_R); + if ((OP2_TYPE & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + FREE_OP2(); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +ZEND_VM_HANDLER(166, ZEND_YIELD_FROM, CONST|TMPVAR|CV, ANY) +{ + USE_OPLINE + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + zval *val; + + SAVE_OPLINE(); + val = GET_OP1_ZVAL_PTR(BP_VAR_R); + + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator"); + FREE_OP1(); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + +ZEND_VM_C_LABEL(yield_from_try_again): + if (Z_TYPE_P(val) == IS_ARRAY) { + ZVAL_COPY_VALUE(&generator->values, val); + if (Z_OPT_REFCOUNTED_P(val)) { + Z_ADDREF_P(val); + } + Z_FE_POS(generator->values) = 0; + FREE_OP1(); + } else if (OP1_TYPE != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) { + zend_class_entry *ce = Z_OBJCE_P(val); + if (ce == zend_ce_generator) { + zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); + + Z_ADDREF_P(val); + FREE_OP1(); + + if (UNEXPECTED(new_gen->execute_data == NULL)) { + zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue"); + zval_ptr_dtor(val); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (Z_ISUNDEF(new_gen->retval)) { + if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) { + zend_throw_error(NULL, "Impossible to yield from the Generator being currently run"); + zval_ptr_dtor(val); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else { + zend_generator_yield_from(generator, new_gen); + } + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zend_object_iterator *iter = ce->get_iterator(ce, val, 0); + FREE_OP1(); + + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { + if (!EG(exception)) { + zend_throw_error(NULL, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + iter->index = 0; + if (iter->funcs->rewind) { + iter->funcs->rewind(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + OBJ_RELEASE(&iter->std); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + + ZVAL_OBJ(&generator->values, &iter->std); + } + } else if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + ZEND_VM_C_GOTO(yield_from_try_again); + } else { + zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables"); + FREE_OP1(); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ + if (RETURN_VALUE_USED(opline)) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + + /* This generator has no send target (though the generator we delegate to might have one) */ + generator->send_target = NULL; + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +ZEND_VM_HANDLER(159, ZEND_DISCARD_EXCEPTION, ANY, ANY) +{ + USE_OPLINE + zval *fast_call = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + + /* cleanup incomplete RETURN statement */ + if (Z_OPLINE_NUM_P(fast_call) != (uint32_t)-1 + && (EX(func)->op_array.opcodes[Z_OPLINE_NUM_P(fast_call)].op2_type & (IS_TMP_VAR | IS_VAR))) { + zval *return_value = EX_VAR(EX(func)->op_array.opcodes[Z_OPLINE_NUM_P(fast_call)].op2.var); + + zval_ptr_dtor(return_value); + } + + /* cleanup delayed exception */ + if (Z_OBJ_P(fast_call) != NULL) { + /* discard the previously thrown exception */ + OBJ_RELEASE(Z_OBJ_P(fast_call)); + Z_OBJ_P(fast_call) = NULL; + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(162, ZEND_FAST_CALL, JMP_ADDR, ANY) +{ + USE_OPLINE + zval *fast_call = EX_VAR(opline->result.var); + + Z_OBJ_P(fast_call) = NULL; + /* set return address */ + Z_OPLINE_NUM_P(fast_call) = opline - EX(func)->op_array.opcodes; + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op1), 0); +} + +ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, TRY_CATCH) +{ + USE_OPLINE + zval *fast_call = EX_VAR(opline->op1.var); + uint32_t current_try_catch_offset, current_op_num; + + if (Z_OPLINE_NUM_P(fast_call) != (uint32_t)-1) { + const zend_op *fast_ret = EX(func)->op_array.opcodes + Z_OPLINE_NUM_P(fast_call); + + ZEND_VM_JMP_EX(fast_ret + 1, 0); + } + + /* special case for unhandled exceptions */ + EG(exception) = Z_OBJ_P(fast_call); + Z_OBJ_P(fast_call) = NULL; + current_try_catch_offset = opline->op2.num; + current_op_num = opline - EX(func)->op_array.opcodes; + ZEND_VM_DISPATCH_TO_HELPER(zend_dispatch_try_catch_finally_helper, try_catch_offset, current_try_catch_offset, op_num, current_op_num); +} + +ZEND_VM_HOT_HANDLER(168, ZEND_BIND_GLOBAL, CV, CONST, CACHE_SLOT) +{ + USE_OPLINE + zend_string *varname; + zval *value; + zval *variable_ptr; + uintptr_t idx; + zend_reference *ref; + + ZEND_VM_REPEATABLE_OPCODE + + varname = Z_STR_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + + /* We store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */ + idx = (uintptr_t)CACHED_PTR(opline->extended_value) - 1; + if (EXPECTED(idx < EG(symbol_table).nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)EG(symbol_table).arData + idx); + + if (EXPECTED(p->key == varname) || + (EXPECTED(p->h == ZSTR_H(varname)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, varname)))) { + + value = (zval*)p; /* value = &p->val; */ + ZEND_VM_C_GOTO(check_indirect); + } + } + + value = zend_hash_find_known_hash(&EG(symbol_table), varname); + if (UNEXPECTED(value == NULL)) { + value = zend_hash_add_new(&EG(symbol_table), varname, &EG(uninitialized_zval)); + idx = (char*)value - (char*)EG(symbol_table).arData; + /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */ + CACHE_PTR(opline->extended_value, (void*)(idx + 1)); + } else { + idx = (char*)value - (char*)EG(symbol_table).arData; + /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */ + CACHE_PTR(opline->extended_value, (void*)(idx + 1)); +ZEND_VM_C_LABEL(check_indirect): + /* GLOBAL variable may be an INDIRECT pointer to CV */ + if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_NULL(value); + } + } + } + + if (UNEXPECTED(!Z_ISREF_P(value))) { + ZVAL_MAKE_REF_EX(value, 2); + ref = Z_REF_P(value); + } else { + ref = Z_REF_P(value); + GC_ADDREF(ref); + } + + variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + + if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) { + zend_refcounted *garbage = Z_COUNTED_P(variable_ptr); + + ZVAL_REF(variable_ptr, ref); + SAVE_OPLINE(); + if (GC_DELREF(garbage) == 0) { + rc_dtor_func(garbage); + if (UNEXPECTED(EG(exception))) { + ZVAL_NULL(variable_ptr); + HANDLE_EXCEPTION(); + } + } else { + gc_check_possible_root(garbage); + } + } else { + ZVAL_REF(variable_ptr, ref); + } + + ZEND_VM_REPEAT_OPCODE(ZEND_BIND_GLOBAL); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_CONST_HANDLER(121, ZEND_STRLEN, CONST|TMPVAR|CV, ANY) +{ + USE_OPLINE + zval *value; + + value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value)); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(value); + } + ZEND_VM_NEXT_OPCODE(); + } else { + bool strict; + + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) { + value = Z_REFVAL_P(value); + if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value)); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + value = ZVAL_UNDEFINED_OP1(); + } + strict = EX_USES_STRICT_TYPES(); + do { + if (EXPECTED(!strict)) { + zend_string *str; + zval tmp; + + if (UNEXPECTED(Z_TYPE_P(value) == IS_NULL)) { + zend_error(E_DEPRECATED, + "strlen(): Passing null to parameter #1 ($string) of type string is deprecated"); + ZVAL_LONG(EX_VAR(opline->result.var), 0); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + break; + } + + ZVAL_COPY(&tmp, value); + if (zend_parse_arg_str_weak(&tmp, &str, 1)) { + ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str)); + zval_ptr_dtor(&tmp); + break; + } + zval_ptr_dtor(&tmp); + } + if (!EG(exception)) { + zend_type_error("strlen(): Argument #1 ($string) must be of type string, %s given", zend_zval_value_name(value)); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } while (0); + } + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_NOCONST_HANDLER(123, ZEND_TYPE_CHECK, CONST|TMPVAR|CV, ANY, TYPE_MASK) +{ + USE_OPLINE + zval *value; + int result = 0; + + value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if ((opline->extended_value >> (uint32_t)Z_TYPE_P(value)) & 1) { +ZEND_VM_C_LABEL(type_check_resource): + if (opline->extended_value != MAY_BE_RESOURCE + || EXPECTED(NULL != zend_rsrc_list_get_rsrc_type(Z_RES_P(value)))) { + result = 1; + } + } else if ((OP1_TYPE & (IS_CV|IS_VAR)) && Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + if ((opline->extended_value >> (uint32_t)Z_TYPE_P(value)) & 1) { + ZEND_VM_C_GOTO(type_check_resource); + } + } else if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + result = ((1 << IS_NULL) & opline->extended_value) != 0; + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + FREE_OP1(); + ZEND_VM_SMART_BRANCH(result, 1); + } else { + ZEND_VM_SMART_BRANCH(result, 0); + } +} + +ZEND_VM_HOT_HANDLER(122, ZEND_DEFINED, CONST, ANY, CACHE_SLOT) +{ + USE_OPLINE + zend_constant *c; + + c = CACHED_PTR(opline->extended_value); + if (EXPECTED(c != NULL)) { + if (!IS_SPECIAL_CACHE_VAL(c)) { +ZEND_VM_C_LABEL(defined_true): + ZEND_VM_SMART_BRANCH_TRUE(); + } else if (EXPECTED(zend_hash_num_elements(EG(zend_constants)) == DECODE_SPECIAL_CACHE_NUM(c))) { +ZEND_VM_C_LABEL(defined_false): + ZEND_VM_SMART_BRANCH_FALSE(); + } + } + if (zend_quick_check_constant(RT_CONSTANT(opline, opline->op1) OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + CACHE_PTR(opline->extended_value, ENCODE_SPECIAL_CACHE_NUM(zend_hash_num_elements(EG(zend_constants)))); + ZEND_VM_C_GOTO(defined_false); + } else { + ZEND_VM_C_GOTO(defined_true); + } +} + +ZEND_VM_HANDLER(151, ZEND_ASSERT_CHECK, ANY, JMP_ADDR) +{ + USE_OPLINE + + if (EG(assertions) <= 0) { + zend_op *target = OP_JMP_ADDR(opline, opline->op2); + if (RETURN_VALUE_USED(opline)) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } + ZEND_VM_JMP_EX(target, 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } +} + +ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, CV|TMPVAR|UNUSED|CLASS_FETCH, ANY) +{ + uint32_t fetch_type; + zend_class_entry *called_scope, *scope; + USE_OPLINE + + if (OP1_TYPE != IS_UNUSED) { + SAVE_OPLINE(); + zval *op = GET_OP1_ZVAL_PTR(BP_VAR_R); + if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_OBJECT) { + zend_type_error("Cannot use \"::class\" on %s", zend_zval_value_name(op)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP1(); + HANDLE_EXCEPTION(); + } + } + + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op)->name); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + fetch_type = opline->op1.num; + scope = EX(func)->op_array.scope; + if (UNEXPECTED(scope == NULL)) { + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot use \"%s\" in the global scope", + fetch_type == ZEND_FETCH_CLASS_SELF ? "self" : + fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + switch (fetch_type) { + case ZEND_FETCH_CLASS_SELF: + ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->name); + break; + case ZEND_FETCH_CLASS_PARENT: + if (UNEXPECTED(scope->parent == NULL)) { + SAVE_OPLINE(); + zend_throw_error(NULL, + "Cannot use \"parent\" when current class scope has no parent"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->parent->name); + break; + case ZEND_FETCH_CLASS_STATIC: + if (Z_TYPE(EX(This)) == IS_OBJECT) { + called_scope = Z_OBJCE(EX(This)); + } else { + called_scope = Z_CE(EX(This)); + } + ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); + break; + EMPTY_SWITCH_DEFAULT_CASE() + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY, SPEC(OBSERVER)) +{ + zend_array *args = NULL; + zend_function *fbc = EX(func); + zval *ret = EX(return_value); + uint32_t call_info = EX_CALL_INFO() & (ZEND_CALL_NESTED | ZEND_CALL_TOP | ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_EXTRA_NAMED_PARAMS); + uint32_t num_args = EX_NUM_ARGS(); + zend_execute_data *call; + + SAVE_OPLINE(); + + if (num_args) { + zval *p = ZEND_CALL_ARG(execute_data, 1); + zval *end = p + num_args; + + args = zend_new_array(num_args); + zend_hash_real_init_packed(args); + ZEND_HASH_FILL_PACKED(args) { + do { + ZEND_HASH_FILL_ADD(p); + p++; + } while (p != end); + } ZEND_HASH_FILL_END(); + } + + call = execute_data; + execute_data = EG(current_execute_data) = EX(prev_execute_data); + + call->func = (fbc->op_array.fn_flags & ZEND_ACC_STATIC) ? fbc->op_array.scope->__callstatic : fbc->op_array.scope->__call; + ZEND_ASSERT(zend_vm_calc_used_stack(2, call->func) <= (size_t)(((char*)EG(vm_stack_end)) - (char*)call)); + ZEND_CALL_NUM_ARGS(call) = 2; + + ZVAL_STR(ZEND_CALL_ARG(call, 1), fbc->common.function_name); + + zval *call_args = ZEND_CALL_ARG(call, 2); + if (args) { + ZVAL_ARR(call_args, args); + } else { + ZVAL_EMPTY_ARRAY(call_args); + } + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + if (zend_hash_num_elements(Z_ARRVAL_P(call_args)) == 0) { + GC_ADDREF(call->extra_named_params); + ZVAL_ARR(call_args, call->extra_named_params); + } else { + SEPARATE_ARRAY(call_args); + zend_hash_copy(Z_ARRVAL_P(call_args), call->extra_named_params, zval_add_ref); + } + } + zend_free_trampoline(fbc); + fbc = call->func; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + if (UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + if (EXPECTED(zend_execute_ex == execute_ex)) { + LOAD_OPLINE_EX(); + ZEND_OBSERVER_SAVE_OPLINE(); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); + ZEND_VM_ENTER_EX(); + } else { + SAVE_OPLINE_EX(); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); + execute_data = EX(prev_execute_data); + if (execute_data) { + LOAD_OPLINE(); + } + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } + } else { + zval retval; + + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + if (ret == NULL) { + ret = &retval; + } + + ZVAL_NULL(ret); + ZEND_OBSERVER_FCALL_BEGIN(call); + if (!zend_execute_internal) { + /* saves one function call if zend_execute_internal is not used */ + fbc->internal_function.handler(call, ret); + } else { + zend_execute_internal(call, ret); + } + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret); + + EG(current_execute_data) = call->prev_execute_data; + + zend_vm_stack_free_args(call); + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(call->extra_named_params); + } + if (ret == &retval) { + zval_ptr_dtor(ret); + } + } + + execute_data = EG(current_execute_data); + + if (!execute_data || !EX(func) || !ZEND_USER_CODE(EX(func)->type) || (call_info & ZEND_CALL_TOP)) { + ZEND_VM_RETURN(); + } + + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + zend_object *object = Z_OBJ(call->This); + OBJ_RELEASE(object); + } + zend_vm_stack_free_call_frame(call); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_OPLINE(); + ZEND_VM_INC_OPCODE(); + ZEND_VM_LEAVE(); +} + +ZEND_VM_HANDLER(182, ZEND_BIND_LEXICAL, TMP, CV, REF) +{ + USE_OPLINE + zval *closure, *var; + + closure = GET_OP1_ZVAL_PTR(BP_VAR_R); + if (opline->extended_value & ZEND_BIND_REF) { + /* By-ref binding */ + var = GET_OP2_ZVAL_PTR(BP_VAR_W); + if (Z_ISREF_P(var)) { + Z_ADDREF_P(var); + } else { + ZVAL_MAKE_REF_EX(var, 2); + } + } else { + var = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (UNEXPECTED(Z_ISUNDEF_P(var)) && !(opline->extended_value & ZEND_BIND_IMPLICIT)) { + SAVE_OPLINE(); + var = ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZVAL_DEREF(var); + Z_TRY_ADDREF_P(var); + } + + zend_closure_bind_var_ex(closure, + (opline->extended_value & ~(ZEND_BIND_REF|ZEND_BIND_IMPLICIT)), var); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(183, ZEND_BIND_STATIC, CV, ANY, REF) +{ + USE_OPLINE + HashTable *ht; + zval *value; + zval *variable_ptr; + + variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + + SAVE_OPLINE(); + + ht = ZEND_MAP_PTR_GET(EX(func)->op_array.static_variables_ptr); + if (!ht) { + ht = zend_array_dup(EX(func)->op_array.static_variables); + ZEND_MAP_PTR_SET(EX(func)->op_array.static_variables_ptr, ht); + } + ZEND_ASSERT(GC_REFCOUNT(ht) == 1); + + value = (zval*)((char*)ht->arData + (opline->extended_value & ~(ZEND_BIND_REF|ZEND_BIND_IMPLICIT|ZEND_BIND_EXPLICIT))); + + if (opline->extended_value & ZEND_BIND_REF) { + i_zval_ptr_dtor(variable_ptr); + if (UNEXPECTED(!Z_ISREF_P(value))) { + zend_reference *ref = (zend_reference*)emalloc(sizeof(zend_reference)); + GC_SET_REFCOUNT(ref, 2); + GC_TYPE_INFO(ref) = GC_REFERENCE; + if (OP2_TYPE == IS_UNUSED) { + ZVAL_COPY_VALUE(&ref->val, value); + } else { + ZEND_ASSERT(!Z_REFCOUNTED_P(value)); + ZVAL_COPY(&ref->val, GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R)); + FREE_OP2(); + } + ref->sources.ptr = NULL; + Z_REF_P(value) = ref; + Z_TYPE_INFO_P(value) = IS_REFERENCE_EX; + ZVAL_REF(variable_ptr, ref); + } else { + Z_ADDREF_P(value); + ZVAL_REF(variable_ptr, Z_REF_P(value)); + if (OP2_TYPE != IS_UNUSED) { + FREE_OP2(); + } + } + } else { + i_zval_ptr_dtor(variable_ptr); + ZVAL_COPY(variable_ptr, value); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(203, ZEND_BIND_INIT_STATIC_OR_JMP, CV, JMP_ADDR) +{ + USE_OPLINE + HashTable *ht; + zval *value; + zval *variable_ptr; + + variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); + + ht = ZEND_MAP_PTR_GET(EX(func)->op_array.static_variables_ptr); + if (!ht) { + ZEND_VM_NEXT_OPCODE(); + } + ZEND_ASSERT(GC_REFCOUNT(ht) == 1); + + value = (zval*)((char*)ht->arData + opline->extended_value); + if (Z_TYPE_EXTRA_P(value) & IS_STATIC_VAR_UNINITIALIZED) { + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + zval_ptr_dtor(variable_ptr); + ZEND_ASSERT(Z_TYPE_P(value) == IS_REFERENCE); + Z_ADDREF_P(value); + ZVAL_REF(variable_ptr, Z_REF_P(value)); + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 1); + } +} + +ZEND_VM_HOT_HANDLER(184, ZEND_FETCH_THIS, UNUSED, UNUSED) +{ + USE_OPLINE + + if (EXPECTED(Z_TYPE(EX(This)) == IS_OBJECT)) { + zval *result = EX_VAR(opline->result.var); + + ZVAL_OBJ(result, Z_OBJ(EX(This))); + Z_ADDREF_P(result); + ZEND_VM_NEXT_OPCODE(); + } else { + ZEND_VM_DISPATCH_TO_HELPER(zend_this_not_in_object_context_helper); + } +} + +ZEND_VM_HANDLER(200, ZEND_FETCH_GLOBALS, UNUSED, UNUSED) +{ + USE_OPLINE + + /* For symbol tables we need to deal with exactly the same problems as for property tables. */ + ZVAL_ARR(EX_VAR(opline->result.var), + zend_proptable_to_symtable(&EG(symbol_table), /* always_duplicate */ 1)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(186, ZEND_ISSET_ISEMPTY_THIS, UNUSED, UNUSED) +{ + USE_OPLINE + + ZVAL_BOOL(EX_VAR(opline->result.var), + (opline->extended_value & ZEND_ISEMPTY) ^ + (Z_TYPE(EX(This)) == IS_OBJECT)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(49, ZEND_CHECK_VAR, CV, UNUSED) +{ + USE_OPLINE + zval *op1 = EX_VAR(opline->op1.var); + + if (UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(140, ZEND_MAKE_REF, VAR|CV, UNUSED) +{ + USE_OPLINE + zval *op1 = EX_VAR(opline->op1.var); + + if (OP1_TYPE == IS_CV) { + if (UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_NEW_EMPTY_REF(op1); + Z_SET_REFCOUNT_P(op1, 2); + ZVAL_NULL(Z_REFVAL_P(op1)); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } else { + if (Z_ISREF_P(op1)) { + Z_ADDREF_P(op1); + } else { + ZVAL_MAKE_REF_EX(op1, 2); + } + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_INDIRECT)) { + op1 = Z_INDIRECT_P(op1); + if (EXPECTED(!Z_ISREF_P(op1))) { + ZVAL_MAKE_REF_EX(op1, 2); + } else { + GC_ADDREF(Z_REF_P(op1)); + } + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } else { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), op1); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(187, ZEND_SWITCH_LONG, CONST|TMPVARCV, CONST, JMP_ADDR) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (Z_TYPE_P(op) != IS_LONG) { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_LONG) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } + } + + jumptable = Z_ARRVAL_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(op)); + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(188, ZEND_SWITCH_STRING, CONST|TMPVARCV, CONST, JMP_ADDR) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + if (Z_TYPE_P(op) != IS_STRING) { + if (OP1_TYPE == IS_CONST) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } else { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_STRING) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } + } + } + + jumptable = Z_ARRVAL_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(op), OP1_TYPE == IS_CONST); + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(195, ZEND_MATCH, CONST|TMPVARCV, CONST, JMP_ADDR) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + jumptable = Z_ARRVAL_P(GET_OP2_ZVAL_PTR(BP_VAR_R)); + +ZEND_VM_C_LABEL(match_try_again): + if (Z_TYPE_P(op) == IS_LONG) { + jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(op)); + } else if (Z_TYPE_P(op) == IS_STRING) { + jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(op), OP1_TYPE == IS_CONST); + } else if (Z_TYPE_P(op) == IS_REFERENCE) { + op = Z_REFVAL_P(op); + ZEND_VM_C_GOTO(match_try_again); + } else { + if (UNEXPECTED((OP1_TYPE & IS_CV) && Z_TYPE_P(op) == IS_UNDEF)) { + SAVE_OPLINE(); + op = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZEND_VM_C_GOTO(match_try_again); + } + + ZEND_VM_C_GOTO(default_branch); + } + + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { +ZEND_VM_C_LABEL(default_branch): + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +ZEND_VM_COLD_CONST_HANDLER(197, ZEND_MATCH_ERROR, CONST|TMPVARCV, UNUSED) +{ + USE_OPLINE + zval *op; + + SAVE_OPLINE(); + op = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + zend_match_unhandled_error(op); + HANDLE_EXCEPTION(); +} + +ZEND_VM_COLD_CONSTCONST_HANDLER(189, ZEND_IN_ARRAY, CONST|TMP|VAR|CV, CONST, NUM) +{ + USE_OPLINE + zval *op1; + HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + zval *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find_ex(ht, Z_STR_P(op1), OP1_TYPE == IS_CONST); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + ZEND_VM_SMART_BRANCH(result, 0); + } + + if (opline->extended_value) { + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + ZEND_VM_SMART_BRANCH(result, 0); + } + SAVE_OPLINE(); + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + FREE_OP1(); + ZEND_VM_SMART_BRANCH(result, 0); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + FREE_OP1(); + ZEND_VM_SMART_BRANCH(result, 0); + } + } else if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + } else if (Z_TYPE_P(op1) <= IS_FALSE) { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC()); + ZEND_VM_SMART_BRANCH(result, 0); + } else { + zend_string *key; + zval key_tmp; + + if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + FREE_OP1(); + ZEND_VM_SMART_BRANCH(result, 0); + } + } + + SAVE_OPLINE(); + ZEND_HASH_MAP_FOREACH_STR_KEY(ht, key) { + ZVAL_STR(&key_tmp, key); + if (zend_compare(op1, &key_tmp) == 0) { + FREE_OP1(); + ZEND_VM_SMART_BRANCH(1, 1); + } + } ZEND_HASH_FOREACH_END(); + } + FREE_OP1(); + ZEND_VM_SMART_BRANCH(0, 1); +} + +ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED) +{ + USE_OPLINE + zval *op1; + zend_long count; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + + while (1) { + if (Z_TYPE_P(op1) == IS_ARRAY) { + count = zend_hash_num_elements(Z_ARRVAL_P(op1)); + break; + } else if (Z_TYPE_P(op1) == IS_OBJECT) { + zend_object *zobj = Z_OBJ_P(op1); + + /* first, we check if the handler is defined */ + if (zobj->handlers->count_elements) { + if (SUCCESS == zobj->handlers->count_elements(zobj, &count)) { + break; + } + if (UNEXPECTED(EG(exception))) { + count = 0; + break; + } + } + + /* if not and the object implements Countable we call its count() method */ + if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) { + zval retval; + + zend_function *count_fn = zend_hash_find_ptr(&zobj->ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); + zend_call_known_instance_method_with_0_params(count_fn, zobj, &retval); + count = zval_get_long(&retval); + zval_ptr_dtor(&retval); + break; + } + + /* If There's no handler and it doesn't implement Countable then emit a TypeError */ + } else if ((OP1_TYPE & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + count = 0; + zend_type_error("%s(): Argument #1 ($value) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_value_name(op1)); + break; + } + + ZVAL_LONG(EX_VAR(opline->result.var), count); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_TYPE_SPEC_HANDLER(ZEND_COUNT, (op1_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == MAY_BE_ARRAY, ZEND_COUNT_ARRAY, CV|TMPVAR, UNUSED) +{ + USE_OPLINE + zend_array *ht = Z_ARRVAL_P(GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R)); + ZVAL_LONG(EX_VAR(opline->result.var), zend_hash_num_elements(ht)); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR) && !(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + SAVE_OPLINE(); + zend_array_destroy(ht); + if (EG(exception)) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_CONST_HANDLER(191, ZEND_GET_CLASS, UNUSED|CONST|TMPVAR|CV, UNUSED) +{ + USE_OPLINE + + if (OP1_TYPE == IS_UNUSED) { + SAVE_OPLINE(); + if (UNEXPECTED(!EX(func)->common.scope)) { + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } else { + zend_error(E_DEPRECATED, "Calling get_class() without arguments is deprecated"); + ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zval *op1; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + while (1) { + if (Z_TYPE_P(op1) == IS_OBJECT) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op1)->name); + } else if ((OP1_TYPE & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else { + if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_value_name(op1)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } + break; + } + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +ZEND_VM_HANDLER(192, ZEND_GET_CALLED_CLASS, UNUSED, UNUSED) +{ + USE_OPLINE + + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE(EX(This))->name); + } else if (Z_CE(EX(This))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_CE(EX(This))->name); + } else { + ZEND_ASSERT(!EX(func)->common.scope); + SAVE_OPLINE(); + zend_throw_error(NULL, "get_called_class() must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_COLD_CONST_HANDLER(193, ZEND_GET_TYPE, CONST|TMP|VAR|CV, UNUSED) +{ + USE_OPLINE + zval *op1; + zend_string *type; + + SAVE_OPLINE(); + op1 = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R); + type = zend_zval_get_legacy_type(op1); + if (EXPECTED(type)) { + ZVAL_INTERNED_STR(EX_VAR(opline->result.var), type); + } else { + ZVAL_STRING(EX_VAR(opline->result.var), "unknown type"); + } + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HANDLER(171, ZEND_FUNC_NUM_ARGS, UNUSED, UNUSED) +{ + USE_OPLINE + + ZVAL_LONG(EX_VAR(opline->result.var), EX_NUM_ARGS()); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(172, ZEND_FUNC_GET_ARGS, UNUSED|CONST, UNUSED) +{ + USE_OPLINE + zend_array *ht; + uint32_t arg_count, result_size, skip; + + arg_count = EX_NUM_ARGS(); + if (OP1_TYPE == IS_CONST) { + skip = Z_LVAL_P(RT_CONSTANT(opline, opline->op1)); + if (arg_count < skip) { + result_size = 0; + } else { + result_size = arg_count - skip; + } + } else { + skip = 0; + result_size = arg_count; + } + + if (result_size) { + SAVE_OPLINE(); + uint32_t first_extra_arg = EX(func)->op_array.num_args; + + ht = zend_new_array(result_size); + ZVAL_ARR(EX_VAR(opline->result.var), ht); + zend_hash_real_init_packed(ht); + ZEND_HASH_FILL_PACKED(ht) { + zval *p, *q; + uint32_t i = skip; + p = EX_VAR_NUM(i); + if (arg_count > first_extra_arg) { + while (i < first_extra_arg) { + q = p; + if (EXPECTED(Z_TYPE_INFO_P(q) != IS_UNDEF)) { + ZVAL_DEREF(q); + if (Z_OPT_REFCOUNTED_P(q)) { + Z_ADDREF_P(q); + } + ZEND_HASH_FILL_SET(q); + } else { + ZEND_HASH_FILL_SET_NULL(); + } + ZEND_HASH_FILL_NEXT(); + p++; + i++; + } + if (skip < first_extra_arg) { + skip = 0; + } else { + skip -= first_extra_arg; + } + p = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T + skip); + } + while (i < arg_count) { + q = p; + if (EXPECTED(Z_TYPE_INFO_P(q) != IS_UNDEF)) { + ZVAL_DEREF(q); + if (Z_OPT_REFCOUNTED_P(q)) { + Z_ADDREF_P(q); + } + ZEND_HASH_FILL_SET(q); + } else { + ZEND_HASH_FILL_SET_NULL(); + } + ZEND_HASH_FILL_NEXT(); + p++; + i++; + } + } ZEND_HASH_FILL_END(); + ht->nNumOfElements = result_size; + } else { + ZVAL_EMPTY_ARRAY(EX_VAR(opline->result.var)); + } + ZEND_VM_NEXT_OPCODE(); +} + +/* Contrary to what its name indicates, ZEND_COPY_TMP may receive and define references. */ +ZEND_VM_HANDLER(167, ZEND_COPY_TMP, TMPVAR, UNUSED) +{ + USE_OPLINE + zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R); + zval *result = EX_VAR(opline->result.var); + ZVAL_COPY(result, value); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(202, ZEND_CALLABLE_CONVERT, UNUSED, UNUSED) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + + zend_closure_from_frame(EX_VAR(opline->result.var), call); + + if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { + OBJ_RELEASE(Z_OBJ(call->This)); + } + + EX(call) = call->prev_execute_data; + + zend_vm_stack_free_call_frame(call); + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_JMP, (OP_JMP_ADDR(op, op->op1) > op), ZEND_JMP_FORWARD, JMP_ADDR, ANY) +{ + USE_OPLINE + + OPLINE = OP_JMP_ADDR(opline, opline->op1); + ZEND_VM_CONTINUE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_ADD, (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_ADD_LONG_NO_OVERFLOW, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) + Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_ADD, (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_ADD_LONG, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + fast_long_add_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_ADD, (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE), ZEND_ADD_DOUBLE, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_SUB, (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_SUB_LONG_NO_OVERFLOW, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST)) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) - Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_SUB, (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_SUB_LONG, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST)) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_SUB, (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE), ZEND_SUB_DOUBLE, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST)) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_MUL, (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_MUL_LONG_NO_OVERFLOW, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) * Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_MUL, (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_MUL_LONG, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2, *result; + zend_long overflow; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow); + Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG; + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_MUL, (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE), ZEND_MUL_DOUBLE, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_EQUAL|ZEND_IS_IDENTICAL, (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_IS_EQUAL_LONG, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH,NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_EQUAL|ZEND_IS_IDENTICAL, (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE), ZEND_IS_EQUAL_DOUBLE, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH,NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_NOT_EQUAL|ZEND_IS_NOT_IDENTICAL, (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_IS_NOT_EQUAL_LONG, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH,NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = (Z_LVAL_P(op1) != Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_NOT_EQUAL|ZEND_IS_NOT_IDENTICAL, (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE), ZEND_IS_NOT_EQUAL_DOUBLE, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH,NO_CONST_CONST,COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = (Z_DVAL_P(op1) != Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_TYPE_SPEC_HANDLER(ZEND_IS_IDENTICAL, op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF)), ZEND_IS_IDENTICAL_NOTHROW, CV, CONST|CV, SPEC(COMMUTATIVE)) +{ + /* This is declared below the specializations for MAY_BE_LONG/MAY_BE_DOUBLE so those will be used instead if possible. */ + /* This optimizes $x === SOME_CONST_EXPR and $x === $y for non-refs and non-undef, which can't throw. */ + /* (Infinite recursion when comparing arrays is an uncatchable fatal error) */ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = fast_is_identical_function(op1, op2); + /* Free is a no-op for const/cv */ + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_TYPE_SPEC_HANDLER(ZEND_IS_NOT_IDENTICAL, op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF)), ZEND_IS_NOT_IDENTICAL_NOTHROW, CV, CONST|CV, SPEC(COMMUTATIVE)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = fast_is_identical_function(op1, op2); + /* Free is a no-op for const/cv */ + ZEND_VM_SMART_BRANCH(!result, 0); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER, (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_IS_SMALLER_LONG, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH,NO_CONST_CONST)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER, (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE), ZEND_IS_SMALLER_DOUBLE, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH,NO_CONST_CONST)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER_OR_EQUAL, (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_IS_SMALLER_OR_EQUAL_LONG, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH,NO_CONST_CONST)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER_OR_EQUAL, (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE), ZEND_IS_SMALLER_OR_EQUAL_DOUBLE, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(SMART_BRANCH,NO_CONST_CONST)) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH(result, 0); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_PRE_INC, (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG), ZEND_PRE_INC_LONG_NO_OVERFLOW, CV, ANY, SPEC(RETVAL)) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + Z_LVAL_P(var_ptr)++; + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_PRE_INC, (op1_info == MAY_BE_LONG), ZEND_PRE_INC_LONG, CV, ANY, SPEC(RETVAL)) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + fast_long_increment_function(var_ptr); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_PRE_DEC, (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG), ZEND_PRE_DEC_LONG_NO_OVERFLOW, CV, ANY, SPEC(RETVAL)) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + Z_LVAL_P(var_ptr)--; + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_PRE_DEC, (op1_info == MAY_BE_LONG), ZEND_PRE_DEC_LONG, CV, ANY, SPEC(RETVAL)) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + fast_long_decrement_function(var_ptr); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_POST_INC, (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG), ZEND_POST_INC_LONG_NO_OVERFLOW, CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + Z_LVAL_P(var_ptr)++; + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_POST_INC, (op1_info == MAY_BE_LONG), ZEND_POST_INC_LONG, CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_increment_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_POST_DEC, (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG), ZEND_POST_DEC_LONG_NO_OVERFLOW, CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + Z_LVAL_P(var_ptr)--; + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_POST_DEC, (op1_info == MAY_BE_LONG), ZEND_POST_DEC_LONG, CV, ANY) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_decrement_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_QM_ASSIGN, (op1_info == MAY_BE_LONG), ZEND_QM_ASSIGN_LONG, CONST|TMPVARCV, ANY) +{ + USE_OPLINE + zval *value; + + value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(value)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_QM_ASSIGN, (op1_info == MAY_BE_DOUBLE), ZEND_QM_ASSIGN_DOUBLE, CONST|TMPVARCV, ANY) +{ + USE_OPLINE + zval *value; + + value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + ZVAL_DOUBLE(EX_VAR(opline->result.var), Z_DVAL_P(value)); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_QM_ASSIGN, ((op->op1_type == IS_CONST) ? !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1)) : (!(op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE))))), ZEND_QM_ASSIGN_NOREF, CONST|TMPVARCV, ANY) +{ + USE_OPLINE + zval *value; + + value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_FETCH_DIM_R, (!(op2_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))), ZEND_FETCH_DIM_R_INDEX, CONST|TMPVAR|CV, CONST|TMPVARCV, SPEC(NO_CONST_CONST)) +{ + USE_OPLINE + zval *container, *dim, *value; + zend_long offset; + HashTable *ht; + + container = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + dim = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +ZEND_VM_C_LABEL(fetch_dim_r_index_array): + if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) { + offset = Z_LVAL_P(dim); + } else { + SAVE_OPLINE(); + zend_fetch_dimension_address_read_R(container, dim, OP2_TYPE OPLINE_CC EXECUTE_DATA_CC); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ht = Z_ARRVAL_P(container); + ZEND_HASH_INDEX_FIND(ht, offset, value, ZEND_VM_C_LABEL(fetch_dim_r_index_undef)); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + ZEND_VM_C_GOTO(fetch_dim_r_index_array); + } else { + ZEND_VM_C_GOTO(fetch_dim_r_index_slow); + } + } else { +ZEND_VM_C_LABEL(fetch_dim_r_index_slow): + SAVE_OPLINE(); + if (OP2_TYPE == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + +ZEND_VM_C_LABEL(fetch_dim_r_index_undef): + ZVAL_NULL(EX_VAR(opline->result.var)); + SAVE_OPLINE(); + zend_undefined_offset(offset); + FREE_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_SEND_VAR, op->op2_type == IS_UNUSED && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0, ZEND_SEND_VAR_SIMPLE, CV|VAR, NUM) +{ + USE_OPLINE + zval *varptr, *arg; + + varptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + + if (OP1_TYPE == IS_CV) { + ZVAL_COPY(arg, varptr); + } else /* if (OP1_TYPE == IS_VAR) */ { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_SEND_VAR_EX, op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0, ZEND_SEND_VAR_EX_SIMPLE, CV|VAR, UNUSED|NUM) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num = opline->op2.num; + + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF); + } + + varptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + + if (OP1_TYPE == IS_CV) { + ZVAL_COPY(arg, varptr); + } else /* if (OP1_TYPE == IS_VAR) */ { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_SEND_VAL, op->op1_type == IS_CONST && op->op2_type == IS_UNUSED && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1)), ZEND_SEND_VAL_SIMPLE, CONST, NUM) +{ + USE_OPLINE + zval *value, *arg; + + value = GET_OP1_ZVAL_PTR(BP_VAR_R); + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + ZVAL_COPY_VALUE(arg, value); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_SEND_VAL_EX, op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && op->op1_type == IS_CONST && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1)), ZEND_SEND_VAL_EX_SIMPLE, CONST, NUM) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num = opline->op2.num; + + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_DISPATCH_TO_HELPER(zend_cannot_pass_by_ref_helper, _arg_num, arg_num, _arg, arg); + } + value = GET_OP1_ZVAL_PTR(BP_VAR_R); + ZVAL_COPY_VALUE(arg, value); + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_FE_FETCH_R, op->op2_type == IS_CV && (op1_info & (MAY_BE_ANY|MAY_BE_REF)) == MAY_BE_ARRAY, ZEND_FE_FETCH_R_SIMPLE, VAR, CV, JMP_ADDR, SPEC(RETVAL)) +{ + USE_OPLINE + zval *array; + zval *value, *variable_ptr; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + + array = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + fe_ht = Z_ARRVAL_P(array); + pos = Z_FE_POS_P(array); + if (HT_IS_PACKED(fe_ht)) { + value = fe_ht->arPacked + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + pos++; + value++; + } + Z_FE_POS_P(array) = pos + 1; + if (RETURN_VALUE_USED(opline)) { + ZVAL_LONG(EX_VAR(opline->result.var), pos); + } + } else { + Bucket *p; + + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + p++; + } + Z_FE_POS_P(array) = pos; + if (RETURN_VALUE_USED(opline)) { + if (!p->key) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } + } + } + + variable_ptr = EX_VAR(opline->op2.var); + zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +ZEND_VM_DEFINE_OP(137, ZEND_OP_DATA); + +ZEND_VM_HELPER(zend_interrupt_helper, ANY, ANY) +{ + zend_atomic_bool_store_ex(&EG(vm_interrupt), false); + SAVE_OPLINE(); + if (zend_atomic_bool_load_ex(&EG(timed_out))) { + zend_timeout(); + } else if (zend_interrupt_function) { + zend_interrupt_function(execute_data); + if (EG(exception)) { + /* We have to UNDEF result, because ZEND_HANDLE_EXCEPTION is going to free it */ + const zend_op *throw_op = EG(opline_before_exception); + + if (throw_op + && throw_op->result_type & (IS_TMP_VAR|IS_VAR) + && throw_op->opcode != ZEND_ADD_ARRAY_ELEMENT + && throw_op->opcode != ZEND_ADD_ARRAY_UNPACK + && throw_op->opcode != ZEND_ROPE_INIT + && throw_op->opcode != ZEND_ROPE_ADD) { + ZVAL_UNDEF(ZEND_CALL_VAR(EG(current_execute_data), throw_op->result.var)); + + } + } + ZEND_VM_ENTER(); + } + ZEND_VM_CONTINUE(); +} diff --git a/include/php/Zend/zend_vm_execute.h b/include/php/Zend/zend_vm_execute.h new file mode 100644 index 0000000..0f22168 --- /dev/null +++ b/include/php/Zend/zend_vm_execute.h @@ -0,0 +1,65824 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifdef ZEND_WIN32 +# pragma warning(disable : 4101) +# pragma warning(once : 6235) +# pragma warning(once : 6237) +# pragma warning(once : 6239) +# pragma warning(once : 6240) +# pragma warning(once : 6285) +# pragma warning(once : 6286) +# pragma warning(once : 6326) +#endif +static user_opcode_handler_t zend_user_opcode_handlers[256] = { + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL, + (user_opcode_handler_t)NULL +}; + +static uint8_t zend_user_opcodes[256] = {0, + 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, + 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32, + 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48, + 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64, + 65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80, + 81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96, + 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112, + 113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128, + 129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144, + 145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160, + 161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176, + 177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192, + 193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208, + 209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224, + 225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240, + 241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + +#define SPEC_START_MASK 0x0000ffff +#define SPEC_EXTRA_MASK 0xfffc0000 +#define SPEC_RULE_OP1 0x00010000 +#define SPEC_RULE_OP2 0x00020000 +#define SPEC_RULE_OP_DATA 0x00040000 +#define SPEC_RULE_RETVAL 0x00080000 +#define SPEC_RULE_QUICK_ARG 0x00100000 +#define SPEC_RULE_SMART_BRANCH 0x00200000 +#define SPEC_RULE_COMMUTATIVE 0x00800000 +#define SPEC_RULE_ISSET 0x01000000 +#define SPEC_RULE_OBSERVER 0x02000000 + +static const uint32_t *zend_spec_handlers; +static const void * const *zend_opcode_handlers; +static int zend_handlers_count; +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) +static const void * const * zend_opcode_handler_funcs; +static zend_op hybrid_halt_op; +#endif +#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC +static const void *zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op); +#endif + +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) +static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op* op); +#else +# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler +#endif + +#ifndef VM_TRACE +# define VM_TRACE(op) +#endif +#ifndef VM_TRACE_START +# define VM_TRACE_START() +#endif +#ifndef VM_TRACE_END +# define VM_TRACE_END() +#endif +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) +#define HYBRID_NEXT() goto *(void**)(OPLINE->handler) +#define HYBRID_SWITCH() HYBRID_NEXT(); +#define HYBRID_CASE(op) op ## _LABEL +#define HYBRID_BREAK() HYBRID_NEXT() +#define HYBRID_DEFAULT ZEND_NULL_LABEL +#endif + +#ifdef ZEND_VM_FP_GLOBAL_REG +# define ZEND_OPCODE_HANDLER_ARGS void +# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU +# define ZEND_OPCODE_HANDLER_ARGS_DC +# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC +#else +# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data +# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data +# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS +# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU +#endif + +#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG) +# define ZEND_OPCODE_HANDLER_RET void +# define ZEND_VM_TAIL_CALL(call) call; return +# ifdef ZEND_VM_TAIL_CALL_DISPATCH +# define ZEND_VM_CONTINUE() ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); return +# else +# define ZEND_VM_CONTINUE() return +# endif +# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) +# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return +# define ZEND_VM_HOT zend_always_inline ZEND_COLD ZEND_OPT_SIZE +# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE +# else +# define ZEND_VM_RETURN() opline = NULL; return +# define ZEND_VM_HOT +# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE +# endif +#else +# define ZEND_OPCODE_HANDLER_RET int +# define ZEND_VM_TAIL_CALL(call) return call +# define ZEND_VM_CONTINUE() return 0 +# define ZEND_VM_RETURN() return -1 +# define ZEND_VM_HOT +# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE +#endif + +typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARGS); + +#define DCL_OPLINE +#ifdef ZEND_VM_IP_GLOBAL_REG +# define OPLINE opline +# define USE_OPLINE +# define LOAD_OPLINE() opline = EX(opline) +# define LOAD_OPLINE_EX() +# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1 +# define SAVE_OPLINE() EX(opline) = opline +# define SAVE_OPLINE_EX() SAVE_OPLINE() +#else +# define OPLINE EX(opline) +# define USE_OPLINE const zend_op *opline = EX(opline); +# define LOAD_OPLINE() +# define LOAD_OPLINE_EX() +# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE() +# define SAVE_OPLINE() +# define SAVE_OPLINE_EX() +#endif +#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE() +#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE() +#if defined(ZEND_VM_FP_GLOBAL_REG) +# define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE() +# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM_ENTER_EX() +# define ZEND_VM_LEAVE() ZEND_VM_CONTINUE() +#elif defined(ZEND_VM_IP_GLOBAL_REG) +# define ZEND_VM_ENTER_EX() return 1 +# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTER_EX() +# define ZEND_VM_LEAVE() return 2 +#else +# define ZEND_VM_ENTER_EX() return 1 +# define ZEND_VM_ENTER() return 1 +# define ZEND_VM_LEAVE() return 2 +#endif +#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); +#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_opcode_handler_func(opcode, opline))(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS); +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS); + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_add_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + add_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_sub_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + sub_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mul_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + mul_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mod_by_zero_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_mod_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + mod_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_shift_left_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + shift_left_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_shift_right_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + shift_right_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_equal_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret == 0, 1); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_not_equal_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret != 0, 1); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_smaller_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret < 0, 1); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_is_smaller_or_equal_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret <= 0, 1); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_or_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + bitwise_or_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_and_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + bitwise_and_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_xor_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + bitwise_xor_function(EX_VAR(opline->result.var), op_1, op_2); + if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_1); + } + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_bw_not_helper_SPEC(zval *op_1 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + bitwise_not_function(EX_VAR(opline->result.var), op_1); + FREE_OP(opline->op1_type, opline->op1.var); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_error(NULL, "Using $this when not in object context"); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); +} + +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + + SAVE_OPLINE(); + function_name = RT_CONSTANT(opline, opline->op2); + zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name)); + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_STATIC_PROP_OP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + /* This helper actually never will receive IS_VAR as second op, and has the same handling for VAR and TMP in the first op, but for interoperability with the other binary_assign_op helpers, it is necessary to "include" it */ + + USE_OPLINE + zval *prop, *value; + zend_property_info *prop_info; + zend_reference *ref; + + SAVE_OPLINE(); + + if (UNEXPECTED(zend_fetch_static_property_address(&prop, &prop_info, (opline+1)->extended_value, BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS)) { + UNDEF_RESULT(); + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + HANDLE_EXCEPTION(); + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if (UNEXPECTED(Z_ISREF_P(prop))) { + ref = Z_REF_P(prop); + prop = Z_REFVAL_P(prop); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, prop, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(prop, prop, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), prop); + } + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + /* assign_static_prop has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_STATIC_PROP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *prop; + zend_property_info *prop_info; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + zend_pre_incdec_property_zval(prop, + ZEND_TYPE_IS_SET(prop_info->type) ? prop_info : NULL OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_STATIC_PROP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *prop; + zend_property_info *prop_info; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + zend_post_incdec_property_zval(prop, + ZEND_TYPE_IS_SET(prop_info->type) ? prop_info : NULL OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC(int type ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + zval *prop; + + SAVE_OPLINE(); + + if (UNEXPECTED(zend_fetch_static_property_address(&prop, NULL, opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS, type, opline->extended_value OPLINE_CC EXECUTE_DATA_CC) != SUCCESS)) { + ZEND_ASSERT(EG(exception) || (type == BP_VAR_IS)); + prop = &EG(uninitialized_zval); + } + + if (type == BP_VAR_R || type == BP_VAR_IS) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), prop); + } else { + ZVAL_INDIRECT(EX_VAR(opline->result.var), prop); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_R_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_W_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_RW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_FUNC_ARG_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + int fetch_type = + (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ? + BP_VAR_W : BP_VAR_R; + ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(fetch_type ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_UNSET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_STATIC_PROP_IS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_static_prop_helper_SPEC(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot use temporary expression in write context"); + FREE_OP(opline->op2_type, opline->op2.var); + FREE_OP(opline->op1_type, opline->op1.var); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); +} + +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot use [] for reading"); + FREE_OP(opline->op2_type, opline->op2.var); + FREE_OP(opline->op1_type, opline->op1.var); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *prop, *value; + zend_property_info *prop_info; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC); + + } else { + value = zend_assign_to_variable_ex(prop, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + /* assign_static_prop has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *prop, *value; + zend_property_info *prop_info; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } else { + value = zend_assign_to_variable_ex(prop, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + /* assign_static_prop has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *prop, *value; + zend_property_info *prop_info; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } else { + value = zend_assign_to_variable_ex(prop, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + /* assign_static_prop has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *prop, *value; + zend_property_info *prop_info; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC); + + } else { + value = zend_assign_to_variable_ex(prop, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + /* assign_static_prop has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_STATIC_PROP_REF_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *prop, *value_ptr; + zend_property_info *prop_info; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + + if (zend_fetch_static_property_address(&prop, &prop_info, opline->extended_value & ~ZEND_RETURNS_FUNCTION, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + value_ptr = get_zval_ptr_ptr((opline+1)->op1_type, (opline+1)->op1, BP_VAR_W); + + if ((opline+1)->op1_type == IS_VAR && (opline->extended_value & ZEND_RETURNS_FUNCTION) && UNEXPECTED(!Z_ISREF_P(value_ptr))) { + if (UNEXPECTED(!zend_wrong_assign_to_variable_reference(prop, value_ptr, &garbage OPLINE_CC EXECUTE_DATA_CC))) { + prop = &EG(uninitialized_zval); + } + } else if (UNEXPECTED(ZEND_TYPE_IS_SET(prop_info->type))) { + prop = zend_assign_to_typed_property_reference(prop_info, prop, value_ptr, &garbage EXECUTE_DATA_CC); + } else { + zend_assign_to_variable_reference(prop, value_ptr, &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), prop); + } + + if (garbage) { + GC_DTOR(garbage); + } + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_execute_data *old_execute_data; + uint32_t call_info = EX_CALL_INFO(); + SAVE_OPLINE(); + + if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED|ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); + +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(execute_data->This)); + } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + EG(vm_stack_top) = (zval*)execute_data; + execute_data = EX(prev_execute_data); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); + +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) { + zend_clean_and_cache_symbol_table(EX(symbol_table)); + } + + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(EX(extra_named_params)); + } + + /* Free extra args before releasing the closure, + * as that may free the op_array. */ + zend_vm_stack_free_extra_args_ex(call_info, execute_data); + + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(execute_data->This)); + } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + + old_execute_data = execute_data; + execute_data = EX(prev_execute_data); + zend_vm_stack_free_call_frame_ex(call_info, old_execute_data); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else if (EXPECTED((call_info & ZEND_CALL_TOP) == 0)) { + if (EX(func)->op_array.last_var > 0) { + zend_detach_symbol_table(execute_data); + call_info |= ZEND_CALL_NEEDS_REATTACH; + } + zend_destroy_static_vars(&EX(func)->op_array); + destroy_op_array(&EX(func)->op_array); + efree_size(EX(func), sizeof(zend_op_array)); + old_execute_data = execute_data; + execute_data = EG(current_execute_data) = EX(prev_execute_data); + zend_vm_stack_free_call_frame_ex(call_info, old_execute_data); + + if (call_info & ZEND_CALL_NEEDS_REATTACH) { + if (EX(func)->op_array.last_var > 0) { + zend_attach_symbol_table(execute_data); + } else { + ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_NEEDS_REATTACH); + } + } + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else { + if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_HAS_EXTRA_NAMED_PARAMS))) { + if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) { + zend_clean_and_cache_symbol_table(EX(symbol_table)); + } + zend_vm_stack_free_extra_args_ex(call_info, execute_data); + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(EX(extra_named_params)); + } + } + if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + ZEND_VM_RETURN(); + } else /* if (call_kind == ZEND_CALL_TOP_CODE) */ { + zend_array *symbol_table = EX(symbol_table); + + if (EX(func)->op_array.last_var > 0) { + zend_detach_symbol_table(execute_data); + call_info |= ZEND_CALL_NEEDS_REATTACH; + } + if (call_info & ZEND_CALL_NEEDS_REATTACH) { + old_execute_data = EX(prev_execute_data); + while (old_execute_data) { + if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) { + if (old_execute_data->symbol_table == symbol_table) { + if (old_execute_data->func->op_array.last_var > 0) { + zend_attach_symbol_table(old_execute_data); + } else { + ZEND_ADD_CALL_FLAG(old_execute_data, ZEND_CALL_NEEDS_REATTACH); + } + } + break; + } + old_execute_data = old_execute_data->prev_execute_data; + } + } + EG(current_execute_data) = EX(prev_execute_data); + ZEND_VM_RETURN(); + } + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op1), 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + zval retval; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = 0 ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + fbc->internal_function.handler(call, ret); + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + + EG(current_execute_data) = execute_data; + zend_vm_stack_free_args(call); + + uint32_t call_info = ZEND_CALL_INFO(call); + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { + if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_free_extra_named_params(call->extra_named_params); + } + zend_vm_stack_free_call_frame_ex(call_info, call); + } else { + EG(vm_stack_top) = (zval*)call; + } + + if (!0) { + i_zval_ptr_dtor(ret); + } + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + zval retval; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = 1 ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + fbc->internal_function.handler(call, ret); + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + + EG(current_execute_data) = execute_data; + zend_vm_stack_free_args(call); + + uint32_t call_info = ZEND_CALL_INFO(call); + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { + if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_free_extra_named_params(call->extra_named_params); + } + zend_vm_stack_free_call_frame_ex(call_info, call); + } else { + EG(vm_stack_top) = (zval*)call; + } + + if (!1) { + i_zval_ptr_dtor(ret); + } + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + zval retval; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + zend_observer_fcall_begin(call); + fbc->internal_function.handler(call, ret); + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + zend_observer_fcall_end(call, EG(exception) ? NULL : ret); + + EG(current_execute_data) = execute_data; + zend_vm_stack_free_args(call); + + uint32_t call_info = ZEND_CALL_INFO(call); + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { + if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_free_extra_named_params(call->extra_named_params); + } + zend_vm_stack_free_call_frame_ex(call_info, call); + } else { + EG(vm_stack_top) = (zval*)call; + } + + if (!RETURN_VALUE_USED(opline)) { + i_zval_ptr_dtor(ret); + } + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + ret = NULL; + if (0) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + LOAD_OPLINE_EX(); + + + ZEND_VM_ENTER_EX(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + ret = NULL; + if (1) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + LOAD_OPLINE_EX(); + + + ZEND_VM_ENTER_EX(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + ret = NULL; + if (RETURN_VALUE_USED(opline)) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + LOAD_OPLINE_EX(); + SAVE_OPLINE(); + zend_observer_fcall_begin(execute_data); + + ZEND_VM_ENTER_EX(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + ret = NULL; + if (0) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + LOAD_OPLINE_EX(); + + + ZEND_VM_ENTER_EX(); + } else { + zval retval; + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (0) { + ret = NULL; + } + + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + if (!0) { + ret = &retval; + ZVAL_UNDEF(ret); + } + goto fcall_by_name_end; + } + } + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = 0 ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + fbc->internal_function.handler(call, ret); + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + + EG(current_execute_data) = execute_data; + +fcall_by_name_end: + zend_vm_stack_free_args(call); + + uint32_t call_info = ZEND_CALL_INFO(call); + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { + if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_free_extra_named_params(call->extra_named_params); + } + zend_vm_stack_free_call_frame_ex(call_info, call); + } else { + EG(vm_stack_top) = (zval*)call; + } + + if (!0) { + i_zval_ptr_dtor(ret); + } + } + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + ret = NULL; + if (1) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + LOAD_OPLINE_EX(); + + + ZEND_VM_ENTER_EX(); + } else { + zval retval; + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (0) { + ret = NULL; + } + + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + if (!1) { + ret = &retval; + ZVAL_UNDEF(ret); + } + goto fcall_by_name_end; + } + } + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = 1 ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + fbc->internal_function.handler(call, ret); + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + + EG(current_execute_data) = execute_data; + +fcall_by_name_end: + zend_vm_stack_free_args(call); + + uint32_t call_info = ZEND_CALL_INFO(call); + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { + if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_free_extra_named_params(call->extra_named_params); + } + zend_vm_stack_free_call_frame_ex(call_info, call); + } else { + EG(vm_stack_top) = (zval*)call; + } + + if (!1) { + i_zval_ptr_dtor(ret); + } + } + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + ret = NULL; + if (RETURN_VALUE_USED(opline)) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + LOAD_OPLINE_EX(); + SAVE_OPLINE(); + zend_observer_fcall_begin(execute_data); + + ZEND_VM_ENTER_EX(); + } else { + zval retval; + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (1) { + ret = NULL; + } + + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + if (!RETURN_VALUE_USED(opline)) { + ret = &retval; + ZVAL_UNDEF(ret); + } + goto fcall_by_name_end; + } + } + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + zend_observer_fcall_begin(call); + fbc->internal_function.handler(call, ret); + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + zend_observer_fcall_end(call, EG(exception) ? NULL : ret); + + EG(current_execute_data) = execute_data; + +fcall_by_name_end: + zend_vm_stack_free_args(call); + + uint32_t call_info = ZEND_CALL_INFO(call); + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { + if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_free_extra_named_params(call->extra_named_params); + } + zend_vm_stack_free_call_frame_ex(call_info, call); + } else { + EG(vm_stack_top) = (zval*)call; + } + + if (!RETURN_VALUE_USED(opline)) { + i_zval_ptr_dtor(ret); + } + } + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + ret = NULL; + if (0) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + LOAD_OPLINE_EX(); + + + ZEND_VM_ENTER_EX(); + } else { + SAVE_OPLINE_EX(); + + execute_data = EX(prev_execute_data); + LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } + } else { + zval retval; + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (0) { + ret = NULL; + } + + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + if (!0) { + ret = &retval; + ZVAL_UNDEF(ret); + } + goto fcall_end; + } + } + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = 0 ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + if (!zend_execute_internal) { + /* saves one function call if zend_execute_internal is not used */ + fbc->internal_function.handler(call, ret); + } else { + zend_execute_internal(call, ret); + } + +#if ZEND_DEBUG + if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + + EG(current_execute_data) = execute_data; + +fcall_end: + zend_vm_stack_free_args(call); + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(call->extra_named_params); + } + + if (!0) { + i_zval_ptr_dtor(ret); + } + } + + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(call->This)); + } + + zend_vm_stack_free_call_frame(call); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + ret = NULL; + if (1) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + LOAD_OPLINE_EX(); + + + ZEND_VM_ENTER_EX(); + } else { + SAVE_OPLINE_EX(); + + execute_data = EX(prev_execute_data); + LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } + } else { + zval retval; + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (0) { + ret = NULL; + } + + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + if (!1) { + ret = &retval; + ZVAL_UNDEF(ret); + } + goto fcall_end; + } + } + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = 1 ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + if (!zend_execute_internal) { + /* saves one function call if zend_execute_internal is not used */ + fbc->internal_function.handler(call, ret); + } else { + zend_execute_internal(call, ret); + } + +#if ZEND_DEBUG + if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + + EG(current_execute_data) = execute_data; + +fcall_end: + zend_vm_stack_free_args(call); + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(call->extra_named_params); + } + + if (!1) { + i_zval_ptr_dtor(ret); + } + } + + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(call->This)); + } + + zend_vm_stack_free_call_frame(call); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + zend_function *fbc = call->func; + zval *ret; + + SAVE_OPLINE(); + EX(call) = call->prev_execute_data; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + ret = NULL; + if (RETURN_VALUE_USED(opline)) { + ret = EX_VAR(opline->result.var); + } + + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + LOAD_OPLINE_EX(); + SAVE_OPLINE(); + zend_observer_fcall_begin(execute_data); + ZEND_VM_ENTER_EX(); + } else { + SAVE_OPLINE_EX(); + zend_observer_fcall_begin(execute_data); + execute_data = EX(prev_execute_data); + LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } + } else { + zval retval; + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (1) { + ret = NULL; + } + + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + if (!RETURN_VALUE_USED(opline)) { + ret = &retval; + ZVAL_UNDEF(ret); + } + goto fcall_end; + } + } + + call->prev_execute_data = execute_data; + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval; + ZVAL_NULL(ret); + + zend_observer_fcall_begin(call); + if (!zend_execute_internal) { + /* saves one function call if zend_execute_internal is not used */ + fbc->internal_function.handler(call, ret); + } else { + zend_execute_internal(call, ret); + } + +#if ZEND_DEBUG + if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + zend_observer_fcall_end(call, EG(exception) ? NULL : ret); + + EG(current_execute_data) = execute_data; + +fcall_end: + zend_vm_stack_free_args(call); + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(call->extra_named_params); + } + + if (!RETURN_VALUE_USED(opline)) { + i_zval_ptr_dtor(ret); + } + } + + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(call->This)); + } + + zend_vm_stack_free_call_frame(call); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + + ZEND_VM_SET_OPCODE(opline + 1); + ZEND_VM_CONTINUE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *return_value = EX(return_value); + + if (EXPECTED(return_value)) { + USE_OPLINE + zend_generator *generator; + zend_execute_data *gen_execute_data; + uint32_t num_args, used_stack, call_info; + + SAVE_OPLINE(); + object_init_ex(return_value, zend_ce_generator); + + /* + * Normally the execute_data is allocated on the VM stack (because it does + * not actually do any allocation and thus is faster). For generators + * though this behavior would be suboptimal, because the (rather large) + * structure would have to be copied back and forth every time execution is + * suspended or resumed. That's why for generators the execution context + * is allocated on heap. + */ + num_args = EX_NUM_ARGS(); + if (EXPECTED(num_args <= EX(func)->op_array.num_args)) { + used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval); + gen_execute_data = (zend_execute_data*)emalloc(used_stack); + used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval); + } else { + used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - EX(func)->op_array.num_args) * sizeof(zval); + gen_execute_data = (zend_execute_data*)emalloc(used_stack); + } + memcpy(gen_execute_data, execute_data, used_stack); + + /* Save execution context in generator object. */ + generator = (zend_generator *) Z_OBJ_P(EX(return_value)); + generator->execute_data = gen_execute_data; + generator->frozen_call_stack = NULL; + generator->execute_fake.opline = NULL; + generator->execute_fake.func = NULL; + generator->execute_fake.prev_execute_data = NULL; + ZVAL_OBJ(&generator->execute_fake.This, (zend_object *) generator); + + gen_execute_data->opline = opline + 1; + /* EX(return_value) keeps pointer to zend_object (not a real zval) */ + gen_execute_data->return_value = (zval*)generator; + call_info = Z_TYPE_INFO(EX(This)); + if ((call_info & Z_TYPE_MASK) == IS_OBJECT + && (!(call_info & (ZEND_CALL_CLOSURE|ZEND_CALL_RELEASE_THIS)) + /* Bug #72523 */ + || UNEXPECTED(zend_execute_ex != execute_ex))) { + ZEND_ADD_CALL_FLAG_EX(call_info, ZEND_CALL_RELEASE_THIS); + Z_ADDREF(gen_execute_data->This); + } + ZEND_ADD_CALL_FLAG_EX(call_info, (ZEND_CALL_TOP_FUNCTION | ZEND_CALL_ALLOCATED | ZEND_CALL_GENERATOR)); + Z_TYPE_INFO(gen_execute_data->This) = call_info; + gen_execute_data->prev_execute_data = NULL; + + call_info = EX_CALL_INFO(); + EG(current_execute_data) = EX(prev_execute_data); + if (EXPECTED(!(call_info & (ZEND_CALL_TOP|ZEND_CALL_ALLOCATED)))) { + EG(vm_stack_top) = (zval*)execute_data; + execute_data = EX(prev_execute_data); + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else if (EXPECTED(!(call_info & ZEND_CALL_TOP))) { + zend_execute_data *old_execute_data = execute_data; + execute_data = EX(prev_execute_data); + zend_vm_stack_free_call_frame_ex(call_info, old_execute_data); + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else { + ZEND_VM_RETURN(); + } + } else { + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_cannot_pass_by_ref_helper_SPEC(uint32_t _arg_num, zval *_arg ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + + zend_cannot_pass_by_reference(_arg_num); + FREE_OP(opline->op1_type, opline->op1.var); + ZVAL_UNDEF(_arg); + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *args; + uint32_t arg_num; + + SAVE_OPLINE(); + args = get_zval_ptr_undef(opline->op1_type, opline->op1, BP_VAR_R); + arg_num = ZEND_CALL_NUM_ARGS(EX(call)) + 1; + +send_again: + if (EXPECTED(Z_TYPE_P(args) == IS_ARRAY)) { + HashTable *ht = Z_ARRVAL_P(args); + zval *arg, *top; + zend_string *name; + bool have_named_params = 0; + + zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht)); + + // TODO: Speed this up using a flag that specifies whether there are any ref parameters. + if ((opline->op1_type & (IS_VAR|IS_CV)) && Z_REFCOUNT_P(args) > 1) { + uint32_t tmp_arg_num = arg_num; + bool separate = 0; + + /* check if any of arguments are going to be passed by reference */ + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) { + if (UNEXPECTED(name)) { + void *cache_slot[2] = {NULL, NULL}; + tmp_arg_num = zend_get_arg_offset_by_name( + EX(call)->func, name, cache_slot) + 1; + } + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, tmp_arg_num)) { + separate = 1; + break; + } + tmp_arg_num++; + } ZEND_HASH_FOREACH_END(); + if (separate) { + SEPARATE_ARRAY(args); + ht = Z_ARRVAL_P(args); + } + } + + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) { + if (UNEXPECTED(name)) { + void *cache_slot[2] = {NULL, NULL}; + have_named_params = 1; + top = zend_handle_named_arg(&EX(call), name, &arg_num, cache_slot); + if (UNEXPECTED(!top)) { + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } + } else { + if (have_named_params) { + zend_throw_error(NULL, + "Cannot use positional argument after named argument during unpacking"); + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } + + top = ZEND_CALL_ARG(EX(call), arg_num); + ZEND_CALL_NUM_ARGS(EX(call))++; + } + + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + if (Z_ISREF_P(arg)) { + Z_ADDREF_P(arg); + ZVAL_REF(top, Z_REF_P(arg)); + } else if (opline->op1_type & (IS_VAR|IS_CV)) { + /* array is already separated above */ + ZVAL_MAKE_REF_EX(arg, 2); + ZVAL_REF(top, Z_REF_P(arg)); + } else { + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(top, arg); + } + } else { + ZVAL_COPY_DEREF(top, arg); + } + + arg_num++; + } ZEND_HASH_FOREACH_END(); + + } else if (EXPECTED(Z_TYPE_P(args) == IS_OBJECT)) { + zend_class_entry *ce = Z_OBJCE_P(args); + zend_object_iterator *iter; + bool have_named_params = 0; + + if (!ce || !ce->get_iterator) { + zend_type_error("Only arrays and Traversables can be unpacked"); + } else { + + iter = ce->get_iterator(ce, args, 0); + if (UNEXPECTED(!iter)) { + FREE_OP(opline->op1_type, opline->op1.var); + if (!EG(exception)) { + zend_throw_exception_ex( + NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name) + ); + } + HANDLE_EXCEPTION(); + } + + const zend_object_iterator_funcs *funcs = iter->funcs; + if (funcs->rewind) { + funcs->rewind(iter); + } + + for (; funcs->valid(iter) == SUCCESS; ++arg_num) { + zval *arg, *top; + + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + arg = funcs->get_current_data(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + zend_string *name = NULL; + if (funcs->get_current_key) { + zval key; + funcs->get_current_key(iter, &key); + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + if (UNEXPECTED(Z_TYPE(key) != IS_LONG)) { + if (UNEXPECTED(Z_TYPE(key) != IS_STRING)) { + zend_throw_error(NULL, + "Keys must be of type int|string during argument unpacking"); + zval_ptr_dtor(&key); + break; + } + + name = Z_STR_P(&key); + } + } + + if (UNEXPECTED(name)) { + void *cache_slot[2] = {NULL, NULL}; + have_named_params = 1; + top = zend_handle_named_arg(&EX(call), name, &arg_num, cache_slot); + if (UNEXPECTED(!top)) { + zend_string_release(name); + break; + } + + ZVAL_DEREF(arg); + Z_TRY_ADDREF_P(arg); + + if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + zend_error( + E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()" + " by unpacking a Traversable, passing by-value instead", arg_num, + EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "", + EX(call)->func->common.scope ? "::" : "", + ZSTR_VAL(EX(call)->func->common.function_name) + ); + ZVAL_NEW_REF(top, arg); + } else { + ZVAL_COPY_VALUE(top, arg); + } + + zend_string_release(name); + } else { + if (have_named_params) { + zend_throw_error(NULL, + "Cannot use positional argument after named argument during unpacking"); + break; + } + + zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1); + top = ZEND_CALL_ARG(EX(call), arg_num); + ZVAL_DEREF(arg); + Z_TRY_ADDREF_P(arg); + + if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + zend_error( + E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()" + " by unpacking a Traversable, passing by-value instead", arg_num, + EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "", + EX(call)->func->common.scope ? "::" : "", + ZSTR_VAL(EX(call)->func->common.function_name) + ); + ZVAL_NEW_REF(top, arg); + } else { + ZVAL_COPY_VALUE(top, arg); + } + + ZEND_CALL_NUM_ARGS(EX(call))++; + } + + funcs->move_forward(iter); + } + + zend_iterator_dtor(iter); + } + } else if (EXPECTED(Z_ISREF_P(args))) { + args = Z_REFVAL_P(args); + goto send_again; + } else { + if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_P(args) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_type_error("Only arrays and Traversables can be unpacked"); + } + + FREE_OP(opline->op1_type, opline->op1.var); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *args; + + SAVE_OPLINE(); + args = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); + + if (UNEXPECTED(Z_TYPE_P(args) != IS_ARRAY)) { + if ((opline->op1_type & (IS_VAR|IS_CV)) && Z_ISREF_P(args)) { + args = Z_REFVAL_P(args); + if (EXPECTED(Z_TYPE_P(args) == IS_ARRAY)) { + goto send_array; + } + } + zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_zval_value_name(args)); + FREE_OP(opline->op2_type, opline->op2.var); + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } else { + uint32_t arg_num; + HashTable *ht; + zval *arg, *param; + +send_array: + ht = Z_ARRVAL_P(args); + if (opline->op2_type != IS_UNUSED) { + /* We don't need to handle named params in this case, + * because array_slice() is called with $preserve_keys == false. */ + zval *op2 = get_zval_ptr_deref(opline->op2_type, opline->op2, BP_VAR_R); + uint32_t skip = opline->extended_value; + uint32_t count = zend_hash_num_elements(ht); + zend_long len; + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + len = Z_LVAL_P(op2); + } else if (Z_TYPE_P(op2) == IS_NULL) { + len = count - skip; + } else if (EX_USES_STRICT_TYPES() + || !zend_parse_arg_long_weak(op2, &len, /* arg_num */ 3)) { + zend_type_error( + "array_slice(): Argument #3 ($length) must be of type ?int, %s given", + zend_zval_value_name(op2)); + FREE_OP(opline->op2_type, opline->op2.var); + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } + + if (len < 0) { + len += (zend_long)(count - skip); + } + if (skip < count && len > 0) { + if (len > (zend_long)(count - skip)) { + len = (zend_long)(count - skip); + } + zend_vm_stack_extend_call_frame(&EX(call), 0, len); + arg_num = 1; + param = ZEND_CALL_ARG(EX(call), 1); + ZEND_HASH_FOREACH_VAL(ht, arg) { + bool must_wrap = 0; + if (skip > 0) { + skip--; + continue; + } else if ((zend_long)(arg_num - 1) >= len) { + break; + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + if (UNEXPECTED(!Z_ISREF_P(arg))) { + if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + /* By-value send is not allowed -- emit a warning, + * but still perform the call. */ + zend_param_must_be_ref(EX(call)->func, arg_num); + must_wrap = 1; + } + } + } else { + if (Z_ISREF_P(arg) && + !(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + /* don't separate references for __call */ + arg = Z_REFVAL_P(arg); + } + } + if (EXPECTED(!must_wrap)) { + ZVAL_COPY(param, arg); + } else { + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } + ZEND_CALL_NUM_ARGS(EX(call))++; + arg_num++; + param++; + } ZEND_HASH_FOREACH_END(); + } + FREE_OP(opline->op2_type, opline->op2.var); + } else { + zend_string *name; + bool have_named_params; + zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht)); + arg_num = 1; + param = ZEND_CALL_ARG(EX(call), 1); + have_named_params = 0; + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) { + if (name) { + void *cache_slot[2] = {NULL, NULL}; + have_named_params = 1; + param = zend_handle_named_arg(&EX(call), name, &arg_num, cache_slot); + if (!param) { + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } + } else if (have_named_params) { + zend_throw_error(NULL, + "Cannot use positional argument after named argument"); + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } + + bool must_wrap = 0; + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + if (UNEXPECTED(!Z_ISREF_P(arg))) { + if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + /* By-value send is not allowed -- emit a warning, + * but still perform the call. */ + zend_param_must_be_ref(EX(call)->func, arg_num); + must_wrap = 1; + } + } + } else { + if (Z_ISREF_P(arg) && + !(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + /* don't separate references for __call */ + arg = Z_REFVAL_P(arg); + } + } + + if (EXPECTED(!must_wrap)) { + ZVAL_COPY(param, arg); + } else { + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } + if (!name) { + ZEND_CALL_NUM_ARGS(EX(call))++; + arg_num++; + param++; + } + } ZEND_HASH_FOREACH_END(); + } + } + FREE_OP(opline->op1_type, opline->op1.var); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_missing_arg_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ +#ifdef ZEND_VM_IP_GLOBAL_REG + USE_OPLINE + + SAVE_OPLINE(); +#endif + zend_missing_arg_error(execute_data); + HANDLE_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_verify_recv_arg_type_helper_SPEC(zval *op_1 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), opline->op1.num, op_1, CACHE_ADDR(opline->extended_value)))) { + HANDLE_EXCEPTION(); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_NOTYPE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + uint32_t arg_num = opline->op1.num; + + if (UNEXPECTED(arg_num > EX_NUM_ARGS())) { + ZEND_VM_TAIL_CALL(zend_missing_arg_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_case_helper_SPEC(zval *op_1, zval *op_2 ZEND_OPCODE_HANDLER_ARGS_DC) +{ + int ret; + USE_OPLINE + + SAVE_OPLINE(); + if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) { + op_1 = ZVAL_UNDEFINED_OP1(); + } + if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { + op_2 = ZVAL_UNDEFINED_OP2(); + } + ret = zend_compare(op_1, op_2); + if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(op_2); + } + ZEND_VM_SMART_BRANCH(ret == 0, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_UNPACK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + HashTable *result_ht; + + SAVE_OPLINE(); + op1 = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); + result_ht = Z_ARRVAL_P(EX_VAR(opline->result.var)); + +add_unpack_again: + if (EXPECTED(Z_TYPE_P(op1) == IS_ARRAY)) { + HashTable *ht = Z_ARRVAL_P(op1); + zval *val; + + if (HT_IS_PACKED(ht) && (zend_hash_num_elements(result_ht) == 0 || HT_IS_PACKED(result_ht))) { + zend_hash_extend(result_ht, result_ht->nNumUsed + zend_hash_num_elements(ht), 1); + ZEND_HASH_FILL_PACKED(result_ht) { + ZEND_HASH_PACKED_FOREACH_VAL(ht, val) { + if (UNEXPECTED(Z_ISREF_P(val)) && + UNEXPECTED(Z_REFCOUNT_P(val) == 1)) { + val = Z_REFVAL_P(val); + } + Z_TRY_ADDREF_P(val); + ZEND_HASH_FILL_ADD(val); + } ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FILL_END(); + } else { + zend_string *key; + + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, key, val) { + if (UNEXPECTED(Z_ISREF_P(val)) && + UNEXPECTED(Z_REFCOUNT_P(val) == 1)) { + val = Z_REFVAL_P(val); + } + Z_TRY_ADDREF_P(val); + if (key) { + zend_hash_update(result_ht, key, val); + } else { + if (!zend_hash_next_index_insert(result_ht, val)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(val); + break; + } + } + } ZEND_HASH_FOREACH_END(); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_OBJECT)) { + zend_class_entry *ce = Z_OBJCE_P(op1); + zend_object_iterator *iter; + + if (!ce || !ce->get_iterator) { + zend_type_error("Only arrays and Traversables can be unpacked"); + } else { + iter = ce->get_iterator(ce, op1, 0); + if (UNEXPECTED(!iter)) { + FREE_OP(opline->op1_type, opline->op1.var); + if (!EG(exception)) { + zend_throw_exception_ex( + NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name) + ); + } + HANDLE_EXCEPTION(); + } + + const zend_object_iterator_funcs *funcs = iter->funcs; + if (funcs->rewind) { + funcs->rewind(iter); + } + + for (; funcs->valid(iter) == SUCCESS; ) { + zval *val; + + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + val = funcs->get_current_data(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + zval key; + if (funcs->get_current_key) { + funcs->get_current_key(iter, &key); + if (UNEXPECTED(EG(exception) != NULL)) { + break; + } + + if (UNEXPECTED(Z_TYPE(key) != IS_LONG && Z_TYPE(key) != IS_STRING)) { + zend_throw_error(NULL, + "Keys must be of type int|string during array unpacking"); + zval_ptr_dtor(&key); + break; + } + } else { + ZVAL_UNDEF(&key); + } + + ZVAL_DEREF(val); + Z_TRY_ADDREF_P(val); + + zend_ulong num_key; + if (Z_TYPE(key) == IS_STRING && !ZEND_HANDLE_NUMERIC(Z_STR(key), num_key)) { + zend_hash_update(result_ht, Z_STR(key), val); + zval_ptr_dtor_str(&key); + } else { + zval_ptr_dtor(&key); + if (!zend_hash_next_index_insert(result_ht, val)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(val); + break; + } + } + + funcs->move_forward(iter); + if (UNEXPECTED(EG(exception))) { + break; + } + } + + zend_iterator_dtor(iter); + } + } else if (EXPECTED(Z_ISREF_P(op1))) { + op1 = Z_REFVAL_P(op1); + goto add_unpack_again; + } else { + zend_throw_error(NULL, "Only arrays and Traversables can be unpacked"); + } + + FREE_OP(opline->op1_type, opline->op1.var); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varname; + zend_string *name, *tmp_name = NULL; + zend_class_entry *ce; + + SAVE_OPLINE(); + + if (opline->op2_type == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } + /*CACHE_PTR(opline->extended_value, ce);*/ + } + } else if (opline->op2_type == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + + varname = get_zval_ptr_undef(opline->op1_type, opline->op1, BP_VAR_R); + if (opline->op1_type == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + } else { + if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + varname = ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + FREE_OP(opline->op1_type, opline->op1.var); + HANDLE_EXCEPTION(); + } + } + + zend_std_unset_static_property(ce, name); + + zend_tmp_string_release(tmp_name); + FREE_OP(opline->op1_type, opline->op1.var); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fe_fetch_object_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array; + zval *value; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + Bucket *p; + zend_object_iterator *iter; + + array = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + + ZEND_ASSERT(Z_TYPE_P(array) == IS_OBJECT); + if ((iter = zend_iterator_unwrap(array)) == NULL) { + /* plain object */ + + fe_ht = Z_OBJPROP_P(array); + pos = zend_hash_iterator_pos(Z_FE_ITER_P(array), fe_ht); + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + goto fe_fetch_r_exit; + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + if (EXPECTED(value_type != IS_UNDEF)) { + if (UNEXPECTED(value_type == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + value_type = Z_TYPE_INFO_P(value); + if (EXPECTED(value_type != IS_UNDEF) + && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) { + break; + } + } else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0) + || !p->key + || zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) { + break; + } + } + p++; + } + EG(ht_iterators)[Z_FE_ITER_P(array)].pos = pos; + if (RETURN_VALUE_USED(opline)) { + if (UNEXPECTED(!p->key)) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else if (ZSTR_VAL(p->key)[0]) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } else { + const char *class_name, *prop_name; + size_t prop_name_len; + zend_unmangle_property_name_ex( + p->key, &class_name, &prop_name, &prop_name_len); + ZVAL_STRINGL(EX_VAR(opline->result.var), prop_name, prop_name_len); + } + } + } else { + const zend_object_iterator_funcs *funcs = iter->funcs; + if (EXPECTED(++iter->index > 0)) { + /* This could cause an endless loop if index becomes zero again. + * In case that ever happens we need an additional flag. */ + funcs->move_forward(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(funcs->valid(iter) == FAILURE)) { + /* reached end of iteration */ + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } +fe_fetch_r_exit: + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + } + value = funcs->get_current_data(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (!value) { + /* failure in get_current_data */ + goto fe_fetch_r_exit; + } + if (RETURN_VALUE_USED(opline)) { + if (funcs->get_current_key) { + funcs->get_current_key(iter, EX_VAR(opline->result.var)); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } else { + ZVAL_LONG(EX_VAR(opline->result.var), iter->index); + } + } + value_type = Z_TYPE_INFO_P(value); + } + + if (EXPECTED(opline->op2_type == IS_CV)) { + zval *variable_ptr = EX_VAR(opline->op2.var); + zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + } else { + zval *res = EX_VAR(opline->op2.var); + zend_refcounted *gc = Z_COUNTED_P(value); + + ZVAL_COPY_VALUE_EX(res, value, gc, value_type); + if (Z_TYPE_INFO_REFCOUNTED(value_type)) { + GC_ADDREF(gc); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_result fetch_result; + bool result; + + SAVE_OPLINE(); + + fetch_result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = fetch_result == SUCCESS && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + } else { + result = fetch_result != SUCCESS || !i_zend_is_true(value); + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXIT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + if (opline->op1_type != IS_UNUSED) { + zval *ptr = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); + + do { + if (Z_TYPE_P(ptr) == IS_LONG) { + EG(exit_status) = Z_LVAL_P(ptr); + } else { + if ((opline->op1_type & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) { + ptr = Z_REFVAL_P(ptr); + if (Z_TYPE_P(ptr) == IS_LONG) { + EG(exit_status) = Z_LVAL_P(ptr); + break; + } + } + zend_print_zval(ptr, 0); + } + } while (0); + FREE_OP(opline->op1_type, opline->op1.var); + } + + if (!EG(exception)) { + zend_throw_unwind_exit(); + } + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting)); + + if (!E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting))) { + do { + /* Do not silence fatal errors */ + EG(error_reporting) &= E_FATAL_ERRORS; + if (!EG(error_reporting_ini_entry)) { + zval *zv = zend_hash_find_known_hash(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING)); + if (zv) { + EG(error_reporting_ini_entry) = (zend_ini_entry *)Z_PTR_P(zv); + } else { + break; + } + } + if (!EG(error_reporting_ini_entry)->modified) { + if (!EG(modified_ini_directives)) { + ALLOC_HASHTABLE(EG(modified_ini_directives)); + zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0); + } + if (EXPECTED(zend_hash_add_ptr(EG(modified_ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), EG(error_reporting_ini_entry)) != NULL)) { + EG(error_reporting_ini_entry)->orig_value = EG(error_reporting_ini_entry)->value; + EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable; + EG(error_reporting_ini_entry)->modified = 1; + } + } + } while (0); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (!EG(no_extensions)) { + SAVE_OPLINE(); + zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, execute_data); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (!EG(no_extensions)) { + SAVE_OPLINE(); + zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, execute_data); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXT_FCALL_END_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (!EG(no_extensions)) { + SAVE_OPLINE(); + zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, execute_data); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ANON_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *zv; + zend_class_entry *ce; + USE_OPLINE + + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + zend_string *rtd_key = Z_STR_P(RT_CONSTANT(opline, opline->op1)); + zv = zend_hash_find_known_hash(EG(class_table), rtd_key); + ZEND_ASSERT(zv != NULL); + ce = Z_CE_P(zv); + if (!(ce->ce_flags & ZEND_ACC_LINKED)) { + SAVE_OPLINE(); + ce = zend_do_link_class(ce, (opline->op2_type == IS_CONST) ? Z_STR_P(RT_CONSTANT(opline, opline->op2)) : NULL, rtd_key); + if (!ce) { + HANDLE_EXCEPTION(); + } + } + CACHE_PTR(opline->extended_value, ce); + } + Z_CE_P(EX_VAR(opline->result.var)) = ce; + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_function *func; + USE_OPLINE + + SAVE_OPLINE(); + func = (zend_function *) EX(func)->op_array.dynamic_func_defs[opline->op2.num]; + do_bind_function(func, RT_CONSTANT(opline, opline->op1)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if ((uint32_t)++EG(ticks_count) >= opline->extended_value) { + EG(ticks_count) = 0; + if (zend_ticks_function) { + SAVE_OPLINE(); + zend_fiber_switch_block(); + zend_ticks_function(opline->extended_value); + zend_fiber_switch_unblock(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXT_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + ZEND_VM_NEXT_OPCODE(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_dispatch_try_catch_finally_helper_SPEC(uint32_t try_catch_offset, uint32_t op_num ZEND_OPCODE_HANDLER_ARGS_DC) +{ + /* May be NULL during generator closing (only finally blocks are executed) */ + zend_object *ex = EG(exception); + + /* Walk try/catch/finally structures upwards, performing the necessary actions */ + for (; try_catch_offset != (uint32_t) -1; try_catch_offset--) { + zend_try_catch_element *try_catch = + &EX(func)->op_array.try_catch_array[try_catch_offset]; + + if (op_num < try_catch->catch_op && ex) { + /* Go to catch block */ + cleanup_live_vars(execute_data, op_num, try_catch->catch_op); + ZEND_VM_JMP_EX(&EX(func)->op_array.opcodes[try_catch->catch_op], 0); + + } else if (op_num < try_catch->finally_op) { + if (ex && zend_is_unwind_exit(ex)) { + /* Don't execute finally blocks on exit (for now) */ + continue; + } + + /* Go to finally block */ + zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[try_catch->finally_end].op1.var); + cleanup_live_vars(execute_data, op_num, try_catch->finally_op); + Z_OBJ_P(fast_call) = EG(exception); + EG(exception) = NULL; + Z_OPLINE_NUM_P(fast_call) = (uint32_t)-1; + ZEND_VM_JMP_EX(&EX(func)->op_array.opcodes[try_catch->finally_op], 0); + + } else if (op_num < try_catch->finally_end) { + zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[try_catch->finally_end].op1.var); + + /* cleanup incomplete RETURN statement */ + if (Z_OPLINE_NUM_P(fast_call) != (uint32_t)-1 + && (EX(func)->op_array.opcodes[Z_OPLINE_NUM_P(fast_call)].op2_type & (IS_TMP_VAR | IS_VAR))) { + zval *return_value = EX_VAR(EX(func)->op_array.opcodes[Z_OPLINE_NUM_P(fast_call)].op2.var); + + zval_ptr_dtor(return_value); + } + + /* Chain potential exception from wrapping finally block */ + if (Z_OBJ_P(fast_call)) { + if (ex) { + if (zend_is_unwind_exit(ex) || zend_is_graceful_exit(ex)) { + /* discard the previously thrown exception */ + OBJ_RELEASE(Z_OBJ_P(fast_call)); + } else { + zend_exception_set_previous(ex, Z_OBJ_P(fast_call)); + } + } else { + ex = EG(exception) = Z_OBJ_P(fast_call); + } + } + } + } + + /* Uncaught exception */ + if (zend_observer_fcall_op_array_extension != -1) { + zend_observer_fcall_end(execute_data, NULL); + } + cleanup_live_vars(execute_data, op_num, 0); + if (UNEXPECTED((EX_CALL_INFO() & ZEND_CALL_GENERATOR) != 0)) { + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + EG(current_execute_data) = EX(prev_execute_data); + zend_generator_close(generator, 1); + ZEND_VM_RETURN(); + } else { + /* We didn't execute RETURN, and have to initialize return_value */ + if (EX(return_value)) { + ZVAL_UNDEF(EX(return_value)); + } + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + const zend_op *throw_op = EG(opline_before_exception); + + /* Exception was thrown before executing any op */ + if (UNEXPECTED(!throw_op)) { + ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(-1, 0 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + + uint32_t throw_op_num = throw_op - EX(func)->op_array.opcodes; + int i, current_try_catch_offset = -1; + + if ((throw_op->opcode == ZEND_FREE || throw_op->opcode == ZEND_FE_FREE) + && throw_op->extended_value & ZEND_FREE_ON_RETURN) { + /* exceptions thrown because of loop var destruction on return/break/... + * are logically thrown at the end of the foreach loop, so adjust the + * throw_op_num. + */ + const zend_live_range *range = find_live_range( + &EX(func)->op_array, throw_op_num, throw_op->op1.var); + /* free op1 of the corresponding RETURN */ + for (i = throw_op_num; i < range->end; i++) { + if (EX(func)->op_array.opcodes[i].opcode == ZEND_FREE + || EX(func)->op_array.opcodes[i].opcode == ZEND_FE_FREE) { + /* pass */ + } else { + if (EX(func)->op_array.opcodes[i].opcode == ZEND_RETURN + && (EX(func)->op_array.opcodes[i].op1_type & (IS_VAR|IS_TMP_VAR))) { + zval_ptr_dtor(EX_VAR(EX(func)->op_array.opcodes[i].op1.var)); + } + break; + } + } + throw_op_num = range->end; + } + + /* Find the innermost try/catch/finally the exception was thrown in */ + for (i = 0; i < EX(func)->op_array.last_try_catch; i++) { + zend_try_catch_element *try_catch = &EX(func)->op_array.try_catch_array[i]; + if (try_catch->try_op > throw_op_num) { + /* further blocks will not be relevant... */ + break; + } + if (throw_op_num < try_catch->catch_op || throw_op_num < try_catch->finally_end) { + current_try_catch_offset = i; + } + } + + cleanup_unfinished_calls(execute_data, throw_op_num); + + if (throw_op->result_type & (IS_VAR | IS_TMP_VAR)) { + switch (throw_op->opcode) { + case ZEND_ADD_ARRAY_ELEMENT: + case ZEND_ADD_ARRAY_UNPACK: + case ZEND_ROPE_INIT: + case ZEND_ROPE_ADD: + break; /* exception while building structures, live range handling will free those */ + + case ZEND_FETCH_CLASS: + case ZEND_DECLARE_ANON_CLASS: + break; /* return value is zend_class_entry pointer */ + + default: + /* smart branch opcodes may not initialize result */ + if (!zend_is_smart_branch(throw_op)) { + zval_ptr_dtor_nogc(EX_VAR(throw_op->result.var)); + } + } + } + + ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(current_try_catch_offset, throw_op_num ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + int ret; + + SAVE_OPLINE(); + ret = zend_user_opcode_handlers[opline->opcode](execute_data); + opline = EX(opline); + + switch (ret) { + case ZEND_USER_OPCODE_CONTINUE: + ZEND_VM_CONTINUE(); + case ZEND_USER_OPCODE_RETURN: + if (UNEXPECTED((EX_CALL_INFO() & ZEND_CALL_GENERATOR) != 0)) { + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + EG(current_execute_data) = EX(prev_execute_data); + zend_generator_close(generator, 1); + ZEND_VM_RETURN(); + } else { + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + case ZEND_USER_OPCODE_ENTER: + ZEND_VM_ENTER(); + case ZEND_USER_OPCODE_LEAVE: + ZEND_VM_LEAVE(); + case ZEND_USER_OPCODE_DISPATCH: + ZEND_VM_DISPATCH(opline->opcode, opline); + default: + ZEND_VM_DISPATCH((uint8_t)(ret & 0xff), opline); + } +} + +static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot yield from finally in a force-closed generator"); + FREE_OP(opline->op2_type, opline->op2.var); + FREE_OP(opline->op1_type, opline->op1.var); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DISCARD_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *fast_call = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + + /* cleanup incomplete RETURN statement */ + if (Z_OPLINE_NUM_P(fast_call) != (uint32_t)-1 + && (EX(func)->op_array.opcodes[Z_OPLINE_NUM_P(fast_call)].op2_type & (IS_TMP_VAR | IS_VAR))) { + zval *return_value = EX_VAR(EX(func)->op_array.opcodes[Z_OPLINE_NUM_P(fast_call)].op2.var); + + zval_ptr_dtor(return_value); + } + + /* cleanup delayed exception */ + if (Z_OBJ_P(fast_call) != NULL) { + /* discard the previously thrown exception */ + OBJ_RELEASE(Z_OBJ_P(fast_call)); + Z_OBJ_P(fast_call) = NULL; + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *fast_call = EX_VAR(opline->result.var); + + Z_OBJ_P(fast_call) = NULL; + /* set return address */ + Z_OPLINE_NUM_P(fast_call) = opline - EX(func)->op_array.opcodes; + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op1), 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *fast_call = EX_VAR(opline->op1.var); + uint32_t current_try_catch_offset, current_op_num; + + if (Z_OPLINE_NUM_P(fast_call) != (uint32_t)-1) { + const zend_op *fast_ret = EX(func)->op_array.opcodes + Z_OPLINE_NUM_P(fast_call); + + ZEND_VM_JMP_EX(fast_ret + 1, 0); + } + + /* special case for unhandled exceptions */ + EG(exception) = Z_OBJ_P(fast_call); + Z_OBJ_P(fast_call) = NULL; + current_try_catch_offset = opline->op2.num; + current_op_num = opline - EX(func)->op_array.opcodes; + ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(current_try_catch_offset, current_op_num ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSERT_CHECK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (EG(assertions) <= 0) { + zend_op *target = OP_JMP_ADDR(opline, opline->op2); + if (RETURN_VALUE_USED(opline)) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } + ZEND_VM_JMP_EX(target, 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_array *args = NULL; + zend_function *fbc = EX(func); + zval *ret = EX(return_value); + uint32_t call_info = EX_CALL_INFO() & (ZEND_CALL_NESTED | ZEND_CALL_TOP | ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_EXTRA_NAMED_PARAMS); + uint32_t num_args = EX_NUM_ARGS(); + zend_execute_data *call; + + SAVE_OPLINE(); + + if (num_args) { + zval *p = ZEND_CALL_ARG(execute_data, 1); + zval *end = p + num_args; + + args = zend_new_array(num_args); + zend_hash_real_init_packed(args); + ZEND_HASH_FILL_PACKED(args) { + do { + ZEND_HASH_FILL_ADD(p); + p++; + } while (p != end); + } ZEND_HASH_FILL_END(); + } + + call = execute_data; + execute_data = EG(current_execute_data) = EX(prev_execute_data); + + call->func = (fbc->op_array.fn_flags & ZEND_ACC_STATIC) ? fbc->op_array.scope->__callstatic : fbc->op_array.scope->__call; + ZEND_ASSERT(zend_vm_calc_used_stack(2, call->func) <= (size_t)(((char*)EG(vm_stack_end)) - (char*)call)); + ZEND_CALL_NUM_ARGS(call) = 2; + + ZVAL_STR(ZEND_CALL_ARG(call, 1), fbc->common.function_name); + + zval *call_args = ZEND_CALL_ARG(call, 2); + if (args) { + ZVAL_ARR(call_args, args); + } else { + ZVAL_EMPTY_ARRAY(call_args); + } + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + if (zend_hash_num_elements(Z_ARRVAL_P(call_args)) == 0) { + GC_ADDREF(call->extra_named_params); + ZVAL_ARR(call_args, call->extra_named_params); + } else { + SEPARATE_ARRAY(call_args); + zend_hash_copy(Z_ARRVAL_P(call_args), call->extra_named_params, zval_add_ref); + } + } + zend_free_trampoline(fbc); + fbc = call->func; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + if (UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + if (EXPECTED(zend_execute_ex == execute_ex)) { + LOAD_OPLINE_EX(); + + + ZEND_VM_ENTER_EX(); + } else { + SAVE_OPLINE_EX(); + + execute_data = EX(prev_execute_data); + if (execute_data) { + LOAD_OPLINE(); + } + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } + } else { + zval retval; + + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + if (ret == NULL) { + ret = &retval; + } + + ZVAL_NULL(ret); + + if (!zend_execute_internal) { + /* saves one function call if zend_execute_internal is not used */ + fbc->internal_function.handler(call, ret); + } else { + zend_execute_internal(call, ret); + } + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + + EG(current_execute_data) = call->prev_execute_data; + + zend_vm_stack_free_args(call); + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(call->extra_named_params); + } + if (ret == &retval) { + zval_ptr_dtor(ret); + } + } + + execute_data = EG(current_execute_data); + + if (!execute_data || !EX(func) || !ZEND_USER_CODE(EX(func)->type) || (call_info & ZEND_CALL_TOP)) { + ZEND_VM_RETURN(); + } + + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + zend_object *object = Z_OBJ(call->This); + OBJ_RELEASE(object); + } + zend_vm_stack_free_call_frame(call); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_OPLINE(); + ZEND_VM_INC_OPCODE(); + ZEND_VM_LEAVE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_array *args = NULL; + zend_function *fbc = EX(func); + zval *ret = EX(return_value); + uint32_t call_info = EX_CALL_INFO() & (ZEND_CALL_NESTED | ZEND_CALL_TOP | ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_EXTRA_NAMED_PARAMS); + uint32_t num_args = EX_NUM_ARGS(); + zend_execute_data *call; + + SAVE_OPLINE(); + + if (num_args) { + zval *p = ZEND_CALL_ARG(execute_data, 1); + zval *end = p + num_args; + + args = zend_new_array(num_args); + zend_hash_real_init_packed(args); + ZEND_HASH_FILL_PACKED(args) { + do { + ZEND_HASH_FILL_ADD(p); + p++; + } while (p != end); + } ZEND_HASH_FILL_END(); + } + + call = execute_data; + execute_data = EG(current_execute_data) = EX(prev_execute_data); + + call->func = (fbc->op_array.fn_flags & ZEND_ACC_STATIC) ? fbc->op_array.scope->__callstatic : fbc->op_array.scope->__call; + ZEND_ASSERT(zend_vm_calc_used_stack(2, call->func) <= (size_t)(((char*)EG(vm_stack_end)) - (char*)call)); + ZEND_CALL_NUM_ARGS(call) = 2; + + ZVAL_STR(ZEND_CALL_ARG(call, 1), fbc->common.function_name); + + zval *call_args = ZEND_CALL_ARG(call, 2); + if (args) { + ZVAL_ARR(call_args, args); + } else { + ZVAL_EMPTY_ARRAY(call_args); + } + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + if (zend_hash_num_elements(Z_ARRVAL_P(call_args)) == 0) { + GC_ADDREF(call->extra_named_params); + ZVAL_ARR(call_args, call->extra_named_params); + } else { + SEPARATE_ARRAY(call_args); + zend_hash_copy(Z_ARRVAL_P(call_args), call->extra_named_params, zval_add_ref); + } + } + zend_free_trampoline(fbc); + fbc = call->func; + + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { + if (UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + if (EXPECTED(zend_execute_ex == execute_ex)) { + LOAD_OPLINE_EX(); + SAVE_OPLINE(); + zend_observer_fcall_begin(execute_data); + ZEND_VM_ENTER_EX(); + } else { + SAVE_OPLINE_EX(); + zend_observer_fcall_begin(execute_data); + execute_data = EX(prev_execute_data); + if (execute_data) { + LOAD_OPLINE(); + } + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } + } else { + zval retval; + + ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + + EG(current_execute_data) = call; + +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(fbc, call); +#endif + + if (ret == NULL) { + ret = &retval; + } + + ZVAL_NULL(ret); + zend_observer_fcall_begin(call); + if (!zend_execute_internal) { + /* saves one function call if zend_execute_internal is not used */ + fbc->internal_function.handler(call, ret); + } else { + zend_execute_internal(call, ret); + } + +#if ZEND_DEBUG + if (!EG(exception) && call->func) { + if (should_throw) { + zend_internal_call_arginfo_violation(call->func); + } + ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || + zend_verify_internal_return_type(call->func, ret)); + ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) + ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); + zend_verify_internal_func_info(call->func, ret); + } +#endif + zend_observer_fcall_end(call, EG(exception) ? NULL : ret); + + EG(current_execute_data) = call->prev_execute_data; + + zend_vm_stack_free_args(call); + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(call->extra_named_params); + } + if (ret == &retval) { + zval_ptr_dtor(ret); + } + } + + execute_data = EG(current_execute_data); + + if (!execute_data || !EX(func) || !ZEND_USER_CODE(EX(func)->type) || (call_info & ZEND_CALL_TOP)) { + ZEND_VM_RETURN(); + } + + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + zend_object *object = Z_OBJ(call->This); + OBJ_RELEASE(object); + } + zend_vm_stack_free_call_frame(call); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_OPLINE(); + ZEND_VM_INC_OPCODE(); + ZEND_VM_LEAVE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_FORWARD_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + OPLINE = OP_JMP_ADDR(opline, opline->op1); + ZEND_VM_CONTINUE(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_atomic_bool_store_ex(&EG(vm_interrupt), false); + SAVE_OPLINE(); + if (zend_atomic_bool_load_ex(&EG(timed_out))) { + zend_timeout(); + } else if (zend_interrupt_function) { + zend_interrupt_function(execute_data); + if (EG(exception)) { + /* We have to UNDEF result, because ZEND_HANDLE_EXCEPTION is going to free it */ + const zend_op *throw_op = EG(opline_before_exception); + + if (throw_op + && throw_op->result_type & (IS_TMP_VAR|IS_VAR) + && throw_op->opcode != ZEND_ADD_ARRAY_ELEMENT + && throw_op->opcode != ZEND_ADD_ARRAY_UNPACK + && throw_op->opcode != ZEND_ROPE_INIT + && throw_op->opcode != ZEND_ROPE_ADD) { + ZVAL_UNDEF(ZEND_CALL_VAR(EG(current_execute_data), throw_op->result.var)); + + } + } + ZEND_VM_ENTER(); + } + ZEND_VM_CONTINUE(); +} +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_function *fbc; + zval *function_name, *func; + zend_execute_data *call; + + fbc = CACHED_PTR(opline->result.num); + if (UNEXPECTED(fbc == NULL)) { + function_name = (zval*)RT_CONSTANT(opline, opline->op2); + func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(function_name+1)); + if (UNEXPECTED(func == NULL)) { + ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + fbc = Z_FUNC_P(func); + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + CACHE_PTR(opline->result.num, fbc); + } + call = _zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION, + fbc, opline->extended_value, NULL); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_execute_data *call; + + SAVE_OPLINE(); + function_name = RT_CONSTANT(opline, opline->op2); + +try_function_name: + if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + call = zend_init_dynamic_call_string(Z_STR_P(function_name), opline->extended_value); + } else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT)) { + call = zend_init_dynamic_call_object(Z_OBJ_P(function_name), opline->extended_value); + } else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY)) { + call = zend_init_dynamic_call_array(Z_ARRVAL_P(function_name), opline->extended_value); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(function_name) == IS_REFERENCE)) { + function_name = Z_REFVAL_P(function_name); + goto try_function_name; + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + function_name = ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Value of type %s is not callable", + zend_zval_type_name(function_name)); + call = NULL; + } + + if (IS_CONST & (IS_VAR|IS_TMP_VAR)) { + + if (UNEXPECTED(EG(exception))) { + if (call) { + if (call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) { + zend_string_release_ex(call->func->common.function_name, 0); + zend_free_trampoline(call->func); + } + zend_vm_stack_free_call_frame(call); + } + HANDLE_EXCEPTION(); + } + } else if (!call) { + HANDLE_EXCEPTION(); + } + + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *func_name; + zval *func; + zend_function *fbc; + zend_execute_data *call; + + fbc = CACHED_PTR(opline->result.num); + if (UNEXPECTED(fbc == NULL)) { + func_name = (zval *)RT_CONSTANT(opline, opline->op2); + func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 1)); + if (func == NULL) { + func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 2)); + if (UNEXPECTED(func == NULL)) { + ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + } + fbc = Z_FUNC_P(func); + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + CACHE_PTR(opline->result.num, fbc); + } + + call = _zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION, + fbc, opline->extended_value, NULL); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *fname; + zval *func; + zend_function *fbc; + zend_execute_data *call; + + fbc = CACHED_PTR(opline->result.num); + if (UNEXPECTED(fbc == NULL)) { + fname = (zval*)RT_CONSTANT(opline, opline->op2); + func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname)); + ZEND_ASSERT(func != NULL && "Function existence must be checked at compile time"); + fbc = Z_FUNC_P(func); + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + CACHE_PTR(opline->result.num, fbc); + } + + call = _zend_vm_stack_push_call_frame_ex( + opline->op1.num, ZEND_CALL_NESTED_FUNCTION, + fbc, opline->extended_value, NULL); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + uint32_t arg_num; + zval *param; + + ZEND_VM_REPEATABLE_OPCODE + + arg_num = opline->op1.num; + param = EX_VAR(opline->result.var); + if (arg_num > EX_NUM_ARGS()) { + zval *default_value = RT_CONSTANT(opline, opline->op2); + + if (Z_OPT_TYPE_P(default_value) == IS_CONSTANT_AST) { + zval *cache_val = (zval*)CACHE_ADDR(Z_CACHE_SLOT_P(default_value)); + + /* we keep in cache only not refcounted values */ + if (Z_TYPE_P(cache_val) != IS_UNDEF) { + ZVAL_COPY_VALUE(param, cache_val); + } else { + SAVE_OPLINE(); + ZVAL_COPY(param, default_value); + zend_ast_evaluate_ctx ctx = {0}; + if (UNEXPECTED(zval_update_constant_with_ctx(param, EX(func)->op_array.scope, &ctx) != SUCCESS)) { + zval_ptr_dtor_nogc(param); + ZVAL_UNDEF(param); + HANDLE_EXCEPTION(); + } + if (!Z_REFCOUNTED_P(param) && !ctx.had_side_effects) { + ZVAL_COPY_VALUE(cache_val, param); + } + } + goto recv_init_check_type; + } else { + ZVAL_COPY(param, default_value); + } + } else { +recv_init_check_type: + if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) { + SAVE_OPLINE(); + if (UNEXPECTED(!zend_verify_recv_arg_type(EX(func), arg_num, param, CACHE_ADDR(opline->extended_value)))) { + HANDLE_EXCEPTION(); + } + } + } + + ZEND_VM_REPEAT_OPCODE(ZEND_RECV_INIT); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_execute_data *call; + + SAVE_OPLINE(); + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + +try_function_name: + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + call = zend_init_dynamic_call_string(Z_STR_P(function_name), opline->extended_value); + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT)) { + call = zend_init_dynamic_call_object(Z_OBJ_P(function_name), opline->extended_value); + } else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY)) { + call = zend_init_dynamic_call_array(Z_ARRVAL_P(function_name), opline->extended_value); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(function_name) == IS_REFERENCE)) { + function_name = Z_REFVAL_P(function_name); + goto try_function_name; + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + function_name = ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Value of type %s is not callable", + zend_zval_type_name(function_name)); + call = NULL; + } + + if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (UNEXPECTED(EG(exception))) { + if (call) { + if (call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) { + zend_string_release_ex(call->func->common.function_name, 0); + zend_free_trampoline(call->func); + } + zend_vm_stack_free_call_frame(call); + } + HANDLE_EXCEPTION(); + } + } else if (!call) { + HANDLE_EXCEPTION(); + } + + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + uint32_t arg_num = opline->op1.num; + zval *param; + + if (UNEXPECTED(arg_num > EX_NUM_ARGS())) { + ZEND_VM_TAIL_CALL(zend_missing_arg_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + param = EX_VAR(opline->result.var); + + if (UNEXPECTED(!(opline->op2.num & (1u << Z_TYPE_P(param))))) { + ZEND_VM_TAIL_CALL(zend_verify_recv_arg_type_helper_SPEC(param ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + uint32_t arg_num = opline->op1.num; + uint32_t arg_count = EX_NUM_ARGS(); + zval *params; + + SAVE_OPLINE(); + + params = EX_VAR(opline->result.var); + + if (arg_num <= arg_count) { + ZEND_ASSERT(EX(func)->common.fn_flags & ZEND_ACC_VARIADIC); + ZEND_ASSERT(EX(func)->common.num_args == arg_num - 1); + zend_arg_info *arg_info = &EX(func)->common.arg_info[arg_num - 1]; + + array_init_size(params, arg_count - arg_num + 1); + zend_hash_real_init_packed(Z_ARRVAL_P(params)); + ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(params)) { + zval *param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T); + if (UNEXPECTED(ZEND_TYPE_IS_SET(arg_info->type))) { + ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS); + do { + if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) { + ZEND_HASH_FILL_FINISH(); + HANDLE_EXCEPTION(); + } + + if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param); + ZEND_HASH_FILL_ADD(param); + param++; + } while (++arg_num <= arg_count); + } else { + do { + if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param); + ZEND_HASH_FILL_ADD(param); + param++; + } while (++arg_num <= arg_count); + } + } ZEND_HASH_FILL_END(); + } else { + ZVAL_EMPTY_ARRAY(params); + } + + if (EX_CALL_INFO() & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_string *name; + zval *param; + zend_arg_info *arg_info = &EX(func)->common.arg_info[EX(func)->common.num_args]; + if (ZEND_TYPE_IS_SET(arg_info->type)) { + SEPARATE_ARRAY(params); + ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EX(extra_named_params), name, param) { + if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) { + HANDLE_EXCEPTION(); + } + Z_TRY_ADDREF_P(param); + zend_hash_add_new(Z_ARRVAL_P(params), name, param); + } ZEND_HASH_FOREACH_END(); + } else if (zend_hash_num_elements(Z_ARRVAL_P(params)) == 0) { + GC_ADDREF(EX(extra_named_params)); + ZVAL_ARR(params, EX(extra_named_params)); + } else { + SEPARATE_ARRAY(params); + ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EX(extra_named_params), name, param) { + Z_TRY_ADDREF_P(param); + zend_hash_add_new(Z_ARRVAL_P(params), name, param); + } ZEND_HASH_FOREACH_END(); + } + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_execute_data *call; + + SAVE_OPLINE(); + function_name = EX_VAR(opline->op2.var); + +try_function_name: + if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + call = zend_init_dynamic_call_string(Z_STR_P(function_name), opline->extended_value); + } else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT)) { + call = zend_init_dynamic_call_object(Z_OBJ_P(function_name), opline->extended_value); + } else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY)) { + call = zend_init_dynamic_call_array(Z_ARRVAL_P(function_name), opline->extended_value); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(function_name) == IS_REFERENCE)) { + function_name = Z_REFVAL_P(function_name); + goto try_function_name; + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + function_name = ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Value of type %s is not callable", + zend_zval_type_name(function_name)); + call = NULL; + } + + if (IS_CV & (IS_VAR|IS_TMP_VAR)) { + + if (UNEXPECTED(EG(exception))) { + if (call) { + if (call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) { + zend_string_release_ex(call->func->common.function_name, 0); + zend_free_trampoline(call->func); + } + zend_vm_stack_free_call_frame(call); + } + HANDLE_EXCEPTION(); + } + } else if (!call) { + HANDLE_EXCEPTION(); + } + + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + + op1 = RT_CONSTANT(opline, opline->op1); + if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), ~Z_LVAL_P(op1)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_not_helper_SPEC(op1 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + + val = RT_CONSTANT(opline, opline->op1); + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + /* The result and op1 can be the same cv zval */ + const uint32_t orig_val_type = Z_TYPE_INFO_P(val); + ZVAL_TRUE(EX_VAR(opline->result.var)); + if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } else { + SAVE_OPLINE(); + ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *z; + + SAVE_OPLINE(); + z = RT_CONSTANT(opline, opline->op1); + + if (Z_TYPE_P(z) == IS_STRING) { + zend_string *str = Z_STR_P(z); + + if (ZSTR_LEN(str) != 0) { + zend_write(ZSTR_VAL(str), ZSTR_LEN(str)); + } + } else { + zend_string *str = zval_get_string_func(z); + + if (ZSTR_LEN(str) != 0) { + zend_write(ZSTR_VAL(str), ZSTR_LEN(str)); + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(z) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_string_release_ex(str, 0); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + uint8_t op1_type; + + val = RT_CONSTANT(opline, opline->op1); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + SAVE_OPLINE(); + op1_type = IS_CONST; + if (i_zend_is_true(val)) { + opline++; + } else { + opline = OP_JMP_ADDR(opline, opline->op2); + } + if (op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(val); + } + ZEND_VM_JMP(opline); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + uint8_t op1_type; + + val = RT_CONSTANT(opline, opline->op1); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + op1_type = IS_CONST; + if (i_zend_is_true(val)) { + opline = OP_JMP_ADDR(opline, opline->op2); + } else { + opline++; + } + if (op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(val); + } + ZEND_VM_JMP(opline); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + bool ret; + + val = RT_CONSTANT(opline, opline->op1); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + SAVE_OPLINE(); + ret = i_zend_is_true(val); + + if (ret) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + opline++; + } else { + ZVAL_FALSE(EX_VAR(opline->result.var)); + opline = OP_JMP_ADDR(opline, opline->op2); + } + ZEND_VM_JMP(opline); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + bool ret; + + val = RT_CONSTANT(opline, opline->op1); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + ret = i_zend_is_true(val); + + if (ret) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + opline = OP_JMP_ADDR(opline, opline->op2); + } else { + ZVAL_FALSE(EX_VAR(opline->result.var)); + opline++; + } + ZEND_VM_JMP(opline); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = RT_CONSTANT(opline, opline->op1); + return_value = EX(return_value); + + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (IS_CONST & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (IS_CONST == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (IS_CONST == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + + + + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + zval observer_retval; + + retval_ptr = get_zval_ptr_undef(opline->op1_type, opline->op1, BP_VAR_R); + return_value = EX(return_value); + if (!return_value) { return_value = &observer_retval; }; + if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((opline->op1_type & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (opline->op1_type == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (opline->op1_type == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (opline->op1_type == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + SAVE_OPLINE(); + zend_observer_fcall_end(execute_data, return_value); + if (return_value == &observer_retval) { zval_ptr_dtor_nogc(&observer_retval); }; + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + SAVE_OPLINE(); + + return_value = EX(return_value); + + do { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR)) || + (IS_CONST == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { + /* Not supposed to happen, but we'll allow it */ + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + + retval_ptr = RT_CONSTANT(opline, opline->op1); + if (!return_value) { + + } else { + if (IS_CONST == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + break; + } + + ZVAL_NEW_REF(return_value, retval_ptr); + if (IS_CONST == IS_CONST) { + Z_TRY_ADDREF_P(retval_ptr); + } + } + break; + } + + retval_ptr = zend_get_bad_ptr(); + + if (IS_CONST == IS_VAR) { + ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + if (return_value) { + ZVAL_NEW_REF(return_value, retval_ptr); + } else { + + } + break; + } + } + + if (return_value) { + if (Z_ISREF_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } else { + ZVAL_MAKE_REF_EX(retval_ptr, 2); + } + ZVAL_REF(return_value, Z_REF_P(retval_ptr)); + } + + } while (0); + + + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + zval observer_retval; + + SAVE_OPLINE(); + + return_value = EX(return_value); + if (!return_value) { return_value = &observer_retval; }; + do { + if ((opline->op1_type & (IS_CONST|IS_TMP_VAR)) || + (opline->op1_type == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { + /* Not supposed to happen, but we'll allow it */ + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + + retval_ptr = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); + if (!return_value) { + FREE_OP(opline->op1_type, opline->op1.var); + } else { + if (opline->op1_type == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + break; + } + + ZVAL_NEW_REF(return_value, retval_ptr); + if (opline->op1_type == IS_CONST) { + Z_TRY_ADDREF_P(retval_ptr); + } + } + break; + } + + retval_ptr = get_zval_ptr_ptr(opline->op1_type, opline->op1, BP_VAR_W); + + if (opline->op1_type == IS_VAR) { + ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + if (return_value) { + ZVAL_NEW_REF(return_value, retval_ptr); + } else { + FREE_OP(opline->op1_type, opline->op1.var); + } + break; + } + } + + if (return_value) { + if (Z_ISREF_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } else { + ZVAL_MAKE_REF_EX(retval_ptr, 2); + } + ZVAL_REF(return_value, Z_REF_P(retval_ptr)); + } + + FREE_OP(opline->op1_type, opline->op1.var); + } while (0); + + zend_observer_fcall_end(execute_data, return_value); + if (return_value == &observer_retval) { zval_ptr_dtor_nogc(&observer_retval); }; + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval; + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + retval = RT_CONSTANT(opline, opline->op1); + + /* Copy return value into generator->retval */ + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(&generator->retval, retval); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { + Z_ADDREF(generator->retval); + } + } + } else if (IS_CONST == IS_CV) { + ZVAL_COPY_DEREF(&generator->retval, retval); + } else /* if (IS_CONST == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_refcounted *ref = Z_COUNTED_P(retval); + + retval = Z_REFVAL_P(retval); + ZVAL_COPY_VALUE(&generator->retval, retval); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval)) { + Z_ADDREF_P(retval); + } + } else { + ZVAL_COPY_VALUE(&generator->retval, retval); + } + } + + EG(current_execute_data) = EX(prev_execute_data); + + /* Close the generator to free up resources */ + zend_generator_close(generator, 1); + + /* Pass execution back to handling code */ + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval; + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + retval = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); + + /* Copy return value into generator->retval */ + if ((opline->op1_type & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(&generator->retval, retval); + if (opline->op1_type == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { + Z_ADDREF(generator->retval); + } + } + } else if (opline->op1_type == IS_CV) { + ZVAL_COPY_DEREF(&generator->retval, retval); + } else /* if (opline->op1_type == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_refcounted *ref = Z_COUNTED_P(retval); + + retval = Z_REFVAL_P(retval); + ZVAL_COPY_VALUE(&generator->retval, retval); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval)) { + Z_ADDREF_P(retval); + } + } else { + ZVAL_COPY_VALUE(&generator->retval, retval); + } + } + + zend_observer_fcall_end(generator->execute_data, &generator->retval); + + EG(current_execute_data) = EX(prev_execute_data); + + /* Close the generator to free up resources */ + zend_generator_close(generator, 1); + + /* Pass execution back to handling code */ + ZEND_VM_RETURN(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op1); + + do { + if (IS_CONST == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + if (EXPECTED(Z_TYPE_P(value) == IS_OBJECT)) { + break; + } + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Can only throw objects"); + + HANDLE_EXCEPTION(); + } + } while (0); + + zend_exception_save(); + Z_TRY_ADDREF_P(value); + zend_throw_exception_object(value); + zend_exception_restore(); + + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_class_entry *ce, *catch_ce; + zend_object *exception; + + SAVE_OPLINE(); + /* Check whether an exception has been thrown, if not, jump over code */ + zend_exception_restore(); + if (EG(exception) == NULL) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + catch_ce = CACHED_PTR(opline->extended_value & ~ZEND_LAST_CATCH); + if (UNEXPECTED(catch_ce == NULL)) { + catch_ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD | ZEND_FETCH_CLASS_SILENT); + + CACHE_PTR(opline->extended_value & ~ZEND_LAST_CATCH, catch_ce); + } + ce = EG(exception)->ce; + +#ifdef HAVE_DTRACE + if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) { + DTRACE_EXCEPTION_CAUGHT((char *)ce->name); + } +#endif /* HAVE_DTRACE */ + + if (ce != catch_ce) { + if (!catch_ce || !instanceof_function(ce, catch_ce)) { + if (opline->extended_value & ZEND_LAST_CATCH) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION(); + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + } + + exception = EG(exception); + EG(exception) = NULL; + if (RETURN_VALUE_USED(opline)) { + /* Always perform a strict assignment. There is a reasonable expectation that if you + * write "catch (Exception $e)" then $e will actually be instanceof Exception. As such, + * we should not permit coercion to string here. */ + zval tmp; + ZVAL_OBJ(&tmp, exception); + zend_assign_to_variable(EX_VAR(opline->result.var), &tmp, IS_TMP_VAR, /* strict */ 1); + } else { + OBJ_RELEASE(exception); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_USER_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *arg, *param; + + SAVE_OPLINE(); + + arg = RT_CONSTANT(opline, opline->op1); + param = ZEND_CALL_VAR(EX(call), opline->result.var); + if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) { + zend_param_must_be_ref(EX(call)->func, opline->op2.num); + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } else { + ZVAL_COPY(param, arg); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + + val = RT_CONSTANT(opline, opline->op1); + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + /* The result and op1 can be the same cv zval */ + const uint32_t orig_val_type = Z_TYPE_INFO_P(val); + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } else { + SAVE_OPLINE(); + ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *obj; + zend_object *zobj; + zend_class_entry *ce, *scope; + zend_function *clone; + zend_object_clone_obj_t clone_call; + + SAVE_OPLINE(); + obj = RT_CONSTANT(opline, opline->op1); + + do { + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(obj)) { + obj = Z_REFVAL_P(obj); + if (EXPECTED(Z_TYPE_P(obj) == IS_OBJECT)) { + break; + } + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(obj) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "__clone method called on non-object"); + + HANDLE_EXCEPTION(); + } + } while (0); + + zobj = Z_OBJ_P(obj); + ce = zobj->ce; + clone = ce->clone; + clone_call = zobj->handlers->clone_obj; + if (UNEXPECTED(clone_call == NULL)) { + zend_throw_error(NULL, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (clone && !(clone->common.fn_flags & ZEND_ACC_PUBLIC)) { + scope = EX(func)->op_array.scope; + if (clone->common.scope != scope) { + if (UNEXPECTED(clone->common.fn_flags & ZEND_ACC_PRIVATE) + || UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) { + zend_wrong_clone_call(clone, scope); + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(zobj)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + zval *result = EX_VAR(opline->result.var); + HashTable *ht; + + SAVE_OPLINE(); + expr = RT_CONSTANT(opline, opline->op1); + + switch (opline->extended_value) { + case IS_LONG: + ZVAL_LONG(result, zval_get_long(expr)); + break; + case IS_DOUBLE: + ZVAL_DOUBLE(result, zval_get_double(expr)); + break; + case IS_STRING: + ZVAL_STR(result, zval_get_string(expr)); + break; + default: + ZEND_ASSERT(opline->extended_value != _IS_BOOL && "Must use ZEND_BOOL instead"); + if (IS_CONST & (IS_VAR|IS_CV)) { + ZVAL_DEREF(expr); + } + /* If value is already of correct type, return it directly */ + if (Z_TYPE_P(expr) == opline->extended_value) { + ZVAL_COPY_VALUE(result, expr); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (opline->extended_value == IS_ARRAY) { + if (IS_CONST == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) { + if (Z_TYPE_P(expr) != IS_NULL) { + ZVAL_ARR(result, zend_new_array(1)); + expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } else { + ZVAL_EMPTY_ARRAY(result); + } + } else if (Z_OBJ_P(expr)->properties == NULL + && Z_OBJ_HT_P(expr)->get_properties_for == NULL + && Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) { + /* Optimized version without rebuilding properties HashTable */ + ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr))); + } else { + HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST); + if (obj_ht) { + /* fast copy */ + ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht, + (Z_OBJCE_P(expr)->default_properties_count || + Z_OBJ_P(expr)->handlers != &std_object_handlers || + GC_IS_RECURSIVE(obj_ht)))); + zend_release_properties(obj_ht); + } else { + ZVAL_EMPTY_ARRAY(result); + } + } + } else { + ZEND_ASSERT(opline->extended_value == IS_OBJECT); + ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def)); + if (Z_TYPE_P(expr) == IS_ARRAY) { + ht = zend_symtable_to_proptable(Z_ARR_P(expr)); + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + /* TODO: try not to duplicate immutable arrays as well ??? */ + ht = zend_array_dup(ht); + } + Z_OBJ_P(result)->properties = ht; + } else if (Z_TYPE_P(expr) != IS_NULL) { + Z_OBJ_P(result)->properties = ht = zend_new_array(1); + expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } + } + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_op_array *new_op_array; + zval *inc_filename; + + SAVE_OPLINE(); + inc_filename = RT_CONSTANT(opline, opline->op1); + new_op_array = zend_include_or_eval(inc_filename, opline->extended_value); + if (UNEXPECTED(EG(exception) != NULL)) { + + if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) { + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (new_op_array == ZEND_FAKE_OP_ARRAY) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } + } else if (UNEXPECTED(new_op_array == NULL)) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } + } else if (new_op_array->last == 1 + && new_op_array->opcodes[0].opcode == ZEND_RETURN + && new_op_array->opcodes[0].op1_type == IS_CONST + && EXPECTED(zend_execute_ex == execute_ex)) { + if (RETURN_VALUE_USED(opline)) { + const zend_op *op = new_op_array->opcodes; + + ZVAL_COPY(EX_VAR(opline->result.var), RT_CONSTANT(op, op->op1)); + } + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } else { + zval *return_value = NULL; + zend_execute_data *call; + if (RETURN_VALUE_USED(opline)) { + return_value = EX_VAR(opline->result.var); + } + + new_op_array->scope = EX(func)->op_array.scope; + + call = zend_vm_stack_push_call_frame( + (Z_TYPE_INFO(EX(This)) & ZEND_CALL_HAS_THIS) | ZEND_CALL_NESTED_CODE | ZEND_CALL_HAS_SYMBOL_TABLE, + (zend_function*)new_op_array, 0, + Z_PTR(EX(This))); + + if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) { + call->symbol_table = EX(symbol_table); + } else { + call->symbol_table = zend_rebuild_symbol_table(); + } + + call->prev_execute_data = execute_data; + i_init_code_execute_data(call, new_op_array, return_value); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + + ZEND_VM_ENTER(); + } else { + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + zend_vm_stack_free_call_frame(call); + } + + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_op_array *new_op_array; + zval *inc_filename; + + SAVE_OPLINE(); + inc_filename = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); + new_op_array = zend_include_or_eval(inc_filename, opline->extended_value); + if (UNEXPECTED(EG(exception) != NULL)) { + FREE_OP(opline->op1_type, opline->op1.var); + if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) { + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (new_op_array == ZEND_FAKE_OP_ARRAY) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } + } else if (UNEXPECTED(new_op_array == NULL)) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } + } else if (new_op_array->last == 1 + && new_op_array->opcodes[0].opcode == ZEND_RETURN + && new_op_array->opcodes[0].op1_type == IS_CONST + && EXPECTED(zend_execute_ex == execute_ex)) { + if (RETURN_VALUE_USED(opline)) { + const zend_op *op = new_op_array->opcodes; + + ZVAL_COPY(EX_VAR(opline->result.var), RT_CONSTANT(op, op->op1)); + } + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } else { + zval *return_value = NULL; + zend_execute_data *call; + if (RETURN_VALUE_USED(opline)) { + return_value = EX_VAR(opline->result.var); + } + + new_op_array->scope = EX(func)->op_array.scope; + + call = zend_vm_stack_push_call_frame( + (Z_TYPE_INFO(EX(This)) & ZEND_CALL_HAS_THIS) | ZEND_CALL_NESTED_CODE | ZEND_CALL_HAS_SYMBOL_TABLE, + (zend_function*)new_op_array, 0, + Z_PTR(EX(This))); + + if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) { + call->symbol_table = EX(symbol_table); + } else { + call->symbol_table = zend_rebuild_symbol_table(); + } + + call->prev_execute_data = execute_data; + i_init_code_execute_data(call, new_op_array, return_value); + zend_observer_fcall_begin(call); + if (EXPECTED(zend_execute_ex == execute_ex)) { + FREE_OP(opline->op1_type, opline->op1.var); + ZEND_VM_ENTER(); + } else { + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + zend_vm_stack_free_call_frame(call); + } + + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + FREE_OP(opline->op1_type, opline->op1.var); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + FREE_OP(opline->op1_type, opline->op1.var); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array_ptr, *result; + + SAVE_OPLINE(); + + array_ptr = RT_CONSTANT(opline, opline->op1); + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (IS_CONST != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(array_ptr); + } + Z_FE_POS_P(result) = 0; + + ZEND_VM_NEXT_OPCODE(); + } else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + zend_object *zobj = Z_OBJ_P(array_ptr); + if (!zobj->ce->get_iterator) { + HashTable *properties = zobj->properties; + if (properties) { + if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(properties); + } + properties = zobj->properties = zend_array_dup(properties); + } + } else { + properties = zobj->handlers->get_properties(zobj); + } + + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (IS_CONST != IS_TMP_VAR) { + Z_ADDREF_P(array_ptr); + } + + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(result) = (uint32_t) -1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array_ptr, *array_ref; + + SAVE_OPLINE(); + + if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { + array_ref = array_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(array_ref)) { + array_ptr = Z_REFVAL_P(array_ref); + } + } else { + array_ref = array_ptr = RT_CONSTANT(opline, opline->op1); + } + + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ref = EX_VAR(opline->result.var); + ZVAL_NEW_REF(array_ref, array_ptr); + array_ptr = Z_REFVAL_P(array_ref); + } + if (IS_CONST == IS_CONST) { + ZVAL_ARR(array_ptr, zend_array_dup(Z_ARRVAL_P(array_ptr))); + } else { + SEPARATE_ARRAY(array_ptr); + } + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_ARRVAL_P(array_ptr), 0); + + ZEND_VM_NEXT_OPCODE(); + } else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + if (!Z_OBJCE_P(array_ptr)->get_iterator) { + HashTable *properties; + if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ptr = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(array_ptr, array_ref); + } + if (Z_OBJ_P(array_ptr)->properties + && UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(Z_OBJ_P(array_ptr)->properties); + } + Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties); + } + + properties = Z_OBJPROP_P(array_ptr); + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + bool ret; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op1); + + if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + ret = i_zend_is_true(value); + + if (UNEXPECTED(EG(exception))) { + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (ret) { + zval *result = EX_VAR(opline->result.var); + + ZVAL_COPY_VALUE(result, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_CONST == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if (IS_CONST == IS_VAR && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op1); + + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + if (IS_CONST & IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { + zval *result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_CONST == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if ((IS_CONST & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + if ((IS_CONST & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_NULL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val, *result; + + val = RT_CONSTANT(opline, opline->op1); + + if (Z_TYPE_P(val) > IS_NULL) { + do { + if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + if (Z_TYPE_P(val) <= IS_NULL) { + + break; + } + } + ZEND_VM_NEXT_OPCODE(); + } while (0); + } + + result = EX_VAR(opline->result.var); + uint32_t short_circuiting_type = opline->extended_value & ZEND_SHORT_CIRCUITING_CHAIN_MASK; + if (EXPECTED(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EXPR)) { + ZVAL_NULL(result); + if (IS_CONST == IS_CV + && UNEXPECTED(Z_TYPE_P(val) == IS_UNDEF) + && (opline->extended_value & ZEND_JMP_NULL_BP_VAR_IS) == 0 + ) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + } else if (short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_ISSET) { + ZVAL_FALSE(result); + } else { + ZEND_ASSERT(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EMPTY); + ZVAL_TRUE(result); + } + + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *result = EX_VAR(opline->result.var); + + value = RT_CONSTANT(opline, opline->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(result); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_CONST == IS_CV) { + ZVAL_COPY_DEREF(result, value); + } else if (IS_CONST == IS_VAR) { + if (UNEXPECTED(Z_ISREF_P(value))) { + ZVAL_COPY_VALUE(result, Z_REFVAL_P(value)); + if (UNEXPECTED(Z_DELREF_P(value) == 0)) { + efree_size(Z_REF_P(value), sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } else { + ZVAL_COPY_VALUE(result, value); + } + } else { + ZVAL_COPY_VALUE(result, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) { + Z_ADDREF_P(result); + } + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + do_bind_class(RT_CONSTANT(opline, opline->op1), (opline->op2_type == IS_CONST) ? Z_STR_P(RT_CONSTANT(opline, opline->op2)) : NULL); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_function *func; + zval *object; + zend_class_entry *called_scope; + + func = (zend_function *) EX(func)->op_array.dynamic_func_defs[opline->op2.num]; + if (Z_TYPE(EX(This)) == IS_OBJECT) { + called_scope = Z_OBJCE(EX(This)); + if (UNEXPECTED((func->common.fn_flags & ZEND_ACC_STATIC) || + (EX(func)->common.fn_flags & ZEND_ACC_STATIC))) { + object = NULL; + } else { + object = &EX(This); + } + } else { + called_scope = Z_CE(EX(This)); + object = NULL; + } + SAVE_OPLINE(); + zend_create_closure(EX_VAR(opline->result.var), func, + EX(func)->op_array.scope, called_scope, object); + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + zval *val; + + SAVE_OPLINE(); + val = RT_CONSTANT(opline, opline->op1); + + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator"); + + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + +yield_from_try_again: + if (Z_TYPE_P(val) == IS_ARRAY) { + ZVAL_COPY_VALUE(&generator->values, val); + if (Z_OPT_REFCOUNTED_P(val)) { + Z_ADDREF_P(val); + } + Z_FE_POS(generator->values) = 0; + + } else if (IS_CONST != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) { + zend_class_entry *ce = Z_OBJCE_P(val); + if (ce == zend_ce_generator) { + zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); + + Z_ADDREF_P(val); + + if (UNEXPECTED(new_gen->execute_data == NULL)) { + zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue"); + zval_ptr_dtor(val); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (Z_ISUNDEF(new_gen->retval)) { + if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) { + zend_throw_error(NULL, "Impossible to yield from the Generator being currently run"); + zval_ptr_dtor(val); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else { + zend_generator_yield_from(generator, new_gen); + } + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zend_object_iterator *iter = ce->get_iterator(ce, val, 0); + + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { + if (!EG(exception)) { + zend_throw_error(NULL, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + iter->index = 0; + if (iter->funcs->rewind) { + iter->funcs->rewind(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + OBJ_RELEASE(&iter->std); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + + ZVAL_OBJ(&generator->values, &iter->std); + } + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + goto yield_from_try_again; + } else { + zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables"); + + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ + if (RETURN_VALUE_USED(opline)) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + + /* This generator has no send target (though the generator we delegate to might have one) */ + generator->send_target = NULL; + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = RT_CONSTANT(opline, opline->op1); + if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value)); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(value); + } + ZEND_VM_NEXT_OPCODE(); + } else { + bool strict; + + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) { + value = Z_REFVAL_P(value); + if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value)); + + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + value = ZVAL_UNDEFINED_OP1(); + } + strict = EX_USES_STRICT_TYPES(); + do { + if (EXPECTED(!strict)) { + zend_string *str; + zval tmp; + + if (UNEXPECTED(Z_TYPE_P(value) == IS_NULL)) { + zend_error(E_DEPRECATED, + "strlen(): Passing null to parameter #1 ($string) of type string is deprecated"); + ZVAL_LONG(EX_VAR(opline->result.var), 0); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + break; + } + + ZVAL_COPY(&tmp, value); + if (zend_parse_arg_str_weak(&tmp, &str, 1)) { + ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str)); + zval_ptr_dtor(&tmp); + break; + } + zval_ptr_dtor(&tmp); + } + if (!EG(exception)) { + zend_type_error("strlen(): Argument #1 ($string) must be of type string, %s given", zend_zval_value_name(value)); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } while (0); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + int result = 0; + + value = RT_CONSTANT(opline, opline->op1); + if ((opline->extended_value >> (uint32_t)Z_TYPE_P(value)) & 1) { +type_check_resource: + if (opline->extended_value != MAY_BE_RESOURCE + || EXPECTED(NULL != zend_rsrc_list_get_rsrc_type(Z_RES_P(value)))) { + result = 1; + } + } else if ((IS_CONST & (IS_CV|IS_VAR)) && Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + if ((opline->extended_value >> (uint32_t)Z_TYPE_P(value)) & 1) { + goto type_check_resource; + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + result = ((1 << IS_NULL) & opline->extended_value) != 0; + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + + ZEND_VM_SMART_BRANCH(result, 1); + } else { + ZEND_VM_SMART_BRANCH(result, 0); + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DEFINED_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_constant *c; + + c = CACHED_PTR(opline->extended_value); + if (EXPECTED(c != NULL)) { + if (!IS_SPECIAL_CACHE_VAL(c)) { +defined_true: + ZEND_VM_SMART_BRANCH_TRUE(); + } else if (EXPECTED(zend_hash_num_elements(EG(zend_constants)) == DECODE_SPECIAL_CACHE_NUM(c))) { +defined_false: + ZEND_VM_SMART_BRANCH_FALSE(); + } + } + if (zend_quick_check_constant(RT_CONSTANT(opline, opline->op1) OPLINE_CC EXECUTE_DATA_CC) != SUCCESS) { + CACHE_PTR(opline->extended_value, ENCODE_SPECIAL_CACHE_NUM(zend_hash_num_elements(EG(zend_constants)))); + goto defined_false; + } else { + goto defined_true; + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_LONG_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(value)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_DOUBLE(EX_VAR(opline->result.var), Z_DVAL_P(value)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_NOREF_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_SIMPLE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + + value = RT_CONSTANT(opline, opline->op1); + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + ZVAL_COPY_VALUE(arg, value); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num = opline->op2.num; + + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(arg, value); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_add_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto add_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +add_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 + d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto add_double; + } + } + + ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto sub_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +sub_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 - d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto sub_double; + } + } + + ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + zend_long overflow; + + result = EX_VAR(opline->result.var); + ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow); + Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG; + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto mul_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +mul_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 * d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto mul_double; + } + } + + ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + div_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + if (UNEXPECTED(Z_LVAL_P(op2) == 0)) { + ZEND_VM_TAIL_CALL(zend_mod_by_zero_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) { + /* Prevent overflow error/crash if op1==ZEND_LONG_MIN */ + ZVAL_LONG(result, 0); + } else { + ZVAL_LONG(result, Z_LVAL_P(op1) % Z_LVAL_P(op2)); + } + ZEND_VM_NEXT_OPCODE(); + } + } + + ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + /* Perform shift on unsigned numbers to get well-defined wrap behavior. */ + ZVAL_LONG(EX_VAR(opline->result.var), + (zend_long) ((zend_ulong) Z_LVAL_P(op1) << Z_LVAL_P(op2))); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) >> Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + pow_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_identical_function(op1, op2); + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_not_identical_function(op1, op2); + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + compare_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) | Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) & Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) ^ Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + boolean_xor_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CONST, BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, IS_CONST OPLINE_CC EXECUTE_DATA_CC); + } + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + zend_fetch_dimension_address_read_IS(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_CONST == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, RT_CONSTANT(opline, opline->op2)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CONST == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CONST == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CONST == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + zend_fetch_dimension_address_LIST_r(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = RT_CONSTANT(opline, opline->op2); + if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CONST != IS_CONST && IS_CONST != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if (IS_CONST == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if (IS_CONST == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CONST != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST != IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + + if (IS_CONST != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_CONST == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_CONST & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (IS_CONST != IS_CONST) { + + } + HANDLE_EXCEPTION(); + } + } + if (IS_CONST == IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + zend_invalid_method_call(object, function_name); + + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (IS_CONST == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (IS_CONST == IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (IS_CONST == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (IS_CONST != IS_CONST) { + + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_CONST & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_CONST == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_CONST == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_CONST != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_CONST == IS_CONST && + IS_CONST == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_CONST != IS_CONST && + IS_CONST == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_CONST != IS_UNUSED) { + function_name = RT_CONSTANT(opline, opline->op2); + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_CONST & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_CONST == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_CONST != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_CONST == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_fcall_info_cache fcc; + char *error = NULL; + zend_function *func; + void *object_or_called_scope; + zend_execute_data *call; + uint32_t call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_DYNAMIC; + + SAVE_OPLINE(); + function_name = RT_CONSTANT(opline, opline->op2); + if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) { + ZEND_ASSERT(!error); + func = fcc.function_handler; + object_or_called_scope = fcc.called_scope; + if (func->common.fn_flags & ZEND_ACC_CLOSURE) { + /* Delay closure destruction until its invocation */ + GC_ADDREF(ZEND_CLOSURE_OBJECT(func)); + call_info |= ZEND_CALL_CLOSURE; + if (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) { + call_info |= ZEND_CALL_FAKE_CLOSURE; + } + if (fcc.object) { + object_or_called_scope = fcc.object; + call_info |= ZEND_CALL_HAS_THIS; + } + } else if (fcc.object) { + GC_ADDREF(fcc.object); /* For $this pointer */ + object_or_called_scope = fcc.object; + call_info |= ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_THIS; + } + + if ((IS_CONST & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) { + if (call_info & ZEND_CALL_CLOSURE) { + zend_object_release(ZEND_CLOSURE_OBJECT(func)); + } else if (call_info & ZEND_CALL_RELEASE_THIS) { + zend_object_release(fcc.object); + } + HANDLE_EXCEPTION(); + } + + if (EXPECTED(func->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&func->op_array))) { + init_func_run_time_cache(&func->op_array); + } + } else { + zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + efree(error); + + HANDLE_EXCEPTION(); + } + + call = zend_vm_stack_push_call_frame(call_info, + func, opline->extended_value, object_or_called_scope); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(arg, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_val_by_ref; + } + } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_val_by_ref: + ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(arg, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_class_entry *ce, *scope; + zend_class_constant *c; + zval *value, *zv, *constant_zv; + zend_string *constant_name; + USE_OPLINE + + SAVE_OPLINE(); + + do { + if (IS_CONST == IS_CONST && IS_CONST == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value + sizeof(void*)))) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + } + if (IS_CONST == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value))) { + ce = CACHED_PTR(opline->extended_value); + } else { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->extended_value, ce); + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + if (IS_CONST != IS_CONST + && IS_CONST == IS_CONST + && EXPECTED(CACHED_PTR(opline->extended_value) == ce)) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + + constant_zv = RT_CONSTANT(opline, opline->op2); + if (UNEXPECTED(Z_TYPE_P(constant_zv) != IS_STRING)) { + zend_invalid_class_constant_type_error(Z_TYPE_P(constant_zv)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + constant_name = Z_STR_P(constant_zv); + /* Magic 'class' for constant OP2 is caught at compile-time */ + if (IS_CONST != IS_CONST && UNEXPECTED(zend_string_equals_literal_ci(constant_name, "class"))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); + + ZEND_VM_NEXT_OPCODE(); + } + zv = IS_CONST == IS_CONST + ? zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), constant_name) + : zend_hash_find(CE_CONSTANTS_TABLE(ce), constant_name); + + if (EXPECTED(zv != NULL)) { + c = Z_PTR_P(zv); + scope = EX(func)->op_array.scope; + if (!zend_verify_const_access(c, scope)) { + zend_throw_error(NULL, "Cannot access %s constant %s::%s", zend_visibility_string(ZEND_CLASS_CONST_FLAGS(c)), ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + + if (ce->ce_flags & ZEND_ACC_TRAIT) { + zend_throw_error(NULL, "Cannot access trait constant %s::%s directly", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + + bool is_constant_deprecated = ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED; + if (UNEXPECTED(is_constant_deprecated)) { + zend_error(E_DEPRECATED, "Constant %s::%s is deprecated", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + + if (EG(exception)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + + value = &c->value; + // Enums require loading of all class constants to build the backed enum table + if (ce->ce_flags & ZEND_ACC_ENUM && ce->enum_backing_type != IS_UNDEF && ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { + if (UNEXPECTED(zend_update_class_constants(ce) == FAILURE)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + if (Z_TYPE_P(value) == IS_CONSTANT_AST) { + if (UNEXPECTED(zend_update_class_constant(c, constant_name, c->ce) != SUCCESS)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + if (IS_CONST == IS_CONST && !is_constant_deprecated) { + CACHE_POLYMORPHIC_PTR(opline->extended_value, ce, value); + } + } else { + zend_throw_error(NULL, "Undefined constant %s::%s", + ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } while (0); + + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), value); + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + + } else { + expr_ptr = RT_CONSTANT(opline, opline->op1); + if (IS_CONST == IS_TMP_VAR) { + /* pass */ + } else if (IS_CONST == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_CONST == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_CONST == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_CONST != IS_UNUSED) { + zval *offset = RT_CONSTANT(opline, opline->op2); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_CONST != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + offset = RT_CONSTANT(opline, opline->op2); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, IS_CONST == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if (IS_CONST & (IS_CONST|IS_CV)) { + /* avoid exception check */ + + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + offset = RT_CONSTANT(opline, opline->op2); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = RT_CONSTANT(opline, opline->op1); + subject = RT_CONSTANT(opline, opline->op2); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CLASS_DELAYED_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_class_entry *ce = CACHED_PTR(opline->extended_value); + if (ce == NULL) { + zval *lcname = RT_CONSTANT(opline, opline->op1); + zval *zv = zend_hash_find_known_hash(EG(class_table), Z_STR_P(lcname + 1)); + if (zv) { + SAVE_OPLINE(); + ce = zend_bind_class_in_slot(zv, lcname, Z_STR_P(RT_CONSTANT(opline, opline->op2))); + if (!ce) { + HANDLE_EXCEPTION(); + } + } + CACHE_PTR(opline->extended_value, ce); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *name; + zval *val; + zend_constant c; + + SAVE_OPLINE(); + name = RT_CONSTANT(opline, opline->op1); + val = RT_CONSTANT(opline, opline->op2); + + ZVAL_COPY(&c.value, val); + if (Z_OPT_CONSTANT(c.value)) { + if (UNEXPECTED(zval_update_constant_ex(&c.value, EX(func)->op_array.scope) != SUCCESS)) { + zval_ptr_dtor_nogc(&c.value); + + + HANDLE_EXCEPTION(); + } + } + /* non persistent, case sensitive */ + ZEND_CONSTANT_SET_FLAGS(&c, 0, PHP_USER_CONSTANT); + c.name = zend_string_copy(Z_STR_P(name)); + + if (zend_register_constant(&c) == FAILURE) { + } + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_CONST != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = zend_get_bad_ptr(); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_CONST == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = RT_CONSTANT(opline, opline->op1); + + /* Consts, temporary variables and references need copying */ + if (IS_CONST == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_CONST == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CONST == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CONST != IS_UNUSED) { + zval *key = RT_CONSTANT(opline, opline->op2); + if ((IS_CONST & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_LONG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = RT_CONSTANT(opline, opline->op1); + + if (Z_TYPE_P(op) != IS_LONG) { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_LONG) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } + } + + jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(op)); + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_STRING_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = RT_CONSTANT(opline, opline->op1); + + if (Z_TYPE_P(op) != IS_STRING) { + if (IS_CONST == IS_CONST) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } else { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_STRING) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } + } + } + + jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(op), IS_CONST == IS_CONST); + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MATCH_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = RT_CONSTANT(opline, opline->op1); + jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + +match_try_again: + if (Z_TYPE_P(op) == IS_LONG) { + jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(op)); + } else if (Z_TYPE_P(op) == IS_STRING) { + jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(op), IS_CONST == IS_CONST); + } else if (Z_TYPE_P(op) == IS_REFERENCE) { + op = Z_REFVAL_P(op); + goto match_try_again; + } else { + if (UNEXPECTED((IS_CONST & IS_CV) && Z_TYPE_P(op) == IS_UNDEF)) { + SAVE_OPLINE(); + op = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + goto match_try_again; + } + + goto default_branch; + } + + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { +default_branch: + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + zval *result; + + op1 = RT_CONSTANT(opline, opline->op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find_ex(ht, Z_STR_P(op1), IS_CONST == IS_CONST); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + ZEND_VM_SMART_BRANCH(result, 0); + } + + if (opline->extended_value) { + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + ZEND_VM_SMART_BRANCH(result, 0); + } + SAVE_OPLINE(); + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + + ZEND_VM_SMART_BRANCH(result, 0); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + + ZEND_VM_SMART_BRANCH(result, 0); + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + } else if (Z_TYPE_P(op1) <= IS_FALSE) { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC()); + ZEND_VM_SMART_BRANCH(result, 0); + } else { + zend_string *key; + zval key_tmp; + + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + + ZEND_VM_SMART_BRANCH(result, 0); + } + } + + SAVE_OPLINE(); + ZEND_HASH_MAP_FOREACH_STR_KEY(ht, key) { + ZVAL_STR(&key_tmp, key); + if (zend_compare(op1, &key_tmp) == 0) { + + ZEND_VM_SMART_BRANCH(1, 1); + } + } ZEND_HASH_FOREACH_END(); + } + + ZEND_VM_SMART_BRANCH(0, 1); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_add_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto add_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +add_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 + d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto add_double; + } + } + + ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto sub_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +sub_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 - d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto sub_double; + } + } + + ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + if (UNEXPECTED(Z_LVAL_P(op2) == 0)) { + ZEND_VM_TAIL_CALL(zend_mod_by_zero_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) { + /* Prevent overflow error/crash if op1==ZEND_LONG_MIN */ + ZVAL_LONG(result, 0); + } else { + ZVAL_LONG(result, Z_LVAL_P(op1) % Z_LVAL_P(op2)); + } + ZEND_VM_NEXT_OPCODE(); + } + } + + ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + /* Perform shift on unsigned numbers to get well-defined wrap behavior. */ + ZVAL_LONG(EX_VAR(opline->result.var), + (zend_long) ((zend_ulong) Z_LVAL_P(op1) << Z_LVAL_P(op2))); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) >> Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_class_entry *ce, *scope; + zend_class_constant *c; + zval *value, *zv, *constant_zv; + zend_string *constant_name; + USE_OPLINE + + SAVE_OPLINE(); + + do { + if (IS_CONST == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value + sizeof(void*)))) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + } + if (IS_CONST == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value))) { + ce = CACHED_PTR(opline->extended_value); + } else { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->extended_value, ce); + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + if (IS_CONST != IS_CONST + && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST + && EXPECTED(CACHED_PTR(opline->extended_value) == ce)) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + + constant_zv = _get_zval_ptr_tmpvarcv(opline->op2_type, opline->op2, BP_VAR_R EXECUTE_DATA_CC); + if (UNEXPECTED(Z_TYPE_P(constant_zv) != IS_STRING)) { + zend_invalid_class_constant_type_error(Z_TYPE_P(constant_zv)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + constant_name = Z_STR_P(constant_zv); + /* Magic 'class' for constant OP2 is caught at compile-time */ + if ((IS_TMP_VAR|IS_VAR|IS_CV) != IS_CONST && UNEXPECTED(zend_string_equals_literal_ci(constant_name, "class"))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); + FREE_OP(opline->op2_type, opline->op2.var); + ZEND_VM_NEXT_OPCODE(); + } + zv = (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST + ? zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), constant_name) + : zend_hash_find(CE_CONSTANTS_TABLE(ce), constant_name); + + if (EXPECTED(zv != NULL)) { + c = Z_PTR_P(zv); + scope = EX(func)->op_array.scope; + if (!zend_verify_const_access(c, scope)) { + zend_throw_error(NULL, "Cannot access %s constant %s::%s", zend_visibility_string(ZEND_CLASS_CONST_FLAGS(c)), ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + + if (ce->ce_flags & ZEND_ACC_TRAIT) { + zend_throw_error(NULL, "Cannot access trait constant %s::%s directly", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + + bool is_constant_deprecated = ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED; + if (UNEXPECTED(is_constant_deprecated)) { + zend_error(E_DEPRECATED, "Constant %s::%s is deprecated", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + + if (EG(exception)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + + value = &c->value; + // Enums require loading of all class constants to build the backed enum table + if (ce->ce_flags & ZEND_ACC_ENUM && ce->enum_backing_type != IS_UNDEF && ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { + if (UNEXPECTED(zend_update_class_constants(ce) == FAILURE)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + if (Z_TYPE_P(value) == IS_CONSTANT_AST) { + if (UNEXPECTED(zend_update_class_constant(c, constant_name, c->ce) != SUCCESS)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + if ((IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && !is_constant_deprecated) { + CACHE_POLYMORPHIC_PTR(opline->extended_value, ce, value); + } + } else { + zend_throw_error(NULL, "Undefined constant %s::%s", + ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } while (0); + + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), value); + + FREE_OP(opline->op2_type, opline->op2.var); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) - Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + zend_long offset; + HashTable *ht; + + container = RT_CONSTANT(opline, opline->op1); + dim = EX_VAR(opline->op2.var); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_index_array: + if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) { + offset = Z_LVAL_P(dim); + } else { + SAVE_OPLINE(); + zend_fetch_dimension_address_read_R(container, dim, (IS_TMP_VAR|IS_VAR|IS_CV) OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ht = Z_ARRVAL_P(container); + ZEND_HASH_INDEX_FIND(ht, offset, value, fetch_dim_r_index_undef); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_index_array; + } else { + goto fetch_dim_r_index_slow; + } + } else { +fetch_dim_r_index_slow: + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + +fetch_dim_r_index_undef: + ZVAL_NULL(EX_VAR(opline->result.var)); + SAVE_OPLINE(); + zend_undefined_offset(offset); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + div_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + pow_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + ((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CONST != IS_CONST && IS_CONST != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + compare_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (IS_CONST != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, (IS_TMP_VAR|IS_VAR), BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + zend_fetch_dimension_address_read_IS(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + zend_fetch_dimension_address_LIST_r(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + ((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CONST != IS_CONST && IS_CONST != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if (IS_CONST == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = RT_CONSTANT(opline, opline->op1); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_CONST == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_CONST & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + HANDLE_EXCEPTION(); + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + zend_invalid_method_call(object, function_name); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_CONST & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_CONST == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_CONST == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_CONST == IS_CONST && + (IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_CONST != IS_CONST && + (IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_CONST == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_fcall_info_cache fcc; + char *error = NULL; + zend_function *func; + void *object_or_called_scope; + zend_execute_data *call; + uint32_t call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_DYNAMIC; + + SAVE_OPLINE(); + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) { + ZEND_ASSERT(!error); + func = fcc.function_handler; + object_or_called_scope = fcc.called_scope; + if (func->common.fn_flags & ZEND_ACC_CLOSURE) { + /* Delay closure destruction until its invocation */ + GC_ADDREF(ZEND_CLOSURE_OBJECT(func)); + call_info |= ZEND_CALL_CLOSURE; + if (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) { + call_info |= ZEND_CALL_FAKE_CLOSURE; + } + if (fcc.object) { + object_or_called_scope = fcc.object; + call_info |= ZEND_CALL_HAS_THIS; + } + } else if (fcc.object) { + GC_ADDREF(fcc.object); /* For $this pointer */ + object_or_called_scope = fcc.object; + call_info |= ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_THIS; + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) { + if (call_info & ZEND_CALL_CLOSURE) { + zend_object_release(ZEND_CLOSURE_OBJECT(func)); + } else if (call_info & ZEND_CALL_RELEASE_THIS) { + zend_object_release(fcc.object); + } + HANDLE_EXCEPTION(); + } + + if (EXPECTED(func->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&func->op_array))) { + init_func_run_time_cache(&func->op_array); + } + } else { + zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + efree(error); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + + call = zend_vm_stack_push_call_frame(call_info, + func, opline->extended_value, object_or_called_scope); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + + } else { + expr_ptr = RT_CONSTANT(opline, opline->op1); + if (IS_CONST == IS_TMP_VAR) { + /* pass */ + } else if (IS_CONST == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_CONST == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_CONST == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_CONST != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, (IS_TMP_VAR|IS_VAR) == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if (IS_CONST & (IS_CONST|IS_CV)) { + /* avoid exception check */ + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = RT_CONSTANT(opline, opline->op1); + subject = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_CONST != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = zend_get_bad_ptr(); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_CONST == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = RT_CONSTANT(opline, opline->op1); + + /* Consts, temporary variables and references need copying */ + if (IS_CONST == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_CONST == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CONST == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *key = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int type ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + zval *varname; + zval *retval; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + varname = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + tmp_name = NULL; + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + if (!(opline->extended_value & ZEND_FETCH_GLOBAL_LOCK)) { + + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + retval = zend_hash_find_ex(target_symbol_table, name, IS_CONST == IS_CONST); + if (retval == NULL) { + if (UNEXPECTED(zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS)))) { +fetch_this: + zend_fetch_this_var(type OPLINE_CC EXECUTE_DATA_CC); + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + if (type == BP_VAR_W) { + retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval)); + } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) { + retval = &EG(uninitialized_zval); + } else { + if (IS_CONST == IS_CV) { + /* Keep name alive in case an error handler tries to free it. */ + zend_string_addref(name); + } + zend_error(E_WARNING, "Undefined %svariable $%s", + (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name)); + if (type == BP_VAR_RW && !EG(exception)) { + retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval)); + } else { + retval = &EG(uninitialized_zval); + } + if (IS_CONST == IS_CV) { + zend_string_release(name); + } + } + /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */ + } else if (Z_TYPE_P(retval) == IS_INDIRECT) { + retval = Z_INDIRECT_P(retval); + if (Z_TYPE_P(retval) == IS_UNDEF) { + if (UNEXPECTED(zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS)))) { + goto fetch_this; + } + if (type == BP_VAR_W) { + ZVAL_NULL(retval); + } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) { + retval = &EG(uninitialized_zval); + } else { + zend_error(E_WARNING, "Undefined %svariable $%s", + (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name)); + if (type == BP_VAR_RW && !EG(exception)) { + ZVAL_NULL(retval); + } else { + retval = &EG(uninitialized_zval); + } + } + } + } + + if (!(opline->extended_value & ZEND_FETCH_GLOBAL_LOCK)) { + + } + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + ZEND_ASSERT(retval != NULL); + if (type == BP_VAR_R || type == BP_VAR_IS) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else { + ZVAL_INDIRECT(EX_VAR(opline->result.var), retval); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + int fetch_type = + (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ? + BP_VAR_W : BP_VAR_R; + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(fetch_type ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_UNUSED == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_CONST == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_UNUSED != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_CONST == IS_CONST && + IS_UNUSED == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_CONST != IS_CONST && + IS_UNUSED == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_UNUSED != IS_UNUSED) { + function_name = NULL; + if (IS_UNUSED != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_UNUSED & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_UNUSED == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_UNUSED != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_CONST == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + if (IS_CONST == IS_UNUSED) { + SAVE_OPLINE(); + zend_verify_missing_return_type(EX(func)); + HANDLE_EXCEPTION(); + } else { +/* prevents "undefined variable opline" errors */ +#if 0 || (IS_CONST != IS_UNUSED) + USE_OPLINE + zval *retval_ref, *retval_ptr; + zend_arg_info *ret_info = EX(func)->common.arg_info - 1; + retval_ref = retval_ptr = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST) { + ZVAL_COPY(EX_VAR(opline->result.var), retval_ptr); + retval_ref = retval_ptr = EX_VAR(opline->result.var); + } else if (IS_CONST == IS_VAR) { + if (UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_INDIRECT)) { + retval_ref = retval_ptr = Z_INDIRECT_P(retval_ptr); + } + ZVAL_DEREF(retval_ptr); + } else if (IS_CONST == IS_CV) { + ZVAL_DEREF(retval_ptr); + } + + if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(retval_ptr)))) { + ZEND_VM_NEXT_OPCODE(); + } + + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) { + SAVE_OPLINE(); + retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) { + ZEND_VM_NEXT_OPCODE(); + } + } + + zend_reference *ref = NULL; + void *cache_slot = CACHE_ADDR(opline->op2.num); + if (UNEXPECTED(retval_ref != retval_ptr)) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + ref = Z_REF_P(retval_ref); + } else { + /* A cast might happen - unwrap the reference if this is a by-value return */ + if (Z_REFCOUNT_P(retval_ref) == 1) { + ZVAL_UNREF(retval_ref); + } else { + Z_DELREF_P(retval_ref); + ZVAL_COPY(retval_ref, retval_ptr); + } + retval_ptr = retval_ref; + } + } + + SAVE_OPLINE(); + if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) { + zend_verify_return_error(EX(func), retval_ptr); + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +#endif + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(arg, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(0)) { + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_val_by_ref; + } + } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_val_by_ref: + ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(arg, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(1)) { + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_val_by_ref; + } + } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_val_by_ref: + ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(arg, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *result; + zend_function *constructor; + zend_class_entry *ce; + zend_execute_data *call; + + SAVE_OPLINE(); + if (IS_CONST == IS_CONST) { + ce = CACHED_PTR(opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->op2.num, ce); + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + result = EX_VAR(opline->result.var); + if (UNEXPECTED(object_init_ex(result, ce) != SUCCESS)) { + ZVAL_UNDEF(result); + HANDLE_EXCEPTION(); + } + + constructor = Z_OBJ_HT_P(result)->get_constructor(Z_OBJ_P(result)); + if (constructor == NULL) { + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + + /* If there are no arguments, skip over the DO_FCALL opcode. We check if the next + * opcode is DO_FCALL in case EXT instructions are used. */ + if (EXPECTED(opline->extended_value == 0 && (opline+1)->opcode == ZEND_DO_FCALL)) { + ZEND_VM_NEXT_OPCODE_EX(1, 2); + } + + /* Perform a dummy function call */ + call = zend_vm_stack_push_call_frame( + ZEND_CALL_FUNCTION, (zend_function *) &zend_pass_function, + opline->extended_value, NULL); + } else { + if (EXPECTED(constructor->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&constructor->op_array))) { + init_func_run_time_cache(&constructor->op_array); + } + /* We are not handling overloaded classes right now */ + call = zend_vm_stack_push_call_frame( + ZEND_CALL_FUNCTION | ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_THIS, + constructor, + opline->extended_value, + Z_OBJ_P(result)); + Z_ADDREF_P(result); + } + + call->prev_execute_data = EX(call); + EX(call) = call; + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + + } else { + expr_ptr = RT_CONSTANT(opline, opline->op1); + if (IS_CONST == IS_TMP_VAR) { + /* pass */ + } else if (IS_CONST == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_CONST == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_CONST == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_UNUSED != IS_UNUSED) { + zval *offset = NULL; + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_UNUSED != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_UNUSED == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_CONST != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varname; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + + varname = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + tmp_name = NULL; + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + varname = ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + + HANDLE_EXCEPTION(); + } + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + zend_hash_del_ind(target_symbol_table, name); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + /* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */ + int result; + zval *varname; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + varname = RT_CONSTANT(opline, opline->op1); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(varname); + } else { + name = zval_get_tmp_string(varname, &tmp_name); + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + value = zend_hash_find_ex(target_symbol_table, name, IS_CONST == IS_CONST); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (!value) { + result = (opline->extended_value & ZEND_ISEMPTY); + } else { + if (Z_TYPE_P(value) == IS_INDIRECT) { + value = Z_INDIRECT_P(value); + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + if (Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + } + result = Z_TYPE_P(value) > IS_NULL; + } else { + result = !i_zend_is_true(value); + } + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_CONST != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = zend_get_bad_ptr(); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_CONST == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = RT_CONSTANT(opline, opline->op1); + + /* Consts, temporary variables and references need copying */ + if (IS_CONST == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_CONST == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CONST == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_UNUSED != IS_UNUSED) { + zval *key = NULL; + if ((IS_UNUSED & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MATCH_ERROR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op; + + SAVE_OPLINE(); + op = RT_CONSTANT(opline, opline->op1); + zend_match_unhandled_error(op); + HANDLE_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + zend_long count; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + + while (1) { + if (Z_TYPE_P(op1) == IS_ARRAY) { + count = zend_hash_num_elements(Z_ARRVAL_P(op1)); + break; + } else if (Z_TYPE_P(op1) == IS_OBJECT) { + zend_object *zobj = Z_OBJ_P(op1); + + /* first, we check if the handler is defined */ + if (zobj->handlers->count_elements) { + if (SUCCESS == zobj->handlers->count_elements(zobj, &count)) { + break; + } + if (UNEXPECTED(EG(exception))) { + count = 0; + break; + } + } + + /* if not and the object implements Countable we call its count() method */ + if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) { + zval retval; + + zend_function *count_fn = zend_hash_find_ptr(&zobj->ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); + zend_call_known_instance_method_with_0_params(count_fn, zobj, &retval); + count = zval_get_long(&retval); + zval_ptr_dtor(&retval); + break; + } + + /* If There's no handler and it doesn't implement Countable then emit a TypeError */ + } else if ((IS_CONST & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + count = 0; + zend_type_error("%s(): Argument #1 ($value) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_value_name(op1)); + break; + } + + ZVAL_LONG(EX_VAR(opline->result.var), count); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (IS_CONST == IS_UNUSED) { + SAVE_OPLINE(); + if (UNEXPECTED(!EX(func)->common.scope)) { + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } else { + zend_error(E_DEPRECATED, "Calling get_class() without arguments is deprecated"); + ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zval *op1; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + while (1) { + if (Z_TYPE_P(op1) == IS_OBJECT) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op1)->name); + } else if ((IS_CONST & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_value_name(op1)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } + break; + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_TYPE_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + zend_string *type; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + type = zend_zval_get_legacy_type(op1); + if (EXPECTED(type)) { + ZVAL_INTERNED_STR(EX_VAR(opline->result.var), type); + } else { + ZVAL_STRING(EX_VAR(opline->result.var), "unknown type"); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_array *ht; + uint32_t arg_count, result_size, skip; + + arg_count = EX_NUM_ARGS(); + if (IS_CONST == IS_CONST) { + skip = Z_LVAL_P(RT_CONSTANT(opline, opline->op1)); + if (arg_count < skip) { + result_size = 0; + } else { + result_size = arg_count - skip; + } + } else { + skip = 0; + result_size = arg_count; + } + + if (result_size) { + SAVE_OPLINE(); + uint32_t first_extra_arg = EX(func)->op_array.num_args; + + ht = zend_new_array(result_size); + ZVAL_ARR(EX_VAR(opline->result.var), ht); + zend_hash_real_init_packed(ht); + ZEND_HASH_FILL_PACKED(ht) { + zval *p, *q; + uint32_t i = skip; + p = EX_VAR_NUM(i); + if (arg_count > first_extra_arg) { + while (i < first_extra_arg) { + q = p; + if (EXPECTED(Z_TYPE_INFO_P(q) != IS_UNDEF)) { + ZVAL_DEREF(q); + if (Z_OPT_REFCOUNTED_P(q)) { + Z_ADDREF_P(q); + } + ZEND_HASH_FILL_SET(q); + } else { + ZEND_HASH_FILL_SET_NULL(); + } + ZEND_HASH_FILL_NEXT(); + p++; + i++; + } + if (skip < first_extra_arg) { + skip = 0; + } else { + skip -= first_extra_arg; + } + p = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T + skip); + } + while (i < arg_count) { + q = p; + if (EXPECTED(Z_TYPE_INFO_P(q) != IS_UNDEF)) { + ZVAL_DEREF(q); + if (Z_OPT_REFCOUNTED_P(q)) { + Z_ADDREF_P(q); + } + ZEND_HASH_FILL_SET(q); + } else { + ZEND_HASH_FILL_SET_NULL(); + } + ZEND_HASH_FILL_NEXT(); + p++; + i++; + } + } ZEND_HASH_FILL_END(); + ht->nNumOfElements = result_size; + } else { + ZVAL_EMPTY_ARRAY(EX_VAR(opline->result.var)); + } + ZEND_VM_NEXT_OPCODE(); +} + +/* Contrary to what its name indicates, ZEND_COPY_TMP may receive and define references. */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + div_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + pow_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + + if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CONST != IS_CONST && IS_CONST != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = RT_CONSTANT(opline, opline->op1); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + compare_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + dim = EX_VAR(opline->op2.var); + if (IS_CONST != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CV, BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, IS_CV OPLINE_CC EXECUTE_DATA_CC); + } + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + zend_fetch_dimension_address_read_IS(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_CV == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CV == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CV == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CV == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CONST & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + zend_fetch_dimension_address_LIST_r(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = RT_CONSTANT(opline, opline->op1); + op2 = EX_VAR(opline->op2.var); + if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CONST != IS_CONST && IS_CONST != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if (IS_CONST == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if (IS_CV == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if (IS_CV != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = RT_CONSTANT(opline, opline->op1); + + if (IS_CV != IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + + if (IS_CV != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_CONST == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_CONST & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (IS_CV != IS_CONST) { + + } + HANDLE_EXCEPTION(); + } + } + if (IS_CV == IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + zend_invalid_method_call(object, function_name); + + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (IS_CV == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (IS_CV == IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (IS_CV == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (IS_CV != IS_CONST) { + + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_CONST & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_CONST == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_CONST == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_CV != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_CONST == IS_CONST && + IS_CV == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_CONST != IS_CONST && + IS_CV == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_CV != IS_UNUSED) { + function_name = EX_VAR(opline->op2.var); + if (IS_CV != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_CV & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_CV == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_CV != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_CONST == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_fcall_info_cache fcc; + char *error = NULL; + zend_function *func; + void *object_or_called_scope; + zend_execute_data *call; + uint32_t call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_DYNAMIC; + + SAVE_OPLINE(); + function_name = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) { + ZEND_ASSERT(!error); + func = fcc.function_handler; + object_or_called_scope = fcc.called_scope; + if (func->common.fn_flags & ZEND_ACC_CLOSURE) { + /* Delay closure destruction until its invocation */ + GC_ADDREF(ZEND_CLOSURE_OBJECT(func)); + call_info |= ZEND_CALL_CLOSURE; + if (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) { + call_info |= ZEND_CALL_FAKE_CLOSURE; + } + if (fcc.object) { + object_or_called_scope = fcc.object; + call_info |= ZEND_CALL_HAS_THIS; + } + } else if (fcc.object) { + GC_ADDREF(fcc.object); /* For $this pointer */ + object_or_called_scope = fcc.object; + call_info |= ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_THIS; + } + + if ((IS_CV & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) { + if (call_info & ZEND_CALL_CLOSURE) { + zend_object_release(ZEND_CLOSURE_OBJECT(func)); + } else if (call_info & ZEND_CALL_RELEASE_THIS) { + zend_object_release(fcc.object); + } + HANDLE_EXCEPTION(); + } + + if (EXPECTED(func->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&func->op_array))) { + init_func_run_time_cache(&func->op_array); + } + } else { + zend_type_error("%s(): Argument #1 ($callback) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + efree(error); + + HANDLE_EXCEPTION(); + } + + call = zend_vm_stack_push_call_frame(call_info, + func, opline->extended_value, object_or_called_scope); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + + } else { + expr_ptr = RT_CONSTANT(opline, opline->op1); + if (IS_CONST == IS_TMP_VAR) { + /* pass */ + } else if (IS_CONST == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_CONST == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_CONST == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_CV != IS_UNUSED) { + zval *offset = EX_VAR(opline->op2.var); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_CONST != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + offset = EX_VAR(opline->op2.var); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, IS_CV == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if (IS_CONST & (IS_CONST|IS_CV)) { + /* avoid exception check */ + + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = RT_CONSTANT(opline, opline->op1); + offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + if (IS_CONST == IS_CONST || + (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = RT_CONSTANT(opline, opline->op1); + subject = EX_VAR(opline->op2.var); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_CONST != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_CONST & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = RT_CONSTANT(opline, opline->op1); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = zend_get_bad_ptr(); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_CONST == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = RT_CONSTANT(opline, opline->op1); + + /* Consts, temporary variables and references need copying */ + if (IS_CONST == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_CONST == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CONST == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CV != IS_UNUSED) { + zval *key = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + if ((IS_CV & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_NOT_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + + op1 = EX_VAR(opline->op1.var); + if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), ~Z_LVAL_P(op1)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_not_helper_SPEC(op1 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = EX_VAR(opline->op1.var); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(value)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = EX_VAR(opline->op1.var); + ZVAL_DOUBLE(EX_VAR(opline->result.var), Z_DVAL_P(value)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = EX_VAR(opline->op1.var); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_add_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto add_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +add_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 + d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto add_double; + } + } + + ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto sub_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +sub_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 - d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto sub_double; + } + } + + ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + zend_long overflow; + + result = EX_VAR(opline->result.var); + ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow); + Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG; + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto mul_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +mul_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 * d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto mul_double; + } + } + + ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + if (UNEXPECTED(Z_LVAL_P(op2) == 0)) { + ZEND_VM_TAIL_CALL(zend_mod_by_zero_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) { + /* Prevent overflow error/crash if op1==ZEND_LONG_MIN */ + ZVAL_LONG(result, 0); + } else { + ZVAL_LONG(result, Z_LVAL_P(op1) % Z_LVAL_P(op2)); + } + ZEND_VM_NEXT_OPCODE(); + } + } + + ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + /* Perform shift on unsigned numbers to get well-defined wrap behavior. */ + ZVAL_LONG(EX_VAR(opline->result.var), + (zend_long) ((zend_ulong) Z_LVAL_P(op1) << Z_LVAL_P(op2))); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) >> Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) | Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) & Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) ^ Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_LIST_r(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = EX_VAR(opline->op1.var); + + if (Z_TYPE_P(op) != IS_LONG) { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_LONG) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } + } + + jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(op)); + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = EX_VAR(opline->op1.var); + + if (Z_TYPE_P(op) != IS_STRING) { + if ((IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } else { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_STRING) { + /* Wrong type, fall back to ZEND_CASE chain */ + ZEND_VM_NEXT_OPCODE(); + } + } + } + + jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(op), (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST); + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MATCH_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op, *jump_zv; + HashTable *jumptable; + + op = EX_VAR(opline->op1.var); + jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + +match_try_again: + if (Z_TYPE_P(op) == IS_LONG) { + jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(op)); + } else if (Z_TYPE_P(op) == IS_STRING) { + jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(op), (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST); + } else if (Z_TYPE_P(op) == IS_REFERENCE) { + op = Z_REFVAL_P(op); + goto match_try_again; + } else { + if (UNEXPECTED(((IS_TMP_VAR|IS_VAR|IS_CV) & IS_CV) && Z_TYPE_P(op) == IS_UNDEF)) { + SAVE_OPLINE(); + op = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + goto match_try_again; + } + + goto default_branch; + } + + if (jump_zv != NULL) { + ZEND_VM_SET_RELATIVE_OPCODE(opline, Z_LVAL_P(jump_zv)); + ZEND_VM_CONTINUE(); + } else { +default_branch: + /* default */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) + Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + fast_long_add_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) - Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) * Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + zend_long overflow; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow); + Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG; + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) != Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) != Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) != Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) != Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) != Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) != Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_add_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto add_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +add_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 + d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto add_double; + } + } + + ZEND_VM_TAIL_CALL(zend_add_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto sub_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +sub_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 - d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto sub_double; + } + } + + ZEND_VM_TAIL_CALL(zend_sub_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + zend_long overflow; + + result = EX_VAR(opline->result.var); + ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow); + Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG; + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto mul_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +mul_double: + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, d1 * d2); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto mul_double; + } + } + + ZEND_VM_TAIL_CALL(zend_mul_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + result = EX_VAR(opline->result.var); + if (UNEXPECTED(Z_LVAL_P(op2) == 0)) { + ZEND_VM_TAIL_CALL(zend_mod_by_zero_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) { + /* Prevent overflow error/crash if op1==ZEND_LONG_MIN */ + ZVAL_LONG(result, 0); + } else { + ZVAL_LONG(result, Z_LVAL_P(op1) % Z_LVAL_P(op2)); + } + ZEND_VM_NEXT_OPCODE(); + } + } + + ZEND_VM_TAIL_CALL(zend_mod_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + /* Perform shift on unsigned numbers to get well-defined wrap behavior. */ + ZVAL_LONG(EX_VAR(opline->result.var), + (zend_long) ((zend_ulong) Z_LVAL_P(op1) << Z_LVAL_P(op2))); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_shift_left_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG) + && EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) >> Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_shift_right_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) { +is_smaller_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_smaller_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_double: + if (d1 < d2) { + goto is_smaller_true; + } else { + goto is_smaller_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) { +is_smaller_or_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else { +is_smaller_or_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + ZVAL_FALSE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_smaller_or_equal_double; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_smaller_or_equal_double: + if (d1 <= d2) { + goto is_smaller_or_equal_true; + } else { + goto is_smaller_or_equal_false; + } + } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_smaller_or_equal_double; + } + } + ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) | Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_or_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) & Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_and_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG) + && EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) ^ Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_bw_xor_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) + Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + fast_long_add_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) - Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + fast_long_sub_function(result, op1, op2); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZVAL_LONG(result, Z_LVAL_P(op1) * Z_LVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + zend_long overflow; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow); + Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG; + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2, *result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = EX_VAR(opline->result.var); + ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) != Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) != Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) != Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) != Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) != Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) != Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) < Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) < Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_NONE(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPZ(result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2)); + ZEND_VM_SMART_BRANCH_JMPNZ(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_LIST_r(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op; + + SAVE_OPLINE(); + op = EX_VAR(opline->op1.var); + zend_match_unhandled_error(op); + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_LIST_r(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + + val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + /* The result and op1 can be the same cv zval */ + const uint32_t orig_val_type = Z_TYPE_INFO_P(val); + ZVAL_TRUE(EX_VAR(opline->result.var)); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } else { + SAVE_OPLINE(); + ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ECHO_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *z; + + SAVE_OPLINE(); + z = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (Z_TYPE_P(z) == IS_STRING) { + zend_string *str = Z_STR_P(z); + + if (ZSTR_LEN(str) != 0) { + zend_write(ZSTR_VAL(str), ZSTR_LEN(str)); + } + } else { + zend_string *str = zval_get_string_func(z); + + if (ZSTR_LEN(str) != 0) { + zend_write(ZSTR_VAL(str), ZSTR_LEN(str)); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(z) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_string_release_ex(str, 0); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + uint8_t op1_type; + + val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + SAVE_OPLINE(); + op1_type = (IS_TMP_VAR|IS_VAR); + if (i_zend_is_true(val)) { + opline++; + } else { + opline = OP_JMP_ADDR(opline, opline->op2); + } + if (op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(val); + } + ZEND_VM_JMP(opline); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + uint8_t op1_type; + + val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + op1_type = (IS_TMP_VAR|IS_VAR); + if (i_zend_is_true(val)) { + opline = OP_JMP_ADDR(opline, opline->op2); + } else { + opline++; + } + if (op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(val); + } + ZEND_VM_JMP(opline); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + bool ret; + + val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + SAVE_OPLINE(); + ret = i_zend_is_true(val); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + if (ret) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + opline++; + } else { + ZVAL_FALSE(EX_VAR(opline->result.var)); + opline = OP_JMP_ADDR(opline, opline->op2); + } + ZEND_VM_JMP(opline); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + bool ret; + + val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + ret = i_zend_is_true(val); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + if (ret) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + opline = OP_JMP_ADDR(opline, opline->op2); + } else { + ZVAL_FALSE(EX_VAR(opline->result.var)); + opline++; + } + ZEND_VM_JMP(opline); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FREE_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FREE_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *var; + USE_OPLINE + + var = EX_VAR(opline->op1.var); + if (Z_TYPE_P(var) != IS_ARRAY) { + SAVE_OPLINE(); + if (Z_FE_ITER_P(var) != (uint32_t)-1) { + zend_hash_iterator_del(Z_FE_ITER_P(var)); + } + zval_ptr_dtor_nogc(var); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + /* This is freeing an array. Use an inlined version of zval_ptr_dtor_nogc. */ + /* PHP only needs to save the opline and check for an exception if the last reference to the array was garbage collected (destructors of elements in the array could throw an exception) */ + if (Z_REFCOUNTED_P(var) && !Z_DELREF_P(var)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + do { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + if (EXPECTED(Z_TYPE_P(value) == IS_OBJECT)) { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Can only throw objects"); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } while (0); + + zend_exception_save(); + Z_TRY_ADDREF_P(value); + zend_throw_exception_object(value); + zend_exception_restore(); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + + val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + /* The result and op1 can be the same cv zval */ + const uint32_t orig_val_type = Z_TYPE_INFO_P(val); + ZVAL_FALSE(EX_VAR(opline->result.var)); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } else { + SAVE_OPLINE(); + ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *obj; + zend_object *zobj; + zend_class_entry *ce, *scope; + zend_function *clone; + zend_object_clone_obj_t clone_call; + + SAVE_OPLINE(); + obj = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + do { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(obj)) { + obj = Z_REFVAL_P(obj); + if (EXPECTED(Z_TYPE_P(obj) == IS_OBJECT)) { + break; + } + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(obj) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "__clone method called on non-object"); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } while (0); + + zobj = Z_OBJ_P(obj); + ce = zobj->ce; + clone = ce->clone; + clone_call = zobj->handlers->clone_obj; + if (UNEXPECTED(clone_call == NULL)) { + zend_throw_error(NULL, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (clone && !(clone->common.fn_flags & ZEND_ACC_PUBLIC)) { + scope = EX(func)->op_array.scope; + if (clone->common.scope != scope) { + if (UNEXPECTED(clone->common.fn_flags & ZEND_ACC_PRIVATE) + || UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) { + zend_wrong_clone_call(clone, scope); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(zobj)); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_op_array *new_op_array; + zval *inc_filename; + + SAVE_OPLINE(); + inc_filename = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + new_op_array = zend_include_or_eval(inc_filename, opline->extended_value); + if (UNEXPECTED(EG(exception) != NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) { + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (new_op_array == ZEND_FAKE_OP_ARRAY) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } + } else if (UNEXPECTED(new_op_array == NULL)) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } + } else if (new_op_array->last == 1 + && new_op_array->opcodes[0].opcode == ZEND_RETURN + && new_op_array->opcodes[0].op1_type == IS_CONST + && EXPECTED(zend_execute_ex == execute_ex)) { + if (RETURN_VALUE_USED(opline)) { + const zend_op *op = new_op_array->opcodes; + + ZVAL_COPY(EX_VAR(opline->result.var), RT_CONSTANT(op, op->op1)); + } + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } else { + zval *return_value = NULL; + zend_execute_data *call; + if (RETURN_VALUE_USED(opline)) { + return_value = EX_VAR(opline->result.var); + } + + new_op_array->scope = EX(func)->op_array.scope; + + call = zend_vm_stack_push_call_frame( + (Z_TYPE_INFO(EX(This)) & ZEND_CALL_HAS_THIS) | ZEND_CALL_NESTED_CODE | ZEND_CALL_HAS_SYMBOL_TABLE, + (zend_function*)new_op_array, 0, + Z_PTR(EX(This))); + + if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) { + call->symbol_table = EX(symbol_table); + } else { + call->symbol_table = zend_rebuild_symbol_table(); + } + + call->prev_execute_data = execute_data; + i_init_code_execute_data(call, new_op_array, return_value); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_ENTER(); + } else { + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + zend_vm_stack_free_call_frame(call); + } + + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + zval *val; + + SAVE_OPLINE(); + val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator"); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + +yield_from_try_again: + if (Z_TYPE_P(val) == IS_ARRAY) { + ZVAL_COPY_VALUE(&generator->values, val); + if (Z_OPT_REFCOUNTED_P(val)) { + Z_ADDREF_P(val); + } + Z_FE_POS(generator->values) = 0; + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) { + zend_class_entry *ce = Z_OBJCE_P(val); + if (ce == zend_ce_generator) { + zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); + + Z_ADDREF_P(val); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + if (UNEXPECTED(new_gen->execute_data == NULL)) { + zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue"); + zval_ptr_dtor(val); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (Z_ISUNDEF(new_gen->retval)) { + if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) { + zend_throw_error(NULL, "Impossible to yield from the Generator being currently run"); + zval_ptr_dtor(val); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else { + zend_generator_yield_from(generator, new_gen); + } + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zend_object_iterator *iter = ce->get_iterator(ce, val, 0); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { + if (!EG(exception)) { + zend_throw_error(NULL, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + iter->index = 0; + if (iter->funcs->rewind) { + iter->funcs->rewind(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + OBJ_RELEASE(&iter->std); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + + ZVAL_OBJ(&generator->values, &iter->std); + } + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + goto yield_from_try_again; + } else { + zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables"); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ + if (RETURN_VALUE_USED(opline)) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + + /* This generator has no send target (though the generator we delegate to might have one) */ + generator->send_target = NULL; + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(value); + } + ZEND_VM_NEXT_OPCODE(); + } else { + bool strict; + + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) { + value = Z_REFVAL_P(value); + if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + value = ZVAL_UNDEFINED_OP1(); + } + strict = EX_USES_STRICT_TYPES(); + do { + if (EXPECTED(!strict)) { + zend_string *str; + zval tmp; + + if (UNEXPECTED(Z_TYPE_P(value) == IS_NULL)) { + zend_error(E_DEPRECATED, + "strlen(): Passing null to parameter #1 ($string) of type string is deprecated"); + ZVAL_LONG(EX_VAR(opline->result.var), 0); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + break; + } + + ZVAL_COPY(&tmp, value); + if (zend_parse_arg_str_weak(&tmp, &str, 1)) { + ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str)); + zval_ptr_dtor(&tmp); + break; + } + zval_ptr_dtor(&tmp); + } + if (!EG(exception)) { + zend_type_error("strlen(): Argument #1 ($string) must be of type string, %s given", zend_zval_value_name(value)); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } while (0); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + int result = 0; + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if ((opline->extended_value >> (uint32_t)Z_TYPE_P(value)) & 1) { +type_check_resource: + if (opline->extended_value != MAY_BE_RESOURCE + || EXPECTED(NULL != zend_rsrc_list_get_rsrc_type(Z_RES_P(value)))) { + result = 1; + } + } else if (((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) && Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + if ((opline->extended_value >> (uint32_t)Z_TYPE_P(value)) & 1) { + goto type_check_resource; + } + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + result = ((1 << IS_NULL) & opline->extended_value) != 0; + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); + } else { + ZEND_VM_SMART_BRANCH(result, 0); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + uint32_t fetch_type; + zend_class_entry *called_scope, *scope; + USE_OPLINE + + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + SAVE_OPLINE(); + zval *op = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_OBJECT) { + zend_type_error("Cannot use \"::class\" on %s", zend_zval_value_name(op)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } + + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op)->name); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + fetch_type = opline->op1.num; + scope = EX(func)->op_array.scope; + if (UNEXPECTED(scope == NULL)) { + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot use \"%s\" in the global scope", + fetch_type == ZEND_FETCH_CLASS_SELF ? "self" : + fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + switch (fetch_type) { + case ZEND_FETCH_CLASS_SELF: + ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->name); + break; + case ZEND_FETCH_CLASS_PARENT: + if (UNEXPECTED(scope->parent == NULL)) { + SAVE_OPLINE(); + zend_throw_error(NULL, + "Cannot use \"parent\" when current class scope has no parent"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->parent->name); + break; + case ZEND_FETCH_CLASS_STATIC: + if (Z_TYPE(EX(This)) == IS_OBJECT) { + called_scope = Z_OBJCE(EX(This)); + } else { + called_scope = Z_CE(EX(This)); + } + ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); + break; + EMPTY_SWITCH_DEFAULT_CASE() + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + div_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + pow_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + + if (((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && (IS_TMP_VAR|IS_VAR) != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + compare_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + boolean_xor_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + dim = RT_CONSTANT(opline, opline->op2); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CONST, BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, IS_CONST OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_read_IS(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, RT_CONSTANT(opline, opline->op2)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CONST == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CONST == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CONST == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + if (((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && (IS_TMP_VAR|IS_VAR) != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if (IS_CONST == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CONST != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (IS_CONST != IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + + if (IS_CONST != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } while (0); + } + + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (IS_CONST != IS_CONST) { + + } + HANDLE_EXCEPTION(); + } + } + if (IS_CONST == IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + zend_invalid_method_call(object, function_name); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (IS_CONST == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (IS_CONST == IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (IS_CONST == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (IS_CONST != IS_CONST) { + + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, value); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +case_true: + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +case_false: + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto case_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +case_double: + if (d1 == d2) { + goto case_true; + } else { + goto case_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto case_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + + if (result) { + goto case_true; + } else { + goto case_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = RT_CONSTANT(opline, opline->op2); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, IS_CONST == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if ((IS_TMP_VAR|IS_VAR) & (IS_CONST|IS_CV)) { + /* avoid exception check */ + + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = RT_CONSTANT(opline, opline->op2); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + subject = RT_CONSTANT(opline, opline->op2); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + bool result; + + SAVE_OPLINE(); + expr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + +try_instanceof: + if (Z_TYPE_P(expr) == IS_OBJECT) { + zend_class_entry *ce; + + if (IS_CONST == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_lookup_class_ex(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD); + if (EXPECTED(ce)) { + CACHE_PTR(opline->extended_value, ce); + } + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + result = ce && instanceof_function(Z_OBJCE_P(expr), ce); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) { + expr = Z_REFVAL_P(expr); + goto try_instanceof; + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(expr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + result = 0; + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + zend_long offset; + HashTable *ht; + + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + dim = RT_CONSTANT(opline, opline->op2); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_index_array: + if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) { + offset = Z_LVAL_P(dim); + } else { + SAVE_OPLINE(); + zend_fetch_dimension_address_read_R(container, dim, IS_CONST OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ht = Z_ARRVAL_P(container); + ZEND_HASH_INDEX_FIND(ht, offset, value, fetch_dim_r_index_undef); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_index_array; + } else { + goto fetch_dim_r_index_slow; + } + } else { +fetch_dim_r_index_slow: + SAVE_OPLINE(); + if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + +fetch_dim_r_index_undef: + ZVAL_NULL(EX_VAR(opline->result.var)); + SAVE_OPLINE(); + zend_undefined_offset(offset); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + zend_long offset; + HashTable *ht; + + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + dim = EX_VAR(opline->op2.var); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_index_array: + if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) { + offset = Z_LVAL_P(dim); + } else { + SAVE_OPLINE(); + zend_fetch_dimension_address_read_R(container, dim, (IS_TMP_VAR|IS_VAR|IS_CV) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ht = Z_ARRVAL_P(container); + ZEND_HASH_INDEX_FIND(ht, offset, value, fetch_dim_r_index_undef); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_index_array; + } else { + goto fetch_dim_r_index_slow; + } + } else { +fetch_dim_r_index_slow: + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + +fetch_dim_r_index_undef: + ZVAL_NULL(EX_VAR(opline->result.var)); + SAVE_OPLINE(); + zend_undefined_offset(offset); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + div_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + pow_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + ((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && (IS_TMP_VAR|IS_VAR) != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && (IS_TMP_VAR|IS_VAR) == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + compare_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + boolean_xor_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, (IS_TMP_VAR|IS_VAR), BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_read_IS(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + ((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && (IS_TMP_VAR|IS_VAR) != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } while (0); + } + + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + HANDLE_EXCEPTION(); + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + zend_invalid_method_call(object, function_name); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +case_true: + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +case_false: + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto case_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +case_double: + if (d1 == d2) { + goto case_true; + } else { + goto case_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto case_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (result) { + goto case_true; + } else { + goto case_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, (IS_TMP_VAR|IS_VAR) == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if ((IS_TMP_VAR|IS_VAR) & (IS_CONST|IS_CV)) { + /* avoid exception check */ + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + subject = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMPVAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + bool result; + + SAVE_OPLINE(); + expr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + +try_instanceof: + if (Z_TYPE_P(expr) == IS_OBJECT) { + zend_class_entry *ce; + + if (IS_VAR == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_lookup_class_ex(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD); + if (EXPECTED(ce)) { + CACHE_PTR(opline->extended_value, ce); + } + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + result = ce && instanceof_function(Z_OBJCE_P(expr), ce); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) { + expr = Z_REFVAL_P(expr); + goto try_instanceof; + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(expr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + result = 0; + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(int type ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + zval *varname; + zval *retval; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + varname = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + tmp_name = NULL; + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + if (!(opline->extended_value & ZEND_FETCH_GLOBAL_LOCK)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + retval = zend_hash_find_ex(target_symbol_table, name, (IS_TMP_VAR|IS_VAR) == IS_CONST); + if (retval == NULL) { + if (UNEXPECTED(zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS)))) { +fetch_this: + zend_fetch_this_var(type OPLINE_CC EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + if (type == BP_VAR_W) { + retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval)); + } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) { + retval = &EG(uninitialized_zval); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV) { + /* Keep name alive in case an error handler tries to free it. */ + zend_string_addref(name); + } + zend_error(E_WARNING, "Undefined %svariable $%s", + (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name)); + if (type == BP_VAR_RW && !EG(exception)) { + retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval)); + } else { + retval = &EG(uninitialized_zval); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV) { + zend_string_release(name); + } + } + /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */ + } else if (Z_TYPE_P(retval) == IS_INDIRECT) { + retval = Z_INDIRECT_P(retval); + if (Z_TYPE_P(retval) == IS_UNDEF) { + if (UNEXPECTED(zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS)))) { + goto fetch_this; + } + if (type == BP_VAR_W) { + ZVAL_NULL(retval); + } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) { + retval = &EG(uninitialized_zval); + } else { + zend_error(E_WARNING, "Undefined %svariable $%s", + (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name)); + if (type == BP_VAR_RW && !EG(exception)) { + ZVAL_NULL(retval); + } else { + retval = &EG(uninitialized_zval); + } + } + } + } + + if (!(opline->extended_value & ZEND_FETCH_GLOBAL_LOCK)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + ZEND_ASSERT(retval != NULL); + if (type == BP_VAR_R || type == BP_VAR_IS) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else { + ZVAL_INDIRECT(EX_VAR(opline->result.var), retval); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + int fetch_type = + (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ? + BP_VAR_W : BP_VAR_R; + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(fetch_type ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, value); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varname; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + + varname = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + tmp_name = NULL; + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + varname = ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + zend_hash_del_ind(target_symbol_table, name); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + /* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */ + int result; + zval *varname; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + varname = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(varname); + } else { + name = zval_get_tmp_string(varname, &tmp_name); + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + value = zend_hash_find_ex(target_symbol_table, name, (IS_TMP_VAR|IS_VAR) == IS_CONST); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + if (!value) { + result = (opline->extended_value & ZEND_ISEMPTY); + } else { + if (Z_TYPE_P(value) == IS_INDIRECT) { + value = Z_INDIRECT_P(value); + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + if (Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + } + result = Z_TYPE_P(value) > IS_NULL; + } else { + result = !i_zend_is_true(value); + } + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + bool result; + + SAVE_OPLINE(); + expr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + +try_instanceof: + if (Z_TYPE_P(expr) == IS_OBJECT) { + zend_class_entry *ce; + + if (IS_UNUSED == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_lookup_class_ex(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD); + if (EXPECTED(ce)) { + CACHE_PTR(opline->extended_value, ce); + } + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + result = ce && instanceof_function(Z_OBJCE_P(expr), ce); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) { + expr = Z_REFVAL_P(expr); + goto try_instanceof; + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(expr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + result = 0; + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + zend_long count; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + while (1) { + if (Z_TYPE_P(op1) == IS_ARRAY) { + count = zend_hash_num_elements(Z_ARRVAL_P(op1)); + break; + } else if (Z_TYPE_P(op1) == IS_OBJECT) { + zend_object *zobj = Z_OBJ_P(op1); + + /* first, we check if the handler is defined */ + if (zobj->handlers->count_elements) { + if (SUCCESS == zobj->handlers->count_elements(zobj, &count)) { + break; + } + if (UNEXPECTED(EG(exception))) { + count = 0; + break; + } + } + + /* if not and the object implements Countable we call its count() method */ + if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) { + zval retval; + + zend_function *count_fn = zend_hash_find_ptr(&zobj->ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); + zend_call_known_instance_method_with_0_params(count_fn, zobj, &retval); + count = zval_get_long(&retval); + zval_ptr_dtor(&retval); + break; + } + + /* If There's no handler and it doesn't implement Countable then emit a TypeError */ + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + count = 0; + zend_type_error("%s(): Argument #1 ($value) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_value_name(op1)); + break; + } + + ZVAL_LONG(EX_VAR(opline->result.var), count); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_array *ht = Z_ARRVAL_P(_get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC)); + ZVAL_LONG(EX_VAR(opline->result.var), zend_hash_num_elements(ht)); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR) && !(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + SAVE_OPLINE(); + zend_array_destroy(ht); + if (EG(exception)) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + SAVE_OPLINE(); + if (UNEXPECTED(!EX(func)->common.scope)) { + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } else { + zend_error(E_DEPRECATED, "Calling get_class() without arguments is deprecated"); + ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zval *op1; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + while (1) { + if (Z_TYPE_P(op1) == IS_OBJECT) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op1)->name); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_value_name(op1)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } + break; + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COPY_TMP_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zval *result = EX_VAR(opline->result.var); + ZVAL_COPY(result, value); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + div_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + pow_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = EX_VAR(opline->op2.var); + + if (((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && (IS_TMP_VAR|IS_VAR) != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + compare_function(EX_VAR(opline->result.var), op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + dim = EX_VAR(opline->op2.var); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CV, BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, IS_CV OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_read_IS(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CV == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CV == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CV == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = EX_VAR(opline->op2.var); + if (((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && (IS_TMP_VAR|IS_VAR) != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if (IS_CV == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if (IS_CV != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + + if (IS_CV != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } while (0); + } + + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (IS_CV != IS_CONST) { + + } + HANDLE_EXCEPTION(); + } + } + if (IS_CV == IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + zend_invalid_method_call(object, function_name); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (IS_CV == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (IS_CV == IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (IS_CV == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (IS_CV != IS_CONST) { + + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + op2 = EX_VAR(opline->op2.var); + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +case_true: + ZEND_VM_SMART_BRANCH_TRUE(); + } else { +case_false: + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto case_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +case_double: + if (d1 == d2) { + goto case_true; + } else { + goto case_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto case_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + + if (result) { + goto case_true; + } else { + goto case_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_case_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = EX_VAR(opline->op2.var); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, IS_CV == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if ((IS_TMP_VAR|IS_VAR) & (IS_CONST|IS_CV)) { + /* avoid exception check */ + + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || + ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + subject = EX_VAR(opline->op2.var); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + return_value = EX(return_value); + + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (IS_TMP_VAR == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (IS_TMP_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + + + + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + SAVE_OPLINE(); + + return_value = EX(return_value); + + do { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) || + (IS_TMP_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { + /* Not supposed to happen, but we'll allow it */ + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + + retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (!return_value) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + break; + } + + ZVAL_NEW_REF(return_value, retval_ptr); + if (IS_TMP_VAR == IS_CONST) { + Z_TRY_ADDREF_P(retval_ptr); + } + } + break; + } + + retval_ptr = zend_get_bad_ptr(); + + if (IS_TMP_VAR == IS_VAR) { + ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + if (return_value) { + ZVAL_NEW_REF(return_value, retval_ptr); + } else { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + break; + } + } + + if (return_value) { + if (Z_ISREF_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } else { + ZVAL_MAKE_REF_EX(retval_ptr, 2); + } + ZVAL_REF(return_value, Z_REF_P(retval_ptr)); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } while (0); + + + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval; + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + retval = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + /* Copy return value into generator->retval */ + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(&generator->retval, retval); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { + Z_ADDREF(generator->retval); + } + } + } else if (IS_TMP_VAR == IS_CV) { + ZVAL_COPY_DEREF(&generator->retval, retval); + } else /* if (IS_TMP_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_refcounted *ref = Z_COUNTED_P(retval); + + retval = Z_REFVAL_P(retval); + ZVAL_COPY_VALUE(&generator->retval, retval); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval)) { + Z_ADDREF_P(retval); + } + } else { + ZVAL_COPY_VALUE(&generator->retval, retval); + } + } + + EG(current_execute_data) = EX(prev_execute_data); + + /* Close the generator to free up resources */ + zend_generator_close(generator, 1); + + /* Pass execution back to handling code */ + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_USER_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *arg, *param; + + SAVE_OPLINE(); + + arg = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + param = ZEND_CALL_VAR(EX(call), opline->result.var); + if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) { + zend_param_must_be_ref(EX(call)->func, opline->op2.num); + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } else { + ZVAL_COPY(param, arg); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + zval *result = EX_VAR(opline->result.var); + HashTable *ht; + + SAVE_OPLINE(); + expr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + switch (opline->extended_value) { + case IS_LONG: + ZVAL_LONG(result, zval_get_long(expr)); + break; + case IS_DOUBLE: + ZVAL_DOUBLE(result, zval_get_double(expr)); + break; + case IS_STRING: + ZVAL_STR(result, zval_get_string(expr)); + break; + default: + ZEND_ASSERT(opline->extended_value != _IS_BOOL && "Must use ZEND_BOOL instead"); + if (IS_TMP_VAR & (IS_VAR|IS_CV)) { + ZVAL_DEREF(expr); + } + /* If value is already of correct type, return it directly */ + if (Z_TYPE_P(expr) == opline->extended_value) { + ZVAL_COPY_VALUE(result, expr); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (opline->extended_value == IS_ARRAY) { + if (IS_TMP_VAR == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) { + if (Z_TYPE_P(expr) != IS_NULL) { + ZVAL_ARR(result, zend_new_array(1)); + expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } else { + ZVAL_EMPTY_ARRAY(result); + } + } else if (Z_OBJ_P(expr)->properties == NULL + && Z_OBJ_HT_P(expr)->get_properties_for == NULL + && Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) { + /* Optimized version without rebuilding properties HashTable */ + ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr))); + } else { + HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST); + if (obj_ht) { + /* fast copy */ + ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht, + (Z_OBJCE_P(expr)->default_properties_count || + Z_OBJ_P(expr)->handlers != &std_object_handlers || + GC_IS_RECURSIVE(obj_ht)))); + zend_release_properties(obj_ht); + } else { + ZVAL_EMPTY_ARRAY(result); + } + } + } else { + ZEND_ASSERT(opline->extended_value == IS_OBJECT); + ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def)); + if (Z_TYPE_P(expr) == IS_ARRAY) { + ht = zend_symtable_to_proptable(Z_ARR_P(expr)); + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + /* TODO: try not to duplicate immutable arrays as well ??? */ + ht = zend_array_dup(ht); + } + Z_OBJ_P(result)->properties = ht; + } else if (Z_TYPE_P(expr) != IS_NULL) { + Z_OBJ_P(result)->properties = ht = zend_new_array(1); + expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } + } + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array_ptr, *result; + + SAVE_OPLINE(); + + array_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (IS_TMP_VAR != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(array_ptr); + } + Z_FE_POS_P(result) = 0; + + ZEND_VM_NEXT_OPCODE(); + } else if (IS_TMP_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + zend_object *zobj = Z_OBJ_P(array_ptr); + if (!zobj->ce->get_iterator) { + HashTable *properties = zobj->properties; + if (properties) { + if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(properties); + } + properties = zobj->properties = zend_array_dup(properties); + } + } else { + properties = zobj->handlers->get_properties(zobj); + } + + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (IS_TMP_VAR != IS_TMP_VAR) { + Z_ADDREF_P(array_ptr); + } + + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(result) = (uint32_t) -1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array_ptr, *array_ref; + + SAVE_OPLINE(); + + if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { + array_ref = array_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(array_ref)) { + array_ptr = Z_REFVAL_P(array_ref); + } + } else { + array_ref = array_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + } + + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ref = EX_VAR(opline->result.var); + ZVAL_NEW_REF(array_ref, array_ptr); + array_ptr = Z_REFVAL_P(array_ref); + } + if (IS_TMP_VAR == IS_CONST) { + ZVAL_ARR(array_ptr, zend_array_dup(Z_ARRVAL_P(array_ptr))); + } else { + SEPARATE_ARRAY(array_ptr); + } + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_ARRVAL_P(array_ptr), 0); + + ZEND_VM_NEXT_OPCODE(); + } else if (IS_TMP_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + if (!Z_OBJCE_P(array_ptr)->get_iterator) { + HashTable *properties; + if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ptr = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(array_ptr, array_ref); + } + if (Z_OBJ_P(array_ptr)->properties + && UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(Z_OBJ_P(array_ptr)->properties); + } + Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties); + } + + properties = Z_OBJPROP_P(array_ptr); + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (E_HAS_ONLY_FATAL_ERRORS(EG(error_reporting)) + && !E_HAS_ONLY_FATAL_ERRORS(Z_LVAL_P(EX_VAR(opline->op1.var)))) { + EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var)); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + bool ret; + + SAVE_OPLINE(); + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + ret = i_zend_is_true(value); + + if (UNEXPECTED(EG(exception))) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (ret) { + zval *result = EX_VAR(opline->result.var); + + ZVAL_COPY_VALUE(result, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_TMP_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if (IS_TMP_VAR == IS_VAR && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + + SAVE_OPLINE(); + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + if (IS_TMP_VAR & IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { + zval *result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_TMP_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if ((IS_TMP_VAR & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + if ((IS_TMP_VAR & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_NULL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val, *result; + + val = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + if (Z_TYPE_P(val) > IS_NULL) { + do { + if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + if (Z_TYPE_P(val) <= IS_NULL) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + break; + } + } + ZEND_VM_NEXT_OPCODE(); + } while (0); + } + + result = EX_VAR(opline->result.var); + uint32_t short_circuiting_type = opline->extended_value & ZEND_SHORT_CIRCUITING_CHAIN_MASK; + if (EXPECTED(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EXPR)) { + ZVAL_NULL(result); + if (IS_TMP_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(val) == IS_UNDEF) + && (opline->extended_value & ZEND_JMP_NULL_BP_VAR_IS) == 0 + ) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + } else if (short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_ISSET) { + ZVAL_FALSE(result); + } else { + ZEND_ASSERT(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EMPTY); + ZVAL_TRUE(result); + } + + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *result = EX_VAR(opline->result.var); + + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(result); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_TMP_VAR == IS_CV) { + ZVAL_COPY_DEREF(result, value); + } else if (IS_TMP_VAR == IS_VAR) { + if (UNEXPECTED(Z_ISREF_P(value))) { + ZVAL_COPY_VALUE(result, Z_REFVAL_P(value)); + if (UNEXPECTED(Z_DELREF_P(value) == 0)) { + efree_size(Z_REF_P(value), sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } else { + ZVAL_COPY_VALUE(result, value); + } + } else { + ZVAL_COPY_VALUE(result, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) { + Z_ADDREF_P(result); + } + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_STRICT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_identical_function(op1, op2); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_not_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_CONST == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var; + + /* op1 and result are the same */ + rope = (zend_string**)EX_VAR(opline->op1.var); + if (IS_CONST == IS_CONST) { + var = RT_CONSTANT(opline, opline->op2); + rope[opline->extended_value] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = RT_CONSTANT(opline, opline->op2); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (IS_CONST == IS_CV) { + rope[opline->extended_value] = zend_string_copy(Z_STR_P(var)); + } else { + rope[opline->extended_value] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[opline->extended_value] = zval_get_string_func(var); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_END_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var, *ret; + uint32_t i; + + rope = (zend_string**)EX_VAR(opline->op1.var); + if (IS_CONST == IS_CONST) { + var = RT_CONSTANT(opline, opline->op2); + rope[opline->extended_value] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = RT_CONSTANT(opline, opline->op2); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (IS_CONST == IS_CV) { + rope[opline->extended_value] = zend_string_copy(Z_STR_P(var)); + } else { + rope[opline->extended_value] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[opline->extended_value] = zval_get_string_func(var); + + if (UNEXPECTED(EG(exception))) { + for (i = 0; i <= opline->extended_value; i++) { + zend_string_release_ex(rope[i], 0); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + size_t len = 0; + uint32_t flags = ZSTR_COPYABLE_CONCAT_PROPERTIES; + for (i = 0; i <= opline->extended_value; i++) { + flags &= ZSTR_GET_COPYABLE_CONCAT_PROPERTIES(rope[i]); + len += ZSTR_LEN(rope[i]); + } + ret = EX_VAR(opline->result.var); + ZVAL_STR(ret, zend_string_alloc(len, 0)); + GC_ADD_FLAGS(Z_STR_P(ret), flags); + + char *target = Z_STRVAL_P(ret); + for (i = 0; i <= opline->extended_value; i++) { + memcpy(target, ZSTR_VAL(rope[i]), ZSTR_LEN(rope[i])); + target += ZSTR_LEN(rope[i]); + zend_string_release_ex(rope[i], 0); + } + *target = '\0'; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_val_by_ref; + } + } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_val_by_ref: + ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + expr_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_TMP_VAR) { + /* pass */ + } else if (IS_TMP_VAR == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_TMP_VAR == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_TMP_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_CONST != IS_UNUSED) { + zval *offset = RT_CONSTANT(opline, opline->op2); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_TMP_VAR != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_TMP_VAR != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = zend_get_bad_ptr(); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_TMP_VAR == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + } else { + zval *value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_TMP_VAR == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_TMP_VAR == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_TMP_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CONST != IS_UNUSED) { + zval *key = RT_CONSTANT(opline, opline->op2); + if ((IS_CONST & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + zval *result; + + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find_ex(ht, Z_STR_P(op1), IS_TMP_VAR == IS_CONST); + if (IS_TMP_VAR & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + ZEND_VM_SMART_BRANCH(result, 0); + } + + if (opline->extended_value) { + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + ZEND_VM_SMART_BRANCH(result, 0); + } + SAVE_OPLINE(); + if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } + } else if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + } else if (Z_TYPE_P(op1) <= IS_FALSE) { + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC()); + ZEND_VM_SMART_BRANCH(result, 0); + } else { + zend_string *key; + zval key_tmp; + + if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } + } + + SAVE_OPLINE(); + ZEND_HASH_MAP_FOREACH_STR_KEY(ht, key) { + ZVAL_STR(&key_tmp, key); + if (zend_compare(op1, &key_tmp) == 0) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(1, 1); + } + } ZEND_HASH_FOREACH_END(); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(0, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_ADD_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var; + + /* op1 and result are the same */ + rope = (zend_string**)EX_VAR(opline->op1.var); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + var = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + rope[opline->extended_value] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CV) { + rope[opline->extended_value] = zend_string_copy(Z_STR_P(var)); + } else { + rope[opline->extended_value] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[opline->extended_value] = zval_get_string_func(var); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_END_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var, *ret; + uint32_t i; + + rope = (zend_string**)EX_VAR(opline->op1.var); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + var = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + rope[opline->extended_value] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CV) { + rope[opline->extended_value] = zend_string_copy(Z_STR_P(var)); + } else { + rope[opline->extended_value] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[opline->extended_value] = zval_get_string_func(var); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (UNEXPECTED(EG(exception))) { + for (i = 0; i <= opline->extended_value; i++) { + zend_string_release_ex(rope[i], 0); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + size_t len = 0; + uint32_t flags = ZSTR_COPYABLE_CONCAT_PROPERTIES; + for (i = 0; i <= opline->extended_value; i++) { + flags &= ZSTR_GET_COPYABLE_CONCAT_PROPERTIES(rope[i]); + len += ZSTR_LEN(rope[i]); + } + ret = EX_VAR(opline->result.var); + ZVAL_STR(ret, zend_string_alloc(len, 0)); + GC_ADD_FLAGS(Z_STR_P(ret), flags); + + char *target = Z_STRVAL_P(ret); + for (i = 0; i <= opline->extended_value; i++) { + memcpy(target, ZSTR_VAL(rope[i]), ZSTR_LEN(rope[i])); + target += ZSTR_LEN(rope[i]); + zend_string_release_ex(rope[i], 0); + } + *target = '\0'; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + expr_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_TMP_VAR) { + /* pass */ + } else if (IS_TMP_VAR == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_TMP_VAR == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_TMP_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_TMP_VAR != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_TMP_VAR != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = zend_get_bad_ptr(); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_TMP_VAR == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + } else { + zval *value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_TMP_VAR == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_TMP_VAR == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_TMP_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *key = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_STRICT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_not_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_STRICT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var_deref(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_UNUSED == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + if (IS_TMP_VAR == IS_UNUSED) { + SAVE_OPLINE(); + zend_verify_missing_return_type(EX(func)); + HANDLE_EXCEPTION(); + } else { +/* prevents "undefined variable opline" errors */ +#if 0 || (IS_TMP_VAR != IS_UNUSED) + USE_OPLINE + zval *retval_ref, *retval_ptr; + zend_arg_info *ret_info = EX(func)->common.arg_info - 1; + retval_ref = retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + if (IS_TMP_VAR == IS_CONST) { + ZVAL_COPY(EX_VAR(opline->result.var), retval_ptr); + retval_ref = retval_ptr = EX_VAR(opline->result.var); + } else if (IS_TMP_VAR == IS_VAR) { + if (UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_INDIRECT)) { + retval_ref = retval_ptr = Z_INDIRECT_P(retval_ptr); + } + ZVAL_DEREF(retval_ptr); + } else if (IS_TMP_VAR == IS_CV) { + ZVAL_DEREF(retval_ptr); + } + + if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(retval_ptr)))) { + ZEND_VM_NEXT_OPCODE(); + } + + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) { + SAVE_OPLINE(); + retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) { + ZEND_VM_NEXT_OPCODE(); + } + } + + zend_reference *ref = NULL; + void *cache_slot = CACHE_ADDR(opline->op2.num); + if (UNEXPECTED(retval_ref != retval_ptr)) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + ref = Z_REF_P(retval_ref); + } else { + /* A cast might happen - unwrap the reference if this is a by-value return */ + if (Z_REFCOUNT_P(retval_ref) == 1) { + ZVAL_UNREF(retval_ref); + } else { + Z_DELREF_P(retval_ref); + ZVAL_COPY(retval_ref, retval_ptr); + } + retval_ptr = retval_ref; + } + } + + SAVE_OPLINE(); + if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) { + zend_verify_return_error(EX(func), retval_ptr); + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +#endif + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(0)) { + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_val_by_ref; + } + } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_val_by_ref: + ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(1)) { + if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_val_by_ref; + } + } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_val_by_ref: + ZEND_VM_TAIL_CALL(zend_cannot_pass_by_ref_helper_SPEC(arg_num, arg ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); + } + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(arg))) { + Z_ADDREF_P(arg); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + expr_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_TMP_VAR) { + /* pass */ + } else if (IS_TMP_VAR == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_TMP_VAR == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_TMP_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_UNUSED != IS_UNUSED) { + zval *offset = NULL; + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_UNUSED != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_UNUSED == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_TMP_VAR != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_TMP_VAR != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = zend_get_bad_ptr(); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_TMP_VAR == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + } else { + zval *value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_TMP_VAR == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_TMP_VAR == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_TMP_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_UNUSED != IS_UNUSED) { + zval *key = NULL; + if ((IS_UNUSED & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_TYPE_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + zend_string *type; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + type = zend_zval_get_legacy_type(op1); + if (EXPECTED(type)) { + ZVAL_INTERNED_STR(EX_VAR(opline->result.var), type); + } else { + ZVAL_STRING(EX_VAR(opline->result.var), "unknown type"); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_STRICT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_CV == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var; + + /* op1 and result are the same */ + rope = (zend_string**)EX_VAR(opline->op1.var); + if (IS_CV == IS_CONST) { + var = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + rope[opline->extended_value] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = EX_VAR(opline->op2.var); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (IS_CV == IS_CV) { + rope[opline->extended_value] = zend_string_copy(Z_STR_P(var)); + } else { + rope[opline->extended_value] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[opline->extended_value] = zval_get_string_func(var); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_END_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var, *ret; + uint32_t i; + + rope = (zend_string**)EX_VAR(opline->op1.var); + if (IS_CV == IS_CONST) { + var = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + rope[opline->extended_value] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = EX_VAR(opline->op2.var); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (IS_CV == IS_CV) { + rope[opline->extended_value] = zend_string_copy(Z_STR_P(var)); + } else { + rope[opline->extended_value] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[opline->extended_value] = zval_get_string_func(var); + + if (UNEXPECTED(EG(exception))) { + for (i = 0; i <= opline->extended_value; i++) { + zend_string_release_ex(rope[i], 0); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + size_t len = 0; + uint32_t flags = ZSTR_COPYABLE_CONCAT_PROPERTIES; + for (i = 0; i <= opline->extended_value; i++) { + flags &= ZSTR_GET_COPYABLE_CONCAT_PROPERTIES(rope[i]); + len += ZSTR_LEN(rope[i]); + } + ret = EX_VAR(opline->result.var); + ZVAL_STR(ret, zend_string_alloc(len, 0)); + GC_ADD_FLAGS(Z_STR_P(ret), flags); + + char *target = Z_STRVAL_P(ret); + for (i = 0; i <= opline->extended_value; i++) { + memcpy(target, ZSTR_VAL(rope[i]), ZSTR_LEN(rope[i])); + target += ZSTR_LEN(rope[i]); + zend_string_release_ex(rope[i], 0); + } + *target = '\0'; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = zend_get_bad_ptr(); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + expr_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_TMP_VAR) { + /* pass */ + } else if (IS_TMP_VAR == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_TMP_VAR == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_TMP_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_CV != IS_UNUSED) { + zval *offset = EX_VAR(opline->op2.var); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_TMP_VAR != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_TMP_VAR != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = zend_get_bad_ptr(); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_TMP_VAR == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + } else { + zval *value = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_TMP_VAR == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_TMP_VAR == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_TMP_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CV != IS_UNUSED) { + zval *key = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + if ((IS_CV & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_LEXICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *closure, *var; + + closure = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + if (opline->extended_value & ZEND_BIND_REF) { + /* By-ref binding */ + var = _get_zval_ptr_cv_BP_VAR_W(opline->op2.var EXECUTE_DATA_CC); + if (Z_ISREF_P(var)) { + Z_ADDREF_P(var); + } else { + ZVAL_MAKE_REF_EX(var, 2); + } + } else { + var = EX_VAR(opline->op2.var); + if (UNEXPECTED(Z_ISUNDEF_P(var)) && !(opline->extended_value & ZEND_BIND_IMPLICIT)) { + SAVE_OPLINE(); + var = ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZVAL_DEREF(var); + Z_TRY_ADDREF_P(var); + } + + zend_closure_bind_var_ex(closure, + (opline->extended_value & ~(ZEND_BIND_REF|ZEND_BIND_IMPLICIT)), var); + ZEND_VM_NEXT_OPCODE(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_inc_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + SAVE_OPLINE(); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, NULL OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + increment_function(var_ptr); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_increment_function(var_ptr); + if (UNEXPECTED(0)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_pre_inc_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_increment_function(var_ptr); + if (UNEXPECTED(1)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_pre_inc_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_dec_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + SAVE_OPLINE(); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, NULL OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + decrement_function(var_ptr); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_decrement_function(var_ptr); + if (UNEXPECTED(0)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_pre_dec_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_decrement_function(var_ptr); + if (UNEXPECTED(1)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_pre_dec_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_inc_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + SAVE_OPLINE(); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, EX_VAR(opline->result.var) OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + + increment_function(var_ptr); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_increment_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_post_inc_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_dec_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + SAVE_OPLINE(); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, EX_VAR(opline->result.var) OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + + decrement_function(var_ptr); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_decrement_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_post_dec_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + return_value = EX(return_value); + + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (IS_VAR & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (IS_VAR == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + + + + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + SAVE_OPLINE(); + + return_value = EX(return_value); + + do { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR)) || + (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { + /* Not supposed to happen, but we'll allow it */ + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + + retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (!return_value) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + break; + } + + ZVAL_NEW_REF(return_value, retval_ptr); + if (IS_VAR == IS_CONST) { + Z_TRY_ADDREF_P(retval_ptr); + } + } + break; + } + + retval_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + if (return_value) { + ZVAL_NEW_REF(return_value, retval_ptr); + } else { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + break; + } + } + + if (return_value) { + if (Z_ISREF_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } else { + ZVAL_MAKE_REF_EX(retval_ptr, 2); + } + ZVAL_REF(return_value, Z_REF_P(retval_ptr)); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } while (0); + + + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval; + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + retval = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* Copy return value into generator->retval */ + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(&generator->retval, retval); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { + Z_ADDREF(generator->retval); + } + } + } else if (IS_VAR == IS_CV) { + ZVAL_COPY_DEREF(&generator->retval, retval); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_refcounted *ref = Z_COUNTED_P(retval); + + retval = Z_REFVAL_P(retval); + ZVAL_COPY_VALUE(&generator->retval, retval); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval)) { + Z_ADDREF_P(retval); + } + } else { + ZVAL_COPY_VALUE(&generator->retval, retval); + } + } + + EG(current_execute_data) = EX(prev_execute_data); + + /* Close the generator to free up resources */ + zend_generator_close(generator, 1); + + /* Pass execution back to handling code */ + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *arg, *param; + + SAVE_OPLINE(); + + arg = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + param = ZEND_CALL_VAR(EX(call), opline->result.var); + if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) { + zend_param_must_be_ref(EX(call)->func, opline->op2.num); + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } else { + ZVAL_COPY(param, arg); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + zval *result = EX_VAR(opline->result.var); + HashTable *ht; + + SAVE_OPLINE(); + expr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + switch (opline->extended_value) { + case IS_LONG: + ZVAL_LONG(result, zval_get_long(expr)); + break; + case IS_DOUBLE: + ZVAL_DOUBLE(result, zval_get_double(expr)); + break; + case IS_STRING: + ZVAL_STR(result, zval_get_string(expr)); + break; + default: + ZEND_ASSERT(opline->extended_value != _IS_BOOL && "Must use ZEND_BOOL instead"); + if (IS_VAR & (IS_VAR|IS_CV)) { + ZVAL_DEREF(expr); + } + /* If value is already of correct type, return it directly */ + if (Z_TYPE_P(expr) == opline->extended_value) { + ZVAL_COPY_VALUE(result, expr); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (opline->extended_value == IS_ARRAY) { + if (IS_VAR == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) { + if (Z_TYPE_P(expr) != IS_NULL) { + ZVAL_ARR(result, zend_new_array(1)); + expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } else { + ZVAL_EMPTY_ARRAY(result); + } + } else if (Z_OBJ_P(expr)->properties == NULL + && Z_OBJ_HT_P(expr)->get_properties_for == NULL + && Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) { + /* Optimized version without rebuilding properties HashTable */ + ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr))); + } else { + HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST); + if (obj_ht) { + /* fast copy */ + ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht, + (Z_OBJCE_P(expr)->default_properties_count || + Z_OBJ_P(expr)->handlers != &std_object_handlers || + GC_IS_RECURSIVE(obj_ht)))); + zend_release_properties(obj_ht); + } else { + ZVAL_EMPTY_ARRAY(result); + } + } + } else { + ZEND_ASSERT(opline->extended_value == IS_OBJECT); + ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def)); + if (Z_TYPE_P(expr) == IS_ARRAY) { + ht = zend_symtable_to_proptable(Z_ARR_P(expr)); + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + /* TODO: try not to duplicate immutable arrays as well ??? */ + ht = zend_array_dup(ht); + } + Z_OBJ_P(result)->properties = ht; + } else if (Z_TYPE_P(expr) != IS_NULL) { + Z_OBJ_P(result)->properties = ht = zend_new_array(1); + expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } + } + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array_ptr, *result; + + SAVE_OPLINE(); + + array_ptr = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (IS_VAR != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(array_ptr); + } + Z_FE_POS_P(result) = 0; + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); + } else if (IS_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + zend_object *zobj = Z_OBJ_P(array_ptr); + if (!zobj->ce->get_iterator) { + HashTable *properties = zobj->properties; + if (properties) { + if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(properties); + } + properties = zobj->properties = zend_array_dup(properties); + } + } else { + properties = zobj->handlers->get_properties(zobj); + } + + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (IS_VAR != IS_TMP_VAR) { + Z_ADDREF_P(array_ptr); + } + + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(result) = (uint32_t) -1; + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array_ptr, *array_ref; + + SAVE_OPLINE(); + + if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { + array_ref = array_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(array_ref)) { + array_ptr = Z_REFVAL_P(array_ref); + } + } else { + array_ref = array_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + } + + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ref = EX_VAR(opline->result.var); + ZVAL_NEW_REF(array_ref, array_ptr); + array_ptr = Z_REFVAL_P(array_ref); + } + if (IS_VAR == IS_CONST) { + ZVAL_ARR(array_ptr, zend_array_dup(Z_ARRVAL_P(array_ptr))); + } else { + SEPARATE_ARRAY(array_ptr); + } + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_ARRVAL_P(array_ptr), 0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); + } else if (IS_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + if (!Z_OBJCE_P(array_ptr)->get_iterator) { + HashTable *properties; + if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ptr = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(array_ptr, array_ref); + } + if (Z_OBJ_P(array_ptr)->properties + && UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(Z_OBJ_P(array_ptr)->properties); + } + Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties); + } + + properties = Z_OBJPROP_P(array_ptr); + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1; + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_R_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array; + zval *value; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + + array = EX_VAR(opline->op1.var); + if (UNEXPECTED(Z_TYPE_P(array) != IS_ARRAY)) { + ZEND_VM_TAIL_CALL(zend_fe_fetch_object_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + fe_ht = Z_ARRVAL_P(array); + pos = Z_FE_POS_P(array); + if (HT_IS_PACKED(fe_ht)) { + value = fe_ht->arPacked + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + pos++; + value++; + } + Z_FE_POS_P(array) = pos + 1; + if (RETURN_VALUE_USED(opline)) { + ZVAL_LONG(EX_VAR(opline->result.var), pos); + } + } else { + Bucket *p; + + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + p++; + } + Z_FE_POS_P(array) = pos; + if (RETURN_VALUE_USED(opline)) { + if (!p->key) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } + } + } + if (EXPECTED(opline->op2_type == IS_CV)) { + zval *variable_ptr = EX_VAR(opline->op2.var); + SAVE_OPLINE(); + zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + zval *res = EX_VAR(opline->op2.var); + zend_refcounted *gc = Z_COUNTED_P(value); + + ZVAL_COPY_VALUE_EX(res, value, gc, value_type); + if (Z_TYPE_INFO_REFCOUNTED(value_type)) { + GC_ADDREF(gc); + } + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array; + zval *value; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + Bucket *p; + + array = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + + ZVAL_DEREF(array); + if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) { + pos = zend_hash_iterator_pos_ex(Z_FE_ITER_P(EX_VAR(opline->op1.var)), array); + fe_ht = Z_ARRVAL_P(array); + if (HT_IS_PACKED(fe_ht)) { + value = fe_ht->arPacked + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + goto fe_fetch_w_exit; + } + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + pos++; + value++; + } + EG(ht_iterators)[Z_FE_ITER_P(EX_VAR(opline->op1.var))].pos = pos + 1; + if (RETURN_VALUE_USED(opline)) { + ZVAL_LONG(EX_VAR(opline->result.var), pos); + } + } else { + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + goto fe_fetch_w_exit; + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + p++; + } + EG(ht_iterators)[Z_FE_ITER_P(EX_VAR(opline->op1.var))].pos = pos; + if (RETURN_VALUE_USED(opline)) { + if (!p->key) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } + } + } + } else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) { + zend_object_iterator *iter; + + if ((iter = zend_iterator_unwrap(array)) == NULL) { + /* plain object */ + + fe_ht = Z_OBJPROP_P(array); + pos = zend_hash_iterator_pos(Z_FE_ITER_P(EX_VAR(opline->op1.var)), fe_ht); + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + goto fe_fetch_w_exit; + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + if (EXPECTED(value_type != IS_UNDEF)) { + if (UNEXPECTED(value_type == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + value_type = Z_TYPE_INFO_P(value); + if (EXPECTED(value_type != IS_UNDEF) + && EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) { + if ((value_type & Z_TYPE_MASK) != IS_REFERENCE) { + zend_property_info *prop_info = + zend_get_property_info_for_slot(Z_OBJ_P(array), value); + if (UNEXPECTED(prop_info)) { + if (UNEXPECTED(prop_info->flags & ZEND_ACC_READONLY)) { + zend_throw_error(NULL, + "Cannot acquire reference to readonly property %s::$%s", + ZSTR_VAL(prop_info->ce->name), ZSTR_VAL(p->key)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_NEW_REF(value, value); + ZEND_REF_ADD_TYPE_SOURCE(Z_REF_P(value), prop_info); + value_type = IS_REFERENCE_EX; + } + } + } + break; + } + } else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0) + || !p->key + || zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) { + break; + } + } + p++; + } + EG(ht_iterators)[Z_FE_ITER_P(EX_VAR(opline->op1.var))].pos = pos; + if (RETURN_VALUE_USED(opline)) { + if (UNEXPECTED(!p->key)) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else if (ZSTR_VAL(p->key)[0]) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } else { + const char *class_name, *prop_name; + size_t prop_name_len; + zend_unmangle_property_name_ex( + p->key, &class_name, &prop_name, &prop_name_len); + ZVAL_STRINGL(EX_VAR(opline->result.var), prop_name, prop_name_len); + } + } + } else { + const zend_object_iterator_funcs *funcs = iter->funcs; + if (++iter->index > 0) { + /* This could cause an endless loop if index becomes zero again. + * In case that ever happens we need an additional flag. */ + funcs->move_forward(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(funcs->valid(iter) == FAILURE)) { + /* reached end of iteration */ + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + goto fe_fetch_w_exit; + } + } + value = funcs->get_current_data(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + if (!value) { + /* failure in get_current_data */ + goto fe_fetch_w_exit; + } + if (RETURN_VALUE_USED(opline)) { + if (funcs->get_current_key) { + funcs->get_current_key(iter, EX_VAR(opline->result.var)); + if (UNEXPECTED(EG(exception) != NULL)) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } else { + ZVAL_LONG(EX_VAR(opline->result.var), iter->index); + } + } + value_type = Z_TYPE_INFO_P(value); + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array)); + if (UNEXPECTED(EG(exception))) { + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } +fe_fetch_w_exit: + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + + if (EXPECTED((value_type & Z_TYPE_MASK) != IS_REFERENCE)) { + zend_refcounted *gc = Z_COUNTED_P(value); + zval *ref; + ZVAL_NEW_EMPTY_REF(value); + ref = Z_REFVAL_P(value); + ZVAL_COPY_VALUE_EX(ref, value, gc, value_type); + } + if (EXPECTED(opline->op2_type == IS_CV)) { + zval *variable_ptr = EX_VAR(opline->op2.var); + if (EXPECTED(variable_ptr != value)) { + zend_reference *ref; + + ref = Z_REF_P(value); + GC_ADDREF(ref); + i_zval_ptr_dtor(variable_ptr); + ZVAL_REF(variable_ptr, ref); + } + } else { + Z_ADDREF_P(value); + ZVAL_REF(EX_VAR(opline->op2.var), Z_REF_P(value)); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + bool ret; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + ret = i_zend_is_true(value); + + if (UNEXPECTED(EG(exception))) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (ret) { + zval *result = EX_VAR(opline->result.var); + + ZVAL_COPY_VALUE(result, value); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if (IS_VAR == IS_VAR && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + if (IS_VAR & IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { + zval *result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, value); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if ((IS_VAR & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + if ((IS_VAR & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_NULL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val, *result; + + val = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (Z_TYPE_P(val) > IS_NULL) { + do { + if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + if (Z_TYPE_P(val) <= IS_NULL) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + break; + } + } + ZEND_VM_NEXT_OPCODE(); + } while (0); + } + + result = EX_VAR(opline->result.var); + uint32_t short_circuiting_type = opline->extended_value & ZEND_SHORT_CIRCUITING_CHAIN_MASK; + if (EXPECTED(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EXPR)) { + ZVAL_NULL(result); + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(val) == IS_UNDEF) + && (opline->extended_value & ZEND_JMP_NULL_BP_VAR_IS) == 0 + ) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + } else if (short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_ISSET) { + ZVAL_FALSE(result); + } else { + ZEND_ASSERT(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EMPTY); + ZVAL_TRUE(result); + } + + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *result = EX_VAR(opline->result.var); + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(result); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_VAR == IS_CV) { + ZVAL_COPY_DEREF(result, value); + } else if (IS_VAR == IS_VAR) { + if (UNEXPECTED(Z_ISREF_P(value))) { + ZVAL_COPY_VALUE(result, Z_REFVAL_P(value)); + if (UNEXPECTED(Z_DELREF_P(value) == 0)) { + efree_size(Z_REF_P(value), sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } else { + ZVAL_COPY_VALUE(result, value); + } + } else { + ZVAL_COPY_VALUE(result, value); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) { + Z_ADDREF_P(result); + } + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_SIMPLE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + + if (IS_VAR == IS_CV) { + ZVAL_COPY(arg, varptr); + } else /* if (IS_VAR == IS_VAR) */ { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_STRICT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_identical_function(op1, op2); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_not_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = RT_CONSTANT(opline, opline->op2); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +assign_dim_op_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +assign_dim_op_new_array: + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + goto assign_dim_op_ret_null; + } + } else { + if (IS_CONST == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + goto assign_dim_op_ret_null; + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto assign_dim_op_array; + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_op_ret_null; + } + } + goto assign_dim_op_new_array; + } else { + dim = RT_CONSTANT(opline, opline->op2); + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +assign_dim_op_ret_null: + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OP_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op2); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_W(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_RW(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_CONST == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_UNSET(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_VAR, property, IS_CONST, + ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + dim = RT_CONSTANT(opline, opline->op2); + + if (IS_VAR == IS_VAR + && Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT + && UNEXPECTED(!Z_ISREF_P(container)) + ) { + zend_error(E_NOTICE, "Attempting to set reference to non referenceable value"); + zend_fetch_dimension_address_LIST_r(container, dim, IS_CONST OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_fetch_dimension_address_W(container, dim, IS_CONST OPLINE_CC EXECUTE_DATA_CC); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CONST == IS_UNUSED) { + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CONST == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CONST == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = RT_CONSTANT((opline+1), (opline+1)->op1); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CONST & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CONST == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = RT_CONSTANT(opline, opline->op2); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = RT_CONSTANT(opline, opline->op2); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = RT_CONSTANT(opline, opline->op2); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CONST != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CONST == IS_UNUSED) { + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_TMP_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_TMP_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CONST == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = RT_CONSTANT(opline, opline->op2); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = RT_CONSTANT(opline, opline->op2); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = RT_CONSTANT(opline, opline->op2); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CONST != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CONST == IS_UNUSED) { + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CONST == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = RT_CONSTANT(opline, opline->op2); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = RT_CONSTANT(opline, opline->op2); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = RT_CONSTANT(opline, opline->op2); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CONST != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CONST == IS_UNUSED) { + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CV == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CV == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CV & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CONST == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = RT_CONSTANT(opline, opline->op2); + value = EX_VAR((opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = RT_CONSTANT(opline, opline->op2); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = RT_CONSTANT(opline, opline->op2); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CONST != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op2); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (0 || UNEXPECTED(0)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(0)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES()); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op2); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (0 || UNEXPECTED(1)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(1)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES()); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = RT_CONSTANT(opline, opline->op2); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_VAR == IS_UNUSED) { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_VAR, property, IS_CONST, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = RT_CONSTANT(opline, opline->op2); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_VAR == IS_UNUSED) { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_VAR, property, IS_CONST, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_VAR == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_CONST != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_VAR == IS_CONST && + IS_CONST == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_VAR != IS_CONST && + IS_CONST == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_CONST != IS_UNUSED) { + function_name = RT_CONSTANT(opline, opline->op2); + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_CONST & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_CONST == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_CONST != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_VAR == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_VAR == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr))) { + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + ZVAL_NEW_REF(arg, arg); + zend_error(E_NOTICE, "Only variables should be passed by reference"); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (!QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var; + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr) || + QUICK_ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num))) { + ZEND_VM_NEXT_OPCODE(); + } + } else { + if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var; + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr) || + ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num))) { + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + ZVAL_NEW_REF(arg, arg); + zend_error(E_NOTICE, "Only variables should be passed by reference"); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + +send_var: + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + SAVE_OPLINE(); + if (IS_CONST == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var_by_ref; + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_var_by_ref: + varptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_VAR == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + if (IS_CONST == IS_CONST) { + // TODO: Would it make sense to share the cache slot with CHECK_FUNC_ARG? + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + varptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_class_entry *ce, *scope; + zend_class_constant *c; + zval *value, *zv, *constant_zv; + zend_string *constant_name; + USE_OPLINE + + SAVE_OPLINE(); + + do { + if (IS_VAR == IS_CONST && IS_CONST == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value + sizeof(void*)))) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + } + if (IS_VAR == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value))) { + ce = CACHED_PTR(opline->extended_value); + } else { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->extended_value, ce); + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + if (IS_VAR != IS_CONST + && IS_CONST == IS_CONST + && EXPECTED(CACHED_PTR(opline->extended_value) == ce)) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + + constant_zv = RT_CONSTANT(opline, opline->op2); + if (UNEXPECTED(Z_TYPE_P(constant_zv) != IS_STRING)) { + zend_invalid_class_constant_type_error(Z_TYPE_P(constant_zv)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + constant_name = Z_STR_P(constant_zv); + /* Magic 'class' for constant OP2 is caught at compile-time */ + if (IS_CONST != IS_CONST && UNEXPECTED(zend_string_equals_literal_ci(constant_name, "class"))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); + + ZEND_VM_NEXT_OPCODE(); + } + zv = IS_CONST == IS_CONST + ? zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), constant_name) + : zend_hash_find(CE_CONSTANTS_TABLE(ce), constant_name); + + if (EXPECTED(zv != NULL)) { + c = Z_PTR_P(zv); + scope = EX(func)->op_array.scope; + if (!zend_verify_const_access(c, scope)) { + zend_throw_error(NULL, "Cannot access %s constant %s::%s", zend_visibility_string(ZEND_CLASS_CONST_FLAGS(c)), ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + + if (ce->ce_flags & ZEND_ACC_TRAIT) { + zend_throw_error(NULL, "Cannot access trait constant %s::%s directly", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + + bool is_constant_deprecated = ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED; + if (UNEXPECTED(is_constant_deprecated)) { + zend_error(E_DEPRECATED, "Constant %s::%s is deprecated", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + + if (EG(exception)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + + value = &c->value; + // Enums require loading of all class constants to build the backed enum table + if (ce->ce_flags & ZEND_ACC_ENUM && ce->enum_backing_type != IS_UNDEF && ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { + if (UNEXPECTED(zend_update_class_constants(ce) == FAILURE)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + if (Z_TYPE_P(value) == IS_CONSTANT_AST) { + if (UNEXPECTED(zend_update_class_constant(c, constant_name, c->ce) != SUCCESS)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + if (IS_CONST == IS_CONST && !is_constant_deprecated) { + CACHE_POLYMORPHIC_PTR(opline->extended_value, ce, value); + } + } else { + zend_throw_error(NULL, "Undefined constant %s::%s", + ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } while (0); + + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), value); + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + expr_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_TMP_VAR) { + /* pass */ + } else if (IS_VAR == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_VAR == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_CONST != IS_UNUSED) { + zval *offset = RT_CONSTANT(opline, opline->op2); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_VAR != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_ulong hval; + zend_string *key; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = RT_CONSTANT(opline, opline->op2); + + do { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + +unset_dim_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +offset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + key = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(key, hval)) { + goto num_index_dim; + } + } +str_index_dim: + ZEND_ASSERT(ht != &EG(symbol_table)); + zend_hash_del(ht, key); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_dim: + zend_hash_index_del(ht, hval); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto offset_again; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_NULL) { + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index_dim; + } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else { + zend_illegal_array_offset_unset(offset); + } + break; + } else if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto unset_dim_array; + } + } + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + container = ZVAL_UNDEFINED_OP1(); + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + offset = ZVAL_UNDEFINED_OP2(); + } + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + Z_OBJ_HT_P(container)->unset_dimension(Z_OBJ_P(container), offset); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { + zend_throw_error(NULL, "Cannot unset string offsets"); + } else if (UNEXPECTED(Z_TYPE_P(container) > IS_FALSE)) { + zend_throw_error(NULL, "Cannot unset offset in a non-array variable"); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_FALSE)) { + zend_false_to_array_deprecated(); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_VAR != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_VAR == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + } else { + zval *value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_VAR == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_VAR == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CONST != IS_UNUSED) { + zval *key = RT_CONSTANT(opline, opline->op2); + if ((IS_CONST & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + zval *result; + + op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find_ex(ht, Z_STR_P(op1), IS_VAR == IS_CONST); + if (IS_VAR & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + ZEND_VM_SMART_BRANCH(result, 0); + } + + if (opline->extended_value) { + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + ZEND_VM_SMART_BRANCH(result, 0); + } + SAVE_OPLINE(); + if ((IS_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } + } else if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + } else if (Z_TYPE_P(op1) <= IS_FALSE) { + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC()); + ZEND_VM_SMART_BRANCH(result, 0); + } else { + zend_string *key; + zval key_tmp; + + if ((IS_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } + } + + SAVE_OPLINE(); + ZEND_HASH_MAP_FOREACH_STR_KEY(ht, key) { + ZVAL_STR(&key_tmp, key); + if (zend_compare(op1, &key_tmp) == 0) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(1, 1); + } + } ZEND_HASH_FOREACH_END(); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_SMART_BRANCH(0, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_class_entry *ce, *scope; + zend_class_constant *c; + zval *value, *zv, *constant_zv; + zend_string *constant_name; + USE_OPLINE + + SAVE_OPLINE(); + + do { + if (IS_VAR == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value + sizeof(void*)))) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + } + if (IS_VAR == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value))) { + ce = CACHED_PTR(opline->extended_value); + } else { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->extended_value, ce); + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + if (IS_VAR != IS_CONST + && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST + && EXPECTED(CACHED_PTR(opline->extended_value) == ce)) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + + constant_zv = _get_zval_ptr_tmpvarcv(opline->op2_type, opline->op2, BP_VAR_R EXECUTE_DATA_CC); + if (UNEXPECTED(Z_TYPE_P(constant_zv) != IS_STRING)) { + zend_invalid_class_constant_type_error(Z_TYPE_P(constant_zv)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + constant_name = Z_STR_P(constant_zv); + /* Magic 'class' for constant OP2 is caught at compile-time */ + if ((IS_TMP_VAR|IS_VAR|IS_CV) != IS_CONST && UNEXPECTED(zend_string_equals_literal_ci(constant_name, "class"))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); + FREE_OP(opline->op2_type, opline->op2.var); + ZEND_VM_NEXT_OPCODE(); + } + zv = (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST + ? zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), constant_name) + : zend_hash_find(CE_CONSTANTS_TABLE(ce), constant_name); + + if (EXPECTED(zv != NULL)) { + c = Z_PTR_P(zv); + scope = EX(func)->op_array.scope; + if (!zend_verify_const_access(c, scope)) { + zend_throw_error(NULL, "Cannot access %s constant %s::%s", zend_visibility_string(ZEND_CLASS_CONST_FLAGS(c)), ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + + if (ce->ce_flags & ZEND_ACC_TRAIT) { + zend_throw_error(NULL, "Cannot access trait constant %s::%s directly", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + + bool is_constant_deprecated = ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED; + if (UNEXPECTED(is_constant_deprecated)) { + zend_error(E_DEPRECATED, "Constant %s::%s is deprecated", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + + if (EG(exception)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + + value = &c->value; + // Enums require loading of all class constants to build the backed enum table + if (ce->ce_flags & ZEND_ACC_ENUM && ce->enum_backing_type != IS_UNDEF && ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { + if (UNEXPECTED(zend_update_class_constants(ce) == FAILURE)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + if (Z_TYPE_P(value) == IS_CONSTANT_AST) { + if (UNEXPECTED(zend_update_class_constant(c, constant_name, c->ce) != SUCCESS)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + if ((IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && !is_constant_deprecated) { + CACHE_POLYMORPHIC_PTR(opline->extended_value, ce, value); + } + } else { + zend_throw_error(NULL, "Undefined constant %s::%s", + ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } while (0); + + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), value); + + FREE_OP(opline->op2_type, opline->op2.var); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +assign_dim_op_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +assign_dim_op_new_array: + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + goto assign_dim_op_ret_null; + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + goto assign_dim_op_ret_null; + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto assign_dim_op_array; + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_op_ret_null; + } + } + goto assign_dim_op_new_array; + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +assign_dim_op_ret_null: + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_W(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_RW(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_UNSET(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), + (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR + && Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT + && UNEXPECTED(!Z_ISREF_P(container)) + ) { + zend_error(E_NOTICE, "Attempting to set reference to non referenceable value"); + zend_fetch_dimension_address_LIST_r(container, dim, (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_fetch_dimension_address_W(container, dim, (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CONST == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CONST == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = RT_CONSTANT((opline+1), (opline+1)->op1); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CONST & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_TMP_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_TMP_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CV == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CV == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CV & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + value = EX_VAR((opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_VAR == IS_UNUSED) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_VAR == IS_UNUSED) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_VAR == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_VAR == IS_CONST && + (IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_VAR != IS_CONST && + (IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_VAR == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + expr_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_TMP_VAR) { + /* pass */ + } else if (IS_VAR == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_VAR == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_VAR != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_ulong hval; + zend_string *key; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + +unset_dim_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +offset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + key = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(key, hval)) { + goto num_index_dim; + } + } +str_index_dim: + ZEND_ASSERT(ht != &EG(symbol_table)); + zend_hash_del(ht, key); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_dim: + zend_hash_index_del(ht, hval); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto offset_again; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_NULL) { + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index_dim; + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else { + zend_illegal_array_offset_unset(offset); + } + break; + } else if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto unset_dim_array; + } + } + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + container = ZVAL_UNDEFINED_OP1(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + offset = ZVAL_UNDEFINED_OP2(); + } + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + Z_OBJ_HT_P(container)->unset_dimension(Z_OBJ_P(container), offset); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { + zend_throw_error(NULL, "Cannot unset string offsets"); + } else if (UNEXPECTED(Z_TYPE_P(container) > IS_FALSE)) { + zend_throw_error(NULL, "Cannot unset offset in a non-array variable"); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_FALSE)) { + zend_false_to_array_deprecated(); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_VAR != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_VAR == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + } else { + zval *value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_VAR == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_VAR == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *key = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_STRICT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_not_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (0 || UNEXPECTED(0)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(0)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES()); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (0 || UNEXPECTED(1)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(1)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES()); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var_deref(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_STRICT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var_deref(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var_deref(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_not_identical_function(op1, op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (0 || UNEXPECTED(0)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(0)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES()); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (0 || UNEXPECTED(1)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(1)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES()); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *variable_ptr; + zval *value_ptr; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + value_ptr = _get_zval_ptr_ptr_var(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR && + UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT)) { + + zend_throw_error(NULL, "Cannot assign by reference to an array dimension of an object"); + variable_ptr = &EG(uninitialized_zval); + } else if (IS_VAR == IS_VAR && + opline->extended_value == ZEND_RETURNS_FUNCTION && + UNEXPECTED(!Z_ISREF_P(value_ptr))) { + + variable_ptr = zend_wrong_assign_to_variable_reference( + variable_ptr, value_ptr, &garbage OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_variable_reference(variable_ptr, value_ptr, &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), variable_ptr); + } + + if (garbage) { + GC_DTOR(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +assign_dim_op_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +assign_dim_op_new_array: + dim = NULL; + if (IS_UNUSED == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + goto assign_dim_op_ret_null; + } + } else { + if (IS_UNUSED == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + goto assign_dim_op_ret_null; + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto assign_dim_op_array; + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = NULL; + if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_op_ret_null; + } + } + goto assign_dim_op_new_array; + } else { + dim = NULL; + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +assign_dim_op_ret_null: + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_W(container, NULL, IS_UNUSED OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_RW(container, NULL, IS_UNUSED OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_UNUSED == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_UNUSED == IS_UNUSED) { + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CONST == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CONST == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = NULL; + if (IS_UNUSED == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = RT_CONSTANT((opline+1), (opline+1)->op1); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = NULL; + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CONST & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_UNUSED == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = NULL; + value = RT_CONSTANT((opline+1), (opline+1)->op1); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = NULL; + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = NULL; +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_UNUSED != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_UNUSED == IS_UNUSED) { + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_TMP_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = NULL; + if (IS_UNUSED == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = NULL; + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_TMP_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_UNUSED == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = NULL; + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = NULL; + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = NULL; +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_UNUSED != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_UNUSED == IS_UNUSED) { + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = NULL; + if (IS_UNUSED == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = NULL; + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_UNUSED == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = NULL; + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = NULL; + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = NULL; +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_UNUSED != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_UNUSED == IS_UNUSED) { + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CV == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CV == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = NULL; + if (IS_UNUSED == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = NULL; + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CV & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_UNUSED == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = NULL; + value = EX_VAR((opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = NULL; + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = NULL; +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_UNUSED != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_VAR == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_UNUSED != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_VAR == IS_CONST && + IS_UNUSED == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_VAR != IS_CONST && + IS_UNUSED == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_UNUSED != IS_UNUSED) { + function_name = NULL; + if (IS_UNUSED != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_UNUSED & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_UNUSED == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_UNUSED != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_VAR == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + if (IS_VAR == IS_UNUSED) { + SAVE_OPLINE(); + zend_verify_missing_return_type(EX(func)); + HANDLE_EXCEPTION(); + } else { +/* prevents "undefined variable opline" errors */ +#if 0 || (IS_VAR != IS_UNUSED) + USE_OPLINE + zval *retval_ref, *retval_ptr; + zend_arg_info *ret_info = EX(func)->common.arg_info - 1; + retval_ref = retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (IS_VAR == IS_CONST) { + ZVAL_COPY(EX_VAR(opline->result.var), retval_ptr); + retval_ref = retval_ptr = EX_VAR(opline->result.var); + } else if (IS_VAR == IS_VAR) { + if (UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_INDIRECT)) { + retval_ref = retval_ptr = Z_INDIRECT_P(retval_ptr); + } + ZVAL_DEREF(retval_ptr); + } else if (IS_VAR == IS_CV) { + ZVAL_DEREF(retval_ptr); + } + + if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(retval_ptr)))) { + ZEND_VM_NEXT_OPCODE(); + } + + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) { + SAVE_OPLINE(); + retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) { + ZEND_VM_NEXT_OPCODE(); + } + } + + zend_reference *ref = NULL; + void *cache_slot = CACHE_ADDR(opline->op2.num); + if (UNEXPECTED(retval_ref != retval_ptr)) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + ref = Z_REF_P(retval_ref); + } else { + /* A cast might happen - unwrap the reference if this is a by-value return */ + if (Z_REFCOUNT_P(retval_ref) == 1) { + ZVAL_UNREF(retval_ref); + } else { + Z_DELREF_P(retval_ref); + ZVAL_COPY(retval_ref, retval_ptr); + } + retval_ptr = retval_ref; + } + } + + SAVE_OPLINE(); + if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) { + zend_verify_return_error(EX(func), retval_ptr); + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +#endif + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_VAR == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr))) { + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + ZVAL_NEW_REF(arg, arg); + zend_error(E_NOTICE, "Only variables should be passed by reference"); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(0)) { + if (!QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var; + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr) || + QUICK_ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num))) { + ZEND_VM_NEXT_OPCODE(); + } + } else { + if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var; + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr) || + ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num))) { + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + ZVAL_NEW_REF(arg, arg); + zend_error(E_NOTICE, "Only variables should be passed by reference"); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + +send_var: + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(1)) { + if (!QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var; + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr) || + QUICK_ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num))) { + ZEND_VM_NEXT_OPCODE(); + } + } else { + if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var; + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(arg, varptr); + + if (EXPECTED(Z_ISREF_P(varptr) || + ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num))) { + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + ZVAL_NEW_REF(arg, arg); + zend_error(E_NOTICE, "Only variables should be passed by reference"); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + +send_var: + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + SAVE_OPLINE(); + if (IS_UNUSED == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(0)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var_by_ref; + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_var_by_ref: + varptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_VAR == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(1)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var_by_ref; + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_var_by_ref: + varptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_VAR == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + if (IS_UNUSED == IS_CONST) { + // TODO: Would it make sense to share the cache slot with CHECK_FUNC_ARG? + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + varptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE(); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *result; + zend_function *constructor; + zend_class_entry *ce; + zend_execute_data *call; + + SAVE_OPLINE(); + if (IS_VAR == IS_CONST) { + ce = CACHED_PTR(opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->op2.num, ce); + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + result = EX_VAR(opline->result.var); + if (UNEXPECTED(object_init_ex(result, ce) != SUCCESS)) { + ZVAL_UNDEF(result); + HANDLE_EXCEPTION(); + } + + constructor = Z_OBJ_HT_P(result)->get_constructor(Z_OBJ_P(result)); + if (constructor == NULL) { + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + + /* If there are no arguments, skip over the DO_FCALL opcode. We check if the next + * opcode is DO_FCALL in case EXT instructions are used. */ + if (EXPECTED(opline->extended_value == 0 && (opline+1)->opcode == ZEND_DO_FCALL)) { + ZEND_VM_NEXT_OPCODE_EX(1, 2); + } + + /* Perform a dummy function call */ + call = zend_vm_stack_push_call_frame( + ZEND_CALL_FUNCTION, (zend_function *) &zend_pass_function, + opline->extended_value, NULL); + } else { + if (EXPECTED(constructor->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&constructor->op_array))) { + init_func_run_time_cache(&constructor->op_array); + } + /* We are not handling overloaded classes right now */ + call = zend_vm_stack_push_call_frame( + ZEND_CALL_FUNCTION | ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_THIS, + constructor, + opline->extended_value, + Z_OBJ_P(result)); + Z_ADDREF_P(result); + } + + call->prev_execute_data = EX(call); + EX(call) = call; + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + expr_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_TMP_VAR) { + /* pass */ + } else if (IS_VAR == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_VAR == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_UNUSED != IS_UNUSED) { + zval *offset = NULL; + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_UNUSED != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_UNUSED == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_VAR != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEPARATE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + if (UNEXPECTED(Z_ISREF_P(var_ptr))) { + if (UNEXPECTED(Z_REFCOUNT_P(var_ptr) == 1)) { + ZVAL_UNREF(var_ptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_VAR != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_VAR == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + } else { + zval *value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_VAR == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_VAR == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_UNUSED != IS_UNUSED) { + zval *key = NULL; + if ((IS_UNUSED & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MAKE_REF_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1 = EX_VAR(opline->op1.var); + + if (IS_VAR == IS_CV) { + if (UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_NEW_EMPTY_REF(op1); + Z_SET_REFCOUNT_P(op1, 2); + ZVAL_NULL(Z_REFVAL_P(op1)); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } else { + if (Z_ISREF_P(op1)) { + Z_ADDREF_P(op1); + } else { + ZVAL_MAKE_REF_EX(op1, 2); + } + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_INDIRECT)) { + op1 = Z_INDIRECT_P(op1); + if (EXPECTED(!Z_ISREF_P(op1))) { + ZVAL_MAKE_REF_EX(op1, 2); + } else { + GC_ADDREF(Z_REF_P(op1)); + } + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } else { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), op1); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_TYPE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + zend_string *type; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + type = zend_zval_get_legacy_type(op1); + if (EXPECTED(type)) { + ZVAL_INTERNED_STR(EX_VAR(opline->result.var), type); + } else { + ZVAL_STRING(EX_VAR(opline->result.var), "unknown type"); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num = opline->op2.num; + + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_TAIL_CALL(ZEND_SEND_REF_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + varptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + + if (IS_VAR == IS_CV) { + ZVAL_COPY(arg, varptr); + } else /* if (IS_VAR == IS_VAR) */ { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_STRICT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +assign_dim_op_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +assign_dim_op_new_array: + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + goto assign_dim_op_ret_null; + } + } else { + if (IS_CV == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + goto assign_dim_op_ret_null; + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto assign_dim_op_array; + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_op_ret_null; + } + } + goto assign_dim_op_new_array; + } else { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +assign_dim_op_ret_null: + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OP_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value; + + SAVE_OPLINE(); + value = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_W(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_RW(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_CV == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + zend_fetch_dimension_address_UNSET(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_VAR, property, IS_CV, + ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + dim = EX_VAR(opline->op2.var); + + if (IS_VAR == IS_VAR + && Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT + && UNEXPECTED(!Z_ISREF_P(container)) + ) { + zend_error(E_NOTICE, "Attempting to set reference to non referenceable value"); + zend_fetch_dimension_address_LIST_r(container, dim, IS_CV OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_fetch_dimension_address_W(container, dim, IS_CV OPLINE_CC EXECUTE_DATA_CC); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CV == IS_UNUSED) { + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CONST == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CONST == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = RT_CONSTANT((opline+1), (opline+1)->op1); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CONST & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CV == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = EX_VAR(opline->op2.var); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CV != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CV == IS_UNUSED) { + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_TMP_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_TMP_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CV == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = EX_VAR(opline->op2.var); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CV != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CV == IS_UNUSED) { + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CV == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = EX_VAR(opline->op2.var); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CV != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CV == IS_UNUSED) { + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CV == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CV == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CV & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CV == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = EX_VAR(opline->op2.var); + value = EX_VAR((opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CV != IS_UNUSED) { + + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (0 || UNEXPECTED(0)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(0)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (0 || UNEXPECTED(1)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(1)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *variable_ptr; + zval *value_ptr; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + value_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + if (IS_VAR == IS_VAR && + UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT)) { + + zend_throw_error(NULL, "Cannot assign by reference to an array dimension of an object"); + variable_ptr = &EG(uninitialized_zval); + } else if (IS_CV == IS_VAR && + opline->extended_value == ZEND_RETURNS_FUNCTION && + UNEXPECTED(!Z_ISREF_P(value_ptr))) { + + variable_ptr = zend_wrong_assign_to_variable_reference( + variable_ptr, value_ptr, &garbage OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_variable_reference(variable_ptr, value_ptr, &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), variable_ptr); + } + + if (garbage) { + GC_DTOR(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_VAR == IS_UNUSED) { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_VAR, property, IS_CV, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_VAR == IS_UNUSED) { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_VAR, property, IS_CV, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_VAR == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_CV != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_VAR == IS_CONST && + IS_CV == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_VAR != IS_CONST && + IS_CV == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_CV != IS_UNUSED) { + function_name = EX_VAR(opline->op2.var); + if (IS_CV != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_CV & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_CV == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_CV != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_VAR == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + expr_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_TMP_VAR) { + /* pass */ + } else if (IS_VAR == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_VAR == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_CV != IS_UNUSED) { + zval *offset = EX_VAR(opline->op2.var); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_VAR != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_ulong hval; + zend_string *key; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = EX_VAR(opline->op2.var); + + do { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + +unset_dim_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +offset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + key = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(key, hval)) { + goto num_index_dim; + } + } +str_index_dim: + ZEND_ASSERT(ht != &EG(symbol_table)); + zend_hash_del(ht, key); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_dim: + zend_hash_index_del(ht, hval); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto offset_again; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_NULL) { + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index_dim; + } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else { + zend_illegal_array_offset_unset(offset); + } + break; + } else if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto unset_dim_array; + } + } + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + container = ZVAL_UNDEFINED_OP1(); + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + offset = ZVAL_UNDEFINED_OP2(); + } + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + Z_OBJ_HT_P(container)->unset_dimension(Z_OBJ_P(container), offset); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { + zend_throw_error(NULL, "Cannot unset string offsets"); + } else if (UNEXPECTED(Z_TYPE_P(container) > IS_FALSE)) { + zend_throw_error(NULL, "Cannot unset offset in a non-array variable"); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_FALSE)) { + zend_false_to_array_deprecated(); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_VAR == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_VAR != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_VAR & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_VAR == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } + } else { + zval *value = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_VAR == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_VAR == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_VAR == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CV != IS_UNUSED) { + zval *key = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + if ((IS_CV & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array; + zval *value, *variable_ptr; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + + array = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + fe_ht = Z_ARRVAL_P(array); + pos = Z_FE_POS_P(array); + if (HT_IS_PACKED(fe_ht)) { + value = fe_ht->arPacked + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + pos++; + value++; + } + Z_FE_POS_P(array) = pos + 1; + if (0) { + ZVAL_LONG(EX_VAR(opline->result.var), pos); + } + } else { + Bucket *p; + + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + p++; + } + Z_FE_POS_P(array) = pos; + if (0) { + if (!p->key) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } + } + } + + variable_ptr = EX_VAR(opline->op2.var); + zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array; + zval *value, *variable_ptr; + uint32_t value_type; + HashTable *fe_ht; + HashPosition pos; + + array = EX_VAR(opline->op1.var); + SAVE_OPLINE(); + fe_ht = Z_ARRVAL_P(array); + pos = Z_FE_POS_P(array); + if (HT_IS_PACKED(fe_ht)) { + value = fe_ht->arPacked + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + pos++; + value++; + } + Z_FE_POS_P(array) = pos + 1; + if (1) { + ZVAL_LONG(EX_VAR(opline->result.var), pos); + } + } else { + Bucket *p; + + p = fe_ht->arData + pos; + while (1) { + if (UNEXPECTED(pos >= fe_ht->nNumUsed)) { + /* reached end of iteration */ + ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value); + ZEND_VM_CONTINUE(); + } + pos++; + value = &p->val; + value_type = Z_TYPE_INFO_P(value); + ZEND_ASSERT(value_type != IS_INDIRECT); + if (EXPECTED(value_type != IS_UNDEF)) { + break; + } + p++; + } + Z_FE_POS_P(array) = pos; + if (1) { + if (!p->key) { + ZVAL_LONG(EX_VAR(opline->result.var), p->h); + } else { + ZVAL_STR_COPY(EX_VAR(opline->result.var), p->key); + } + } + } + + variable_ptr = EX_VAR(opline->op2.var); + zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *obj; + zend_object *zobj; + zend_class_entry *ce, *scope; + zend_function *clone; + zend_object_clone_obj_t clone_call; + + SAVE_OPLINE(); + obj = &EX(This); + + do { + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(obj)) { + obj = Z_REFVAL_P(obj); + if (EXPECTED(Z_TYPE_P(obj) == IS_OBJECT)) { + break; + } + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(obj) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "__clone method called on non-object"); + + HANDLE_EXCEPTION(); + } + } while (0); + + zobj = Z_OBJ_P(obj); + ce = zobj->ce; + clone = ce->clone; + clone_call = zobj->handlers->clone_obj; + if (UNEXPECTED(clone_call == NULL)) { + zend_throw_error(NULL, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (clone && !(clone->common.fn_flags & ZEND_ACC_PUBLIC)) { + scope = EX(func)->op_array.scope; + if (clone->common.scope != scope) { + if (UNEXPECTED(clone->common.fn_flags & ZEND_ACC_PRIVATE) + || UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) { + zend_wrong_clone_call(clone, scope); + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(zobj)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + uint32_t fetch_type; + zend_class_entry *called_scope, *scope; + USE_OPLINE + + if (IS_UNUSED != IS_UNUSED) { + SAVE_OPLINE(); + zval *op = NULL; + if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_OBJECT) { + zend_type_error("Cannot use \"::class\" on %s", zend_zval_value_name(op)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op)->name); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + fetch_type = opline->op1.num; + scope = EX(func)->op_array.scope; + if (UNEXPECTED(scope == NULL)) { + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot use \"%s\" in the global scope", + fetch_type == ZEND_FETCH_CLASS_SELF ? "self" : + fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + switch (fetch_type) { + case ZEND_FETCH_CLASS_SELF: + ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->name); + break; + case ZEND_FETCH_CLASS_PARENT: + if (UNEXPECTED(scope->parent == NULL)) { + SAVE_OPLINE(); + zend_throw_error(NULL, + "Cannot use \"parent\" when current class scope has no parent"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->parent->name); + break; + case ZEND_FETCH_CLASS_STATIC: + if (Z_TYPE(EX(This)) == IS_OBJECT) { + called_scope = Z_OBJCE(EX(This)); + } else { + called_scope = Z_CE(EX(This)); + } + ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); + break; + EMPTY_SWITCH_DEFAULT_CASE() + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = RT_CONSTANT(opline, opline->op2); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = &EX(This); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, RT_CONSTANT(opline, opline->op2)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CONST == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = &EX(This); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_UNUSED, property, IS_CONST, + ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = &EX(This); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = &EX(This); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CONST == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CONST == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_UNUSED & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = &EX(This); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = &EX(This); + property = RT_CONSTANT(opline, opline->op2); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_UNUSED == IS_UNUSED) { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_UNUSED, property, IS_CONST, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = &EX(This); + property = RT_CONSTANT(opline, opline->op2); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_UNUSED == IS_UNUSED) { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_UNUSED, property, IS_CONST, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_INIT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var; + + /* Compiler allocates the necessary number of zval slots to keep the rope */ + rope = (zend_string**)EX_VAR(opline->result.var); + if (IS_CONST == IS_CONST) { + var = RT_CONSTANT(opline, opline->op2); + rope[0] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = RT_CONSTANT(opline, opline->op2); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (IS_CONST == IS_CV) { + rope[0] = zend_string_copy(Z_STR_P(var)); + } else { + rope[0] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[0] = zval_get_string_func(var); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *class_name; + USE_OPLINE + + SAVE_OPLINE(); + if (IS_CONST == IS_UNUSED) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->op1.num); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else if (IS_CONST == IS_CONST) { + zend_class_entry *ce = CACHED_PTR(opline->extended_value); + + if (UNEXPECTED(ce == NULL)) { + class_name = RT_CONSTANT(opline, opline->op2); + ce = zend_fetch_class_by_name(Z_STR_P(class_name), Z_STR_P(class_name + 1), opline->op1.num); + CACHE_PTR(opline->extended_value, ce); + } + Z_CE_P(EX_VAR(opline->result.var)) = ce; + } else { + class_name = RT_CONSTANT(opline, opline->op2); +try_class_name: + if (Z_TYPE_P(class_name) == IS_OBJECT) { + Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name); + } else if (Z_TYPE_P(class_name) == IS_STRING) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->op1.num); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) { + class_name = Z_REFVAL_P(class_name); + goto try_class_name; + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Class name must be a valid object or a string"); + } + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = &EX(This); + + if (IS_CONST != IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + + if (IS_CONST != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_UNUSED == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_UNUSED != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_UNUSED & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (IS_CONST != IS_CONST) { + + } + HANDLE_EXCEPTION(); + } + } + if (IS_CONST == IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + zend_invalid_method_call(object, function_name); + + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (IS_CONST == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (IS_CONST == IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (IS_CONST == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (IS_CONST != IS_CONST) { + + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_UNUSED & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_UNUSED == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_UNUSED == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_CONST != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_UNUSED == IS_CONST && + IS_CONST == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_UNUSED != IS_CONST && + IS_CONST == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_CONST != IS_UNUSED) { + function_name = RT_CONSTANT(opline, opline->op2); + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_CONST & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_CONST == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_CONST != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_UNUSED == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + uint32_t arg_num; + + if (IS_CONST == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg_num = zend_get_arg_offset_by_name( + EX(call)->func, arg_name, CACHE_ADDR(opline->result.num)) + 1; + if (UNEXPECTED(arg_num == 0)) { + /* Treat this as a by-value argument, and throw an error during SEND. */ + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + ZEND_VM_NEXT_OPCODE(); + } + } else { + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } else { + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } else { + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_constant *c; + + c = CACHED_PTR(opline->extended_value); + if (EXPECTED(c != NULL) && EXPECTED(!IS_SPECIAL_CACHE_VAL(c))) { + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value); + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + zend_quick_get_constant(RT_CONSTANT(opline, opline->op2) + 1, opline->op1.num OPLINE_CC EXECUTE_DATA_CC); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_class_entry *ce, *scope; + zend_class_constant *c; + zval *value, *zv, *constant_zv; + zend_string *constant_name; + USE_OPLINE + + SAVE_OPLINE(); + + do { + if (IS_UNUSED == IS_CONST && IS_CONST == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value + sizeof(void*)))) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + } + if (IS_UNUSED == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value))) { + ce = CACHED_PTR(opline->extended_value); + } else { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->extended_value, ce); + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + if (IS_UNUSED != IS_CONST + && IS_CONST == IS_CONST + && EXPECTED(CACHED_PTR(opline->extended_value) == ce)) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + + constant_zv = RT_CONSTANT(opline, opline->op2); + if (UNEXPECTED(Z_TYPE_P(constant_zv) != IS_STRING)) { + zend_invalid_class_constant_type_error(Z_TYPE_P(constant_zv)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + constant_name = Z_STR_P(constant_zv); + /* Magic 'class' for constant OP2 is caught at compile-time */ + if (IS_CONST != IS_CONST && UNEXPECTED(zend_string_equals_literal_ci(constant_name, "class"))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); + + ZEND_VM_NEXT_OPCODE(); + } + zv = IS_CONST == IS_CONST + ? zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), constant_name) + : zend_hash_find(CE_CONSTANTS_TABLE(ce), constant_name); + + if (EXPECTED(zv != NULL)) { + c = Z_PTR_P(zv); + scope = EX(func)->op_array.scope; + if (!zend_verify_const_access(c, scope)) { + zend_throw_error(NULL, "Cannot access %s constant %s::%s", zend_visibility_string(ZEND_CLASS_CONST_FLAGS(c)), ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + + if (ce->ce_flags & ZEND_ACC_TRAIT) { + zend_throw_error(NULL, "Cannot access trait constant %s::%s directly", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + + bool is_constant_deprecated = ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED; + if (UNEXPECTED(is_constant_deprecated)) { + zend_error(E_DEPRECATED, "Constant %s::%s is deprecated", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + + if (EG(exception)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + + value = &c->value; + // Enums require loading of all class constants to build the backed enum table + if (ce->ce_flags & ZEND_ACC_ENUM && ce->enum_backing_type != IS_UNDEF && ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { + if (UNEXPECTED(zend_update_class_constants(ce) == FAILURE)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + if (Z_TYPE_P(value) == IS_CONSTANT_AST) { + if (UNEXPECTED(zend_update_class_constant(c, constant_name, c->ce) != SUCCESS)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + if (IS_CONST == IS_CONST && !is_constant_deprecated) { + CACHE_POLYMORPHIC_PTR(opline->extended_value, ce, value); + } + } else { + zend_throw_error(NULL, "Undefined constant %s::%s", + ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } while (0); + + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), value); + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_UNUSED != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = &EX(This); + offset = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = &EX(This); + offset = RT_CONSTANT(opline, opline->op2); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_UNUSED != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = NULL; + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_UNUSED == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = NULL; + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_UNUSED == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = NULL; + + /* Consts, temporary variables and references need copying */ + if (IS_UNUSED == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_UNUSED == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_UNUSED == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CONST != IS_UNUSED) { + zval *key = RT_CONSTANT(opline, opline->op2); + if ((IS_CONST & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zend_class_entry *ce, *scope; + zend_class_constant *c; + zval *value, *zv, *constant_zv; + zend_string *constant_name; + USE_OPLINE + + SAVE_OPLINE(); + + do { + if (IS_UNUSED == IS_CONST && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value + sizeof(void*)))) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + } + if (IS_UNUSED == IS_CONST) { + if (EXPECTED(CACHED_PTR(opline->extended_value))) { + ce = CACHED_PTR(opline->extended_value); + } else { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->extended_value, ce); + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + if (IS_UNUSED != IS_CONST + && (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST + && EXPECTED(CACHED_PTR(opline->extended_value) == ce)) { + value = CACHED_PTR(opline->extended_value + sizeof(void*)); + break; + } + + constant_zv = _get_zval_ptr_tmpvarcv(opline->op2_type, opline->op2, BP_VAR_R EXECUTE_DATA_CC); + if (UNEXPECTED(Z_TYPE_P(constant_zv) != IS_STRING)) { + zend_invalid_class_constant_type_error(Z_TYPE_P(constant_zv)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + constant_name = Z_STR_P(constant_zv); + /* Magic 'class' for constant OP2 is caught at compile-time */ + if ((IS_TMP_VAR|IS_VAR|IS_CV) != IS_CONST && UNEXPECTED(zend_string_equals_literal_ci(constant_name, "class"))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), ce->name); + FREE_OP(opline->op2_type, opline->op2.var); + ZEND_VM_NEXT_OPCODE(); + } + zv = (IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST + ? zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), constant_name) + : zend_hash_find(CE_CONSTANTS_TABLE(ce), constant_name); + + if (EXPECTED(zv != NULL)) { + c = Z_PTR_P(zv); + scope = EX(func)->op_array.scope; + if (!zend_verify_const_access(c, scope)) { + zend_throw_error(NULL, "Cannot access %s constant %s::%s", zend_visibility_string(ZEND_CLASS_CONST_FLAGS(c)), ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + + if (ce->ce_flags & ZEND_ACC_TRAIT) { + zend_throw_error(NULL, "Cannot access trait constant %s::%s directly", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + + bool is_constant_deprecated = ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED; + if (UNEXPECTED(is_constant_deprecated)) { + zend_error(E_DEPRECATED, "Constant %s::%s is deprecated", ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + + if (EG(exception)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + + value = &c->value; + // Enums require loading of all class constants to build the backed enum table + if (ce->ce_flags & ZEND_ACC_ENUM && ce->enum_backing_type != IS_UNDEF && ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { + if (UNEXPECTED(zend_update_class_constants(ce) == FAILURE)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + if (Z_TYPE_P(value) == IS_CONSTANT_AST) { + if (UNEXPECTED(zend_update_class_constant(c, constant_name, c->ce) != SUCCESS)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } + if ((IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && !is_constant_deprecated) { + CACHE_POLYMORPHIC_PTR(opline->extended_value, ce, value); + } + } else { + zend_throw_error(NULL, "Undefined constant %s::%s", + ZSTR_VAL(ce->name), ZSTR_VAL(constant_name)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + FREE_OP(opline->op2_type, opline->op2.var); + HANDLE_EXCEPTION(); + } + } while (0); + + ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), value); + + FREE_OP(opline->op2_type, opline->op2.var); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = &EX(This); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = &EX(This); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), + (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = &EX(This); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = &EX(This); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_UNUSED & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = &EX(This); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = &EX(This); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_UNUSED == IS_UNUSED) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = &EX(This); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_UNUSED == IS_UNUSED) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var; + + /* Compiler allocates the necessary number of zval slots to keep the rope */ + rope = (zend_string**)EX_VAR(opline->result.var); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + var = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + rope[0] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CV) { + rope[0] = zend_string_copy(Z_STR_P(var)); + } else { + rope[0] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[0] = zval_get_string_func(var); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *class_name; + USE_OPLINE + + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->op1.num); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_class_entry *ce = CACHED_PTR(opline->extended_value); + + if (UNEXPECTED(ce == NULL)) { + class_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + ce = zend_fetch_class_by_name(Z_STR_P(class_name), Z_STR_P(class_name + 1), opline->op1.num); + CACHE_PTR(opline->extended_value, ce); + } + Z_CE_P(EX_VAR(opline->result.var)) = ce; + } else { + class_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +try_class_name: + if (Z_TYPE_P(class_name) == IS_OBJECT) { + Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name); + } else if (Z_TYPE_P(class_name) == IS_STRING) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->op1.num); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) { + class_name = Z_REFVAL_P(class_name); + goto try_class_name; + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Class name must be a valid object or a string"); + } + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = &EX(This); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_UNUSED == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_UNUSED != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_UNUSED & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + HANDLE_EXCEPTION(); + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + zend_invalid_method_call(object, function_name); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_UNUSED & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_UNUSED == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_UNUSED == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_UNUSED == IS_CONST && + (IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_UNUSED != IS_CONST && + (IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_UNUSED == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_UNUSED != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = &EX(This); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = &EX(This); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_UNUSED != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = NULL; + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_UNUSED == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = NULL; + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_UNUSED == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = NULL; + + /* Consts, temporary variables and references need copying */ + if (IS_UNUSED == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_UNUSED == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_UNUSED == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *key = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *class_name; + USE_OPLINE + + SAVE_OPLINE(); + if (IS_UNUSED == IS_UNUSED) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->op1.num); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else if (IS_UNUSED == IS_CONST) { + zend_class_entry *ce = CACHED_PTR(opline->extended_value); + + if (UNEXPECTED(ce == NULL)) { + class_name = NULL; + ce = zend_fetch_class_by_name(Z_STR_P(class_name), Z_STR_P(class_name + 1), opline->op1.num); + CACHE_PTR(opline->extended_value, ce); + } + Z_CE_P(EX_VAR(opline->result.var)) = ce; + } else { + class_name = NULL; +try_class_name: + if (Z_TYPE_P(class_name) == IS_OBJECT) { + Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name); + } else if (Z_TYPE_P(class_name) == IS_STRING) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->op1.num); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) { + class_name = Z_REFVAL_P(class_name); + goto try_class_name; + } else { + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Class name must be a valid object or a string"); + } + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_UNUSED == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_UNUSED != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_UNUSED == IS_CONST && + IS_UNUSED == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_UNUSED != IS_CONST && + IS_UNUSED == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_UNUSED != IS_UNUSED) { + function_name = NULL; + if (IS_UNUSED != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_UNUSED & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_UNUSED == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_UNUSED != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_UNUSED == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + if (IS_UNUSED == IS_UNUSED) { + SAVE_OPLINE(); + zend_verify_missing_return_type(EX(func)); + HANDLE_EXCEPTION(); + } else { +/* prevents "undefined variable opline" errors */ +#if 0 || (IS_UNUSED != IS_UNUSED) + USE_OPLINE + zval *retval_ref, *retval_ptr; + zend_arg_info *ret_info = EX(func)->common.arg_info - 1; + retval_ref = retval_ptr = NULL; + + if (IS_UNUSED == IS_CONST) { + ZVAL_COPY(EX_VAR(opline->result.var), retval_ptr); + retval_ref = retval_ptr = EX_VAR(opline->result.var); + } else if (IS_UNUSED == IS_VAR) { + if (UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_INDIRECT)) { + retval_ref = retval_ptr = Z_INDIRECT_P(retval_ptr); + } + ZVAL_DEREF(retval_ptr); + } else if (IS_UNUSED == IS_CV) { + ZVAL_DEREF(retval_ptr); + } + + if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(retval_ptr)))) { + ZEND_VM_NEXT_OPCODE(); + } + + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) { + SAVE_OPLINE(); + retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) { + ZEND_VM_NEXT_OPCODE(); + } + } + + zend_reference *ref = NULL; + void *cache_slot = CACHE_ADDR(opline->op2.num); + if (UNEXPECTED(retval_ref != retval_ptr)) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + ref = Z_REF_P(retval_ref); + } else { + /* A cast might happen - unwrap the reference if this is a by-value return */ + if (Z_REFCOUNT_P(retval_ref) == 1) { + ZVAL_UNREF(retval_ref); + } else { + Z_DELREF_P(retval_ref); + ZVAL_COPY(retval_ref, retval_ptr); + } + retval_ptr = retval_ref; + } + } + + SAVE_OPLINE(); + if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) { + zend_verify_return_error(EX(func), retval_ptr); + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +#endif + } +} + +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_NEVER_TYPE_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + SAVE_OPLINE(); + zend_verify_never_error(EX(func)); + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg_num = zend_get_arg_offset_by_name( + EX(call)->func, arg_name, CACHE_ADDR(opline->result.num)) + 1; + if (UNEXPECTED(arg_num == 0)) { + /* Treat this as a by-value argument, and throw an error during SEND. */ + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + ZEND_VM_NEXT_OPCODE(); + } + } else { + arg_num = opline->op2.num; + } + + if (EXPECTED(0)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } else { + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } else { + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg_num = zend_get_arg_offset_by_name( + EX(call)->func, arg_name, CACHE_ADDR(opline->result.num)) + 1; + if (UNEXPECTED(arg_num == 0)) { + /* Treat this as a by-value argument, and throw an error during SEND. */ + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + ZEND_VM_NEXT_OPCODE(); + } + } else { + arg_num = opline->op2.num; + } + + if (EXPECTED(1)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } else { + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } else { + ZEND_DEL_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_execute_data *call = execute_data->call; + if (EXPECTED(!(ZEND_CALL_INFO(call) & ZEND_CALL_MAY_HAVE_UNDEF))) { + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + zend_handle_undef_args(call); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *result; + zend_function *constructor; + zend_class_entry *ce; + zend_execute_data *call; + + SAVE_OPLINE(); + if (IS_UNUSED == IS_CONST) { + ce = CACHED_PTR(opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + CACHE_PTR(opline->op2.num, ce); + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + result = EX_VAR(opline->result.var); + if (UNEXPECTED(object_init_ex(result, ce) != SUCCESS)) { + ZVAL_UNDEF(result); + HANDLE_EXCEPTION(); + } + + constructor = Z_OBJ_HT_P(result)->get_constructor(Z_OBJ_P(result)); + if (constructor == NULL) { + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + + /* If there are no arguments, skip over the DO_FCALL opcode. We check if the next + * opcode is DO_FCALL in case EXT instructions are used. */ + if (EXPECTED(opline->extended_value == 0 && (opline+1)->opcode == ZEND_DO_FCALL)) { + ZEND_VM_NEXT_OPCODE_EX(1, 2); + } + + /* Perform a dummy function call */ + call = zend_vm_stack_push_call_frame( + ZEND_CALL_FUNCTION, (zend_function *) &zend_pass_function, + opline->extended_value, NULL); + } else { + if (EXPECTED(constructor->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&constructor->op_array))) { + init_func_run_time_cache(&constructor->op_array); + } + /* We are not handling overloaded classes right now */ + call = zend_vm_stack_push_call_frame( + ZEND_CALL_FUNCTION | ZEND_CALL_RELEASE_THIS | ZEND_CALL_HAS_THIS, + constructor, + opline->extended_value, + Z_OBJ_P(result)); + Z_ADDREF_P(result); + } + + call->prev_execute_data = EX(call); + EX(call) = call; + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_UNUSED != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_UNUSED != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = NULL; + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_UNUSED == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = NULL; + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_UNUSED == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = NULL; + + /* Consts, temporary variables and references need copying */ + if (IS_UNUSED == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_UNUSED == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_UNUSED == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_UNUSED != IS_UNUSED) { + zval *key = NULL; + if ((IS_UNUSED & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_THIS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (EXPECTED(Z_TYPE(EX(This)) == IS_OBJECT)) { + zval *result = EX_VAR(opline->result.var); + + ZVAL_OBJ(result, Z_OBJ(EX(This))); + Z_ADDREF_P(result); + ZEND_VM_NEXT_OPCODE(); + } else { + ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_GLOBALS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + /* For symbol tables we need to deal with exactly the same problems as for property tables. */ + ZVAL_ARR(EX_VAR(opline->result.var), + zend_proptable_to_symtable(&EG(symbol_table), /* always_duplicate */ 1)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_THIS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + ZVAL_BOOL(EX_VAR(opline->result.var), + (opline->extended_value & ZEND_ISEMPTY) ^ + (Z_TYPE(EX(This)) == IS_OBJECT)); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (IS_UNUSED == IS_UNUSED) { + SAVE_OPLINE(); + if (UNEXPECTED(!EX(func)->common.scope)) { + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } else { + zend_error(E_DEPRECATED, "Calling get_class() without arguments is deprecated"); + ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zval *op1; + + SAVE_OPLINE(); + op1 = NULL; + while (1) { + if (Z_TYPE_P(op1) == IS_OBJECT) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op1)->name); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else { + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_value_name(op1)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } + break; + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CALLED_CLASS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE(EX(This))->name); + } else if (Z_CE(EX(This))) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_CE(EX(This))->name); + } else { + ZEND_ASSERT(!EX(func)->common.scope); + SAVE_OPLINE(); + zend_throw_error(NULL, "get_called_class() must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_NUM_ARGS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + ZVAL_LONG(EX_VAR(opline->result.var), EX_NUM_ARGS()); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_array *ht; + uint32_t arg_count, result_size, skip; + + arg_count = EX_NUM_ARGS(); + if (IS_UNUSED == IS_CONST) { + skip = Z_LVAL_P(RT_CONSTANT(opline, opline->op1)); + if (arg_count < skip) { + result_size = 0; + } else { + result_size = arg_count - skip; + } + } else { + skip = 0; + result_size = arg_count; + } + + if (result_size) { + SAVE_OPLINE(); + uint32_t first_extra_arg = EX(func)->op_array.num_args; + + ht = zend_new_array(result_size); + ZVAL_ARR(EX_VAR(opline->result.var), ht); + zend_hash_real_init_packed(ht); + ZEND_HASH_FILL_PACKED(ht) { + zval *p, *q; + uint32_t i = skip; + p = EX_VAR_NUM(i); + if (arg_count > first_extra_arg) { + while (i < first_extra_arg) { + q = p; + if (EXPECTED(Z_TYPE_INFO_P(q) != IS_UNDEF)) { + ZVAL_DEREF(q); + if (Z_OPT_REFCOUNTED_P(q)) { + Z_ADDREF_P(q); + } + ZEND_HASH_FILL_SET(q); + } else { + ZEND_HASH_FILL_SET_NULL(); + } + ZEND_HASH_FILL_NEXT(); + p++; + i++; + } + if (skip < first_extra_arg) { + skip = 0; + } else { + skip -= first_extra_arg; + } + p = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T + skip); + } + while (i < arg_count) { + q = p; + if (EXPECTED(Z_TYPE_INFO_P(q) != IS_UNDEF)) { + ZVAL_DEREF(q); + if (Z_OPT_REFCOUNTED_P(q)) { + Z_ADDREF_P(q); + } + ZEND_HASH_FILL_SET(q); + } else { + ZEND_HASH_FILL_SET_NULL(); + } + ZEND_HASH_FILL_NEXT(); + p++; + i++; + } + } ZEND_HASH_FILL_END(); + ht->nNumOfElements = result_size; + } else { + ZVAL_EMPTY_ARRAY(EX_VAR(opline->result.var)); + } + ZEND_VM_NEXT_OPCODE(); +} + +/* Contrary to what its name indicates, ZEND_COPY_TMP may receive and define references. */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_execute_data *call = EX(call); + + zend_closure_from_frame(EX_VAR(opline->result.var), call); + + if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { + OBJ_RELEASE(Z_OBJ(call->This)); + } + + EX(call) = call->prev_execute_data; + + zend_vm_stack_free_call_frame(call); + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = &EX(This); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = &EX(This); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CV == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = &EX(This); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_UNUSED, property, IS_CV, + ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = &EX(This); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = &EX(This); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CV == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CV == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_UNUSED & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_UNUSED & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = &EX(This); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_UNUSED == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = &EX(This); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = &EX(This); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_UNUSED == IS_UNUSED) { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_UNUSED, property, IS_CV, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = &EX(This); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_UNUSED == IS_UNUSED) { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_UNUSED, property, IS_CV, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_INIT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string **rope; + zval *var; + + /* Compiler allocates the necessary number of zval slots to keep the rope */ + rope = (zend_string**)EX_VAR(opline->result.var); + if (IS_CV == IS_CONST) { + var = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + rope[0] = Z_STR_P(var); + if (UNEXPECTED(Z_REFCOUNTED_P(var))) { + Z_ADDREF_P(var); + } + } else { + var = EX_VAR(opline->op2.var); + if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) { + if (IS_CV == IS_CV) { + rope[0] = zend_string_copy(Z_STR_P(var)); + } else { + rope[0] = Z_STR_P(var); + } + } else { + SAVE_OPLINE(); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + rope[0] = zval_get_string_func(var); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *class_name; + USE_OPLINE + + SAVE_OPLINE(); + if (IS_CV == IS_UNUSED) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->op1.num); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else if (IS_CV == IS_CONST) { + zend_class_entry *ce = CACHED_PTR(opline->extended_value); + + if (UNEXPECTED(ce == NULL)) { + class_name = EX_VAR(opline->op2.var); + ce = zend_fetch_class_by_name(Z_STR_P(class_name), Z_STR_P(class_name + 1), opline->op1.num); + CACHE_PTR(opline->extended_value, ce); + } + Z_CE_P(EX_VAR(opline->result.var)) = ce; + } else { + class_name = EX_VAR(opline->op2.var); +try_class_name: + if (Z_TYPE_P(class_name) == IS_OBJECT) { + Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name); + } else if (Z_TYPE_P(class_name) == IS_STRING) { + Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->op1.num); + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) { + class_name = Z_REFVAL_P(class_name); + goto try_class_name; + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Class name must be a valid object or a string"); + } + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = &EX(This); + + if (IS_CV != IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + + if (IS_CV != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_UNUSED == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_UNUSED != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_UNUSED & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (IS_CV != IS_CONST) { + + } + HANDLE_EXCEPTION(); + } + } + if (IS_CV == IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + zend_invalid_method_call(object, function_name); + + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (IS_CV == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (IS_CV == IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (IS_CV == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (IS_CV != IS_CONST) { + + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_UNUSED & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_UNUSED == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zend_class_entry *ce; + uint32_t call_info; + zend_function *fbc; + zend_execute_data *call; + + SAVE_OPLINE(); + + if (IS_UNUSED == IS_CONST) { + /* no function found. try a static method in class */ + ce = CACHED_PTR(opline->result.num); + if (UNEXPECTED(ce == NULL)) { + ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), Z_STR_P(RT_CONSTANT(opline, opline->op1) + 1), ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + if (IS_CV != IS_CONST) { + CACHE_PTR(opline->result.num, ce); + } + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op1.num); + if (UNEXPECTED(ce == NULL)) { + + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op1.var)); + } + + if (IS_UNUSED == IS_CONST && + IS_CV == IS_CONST && + EXPECTED((fbc = CACHED_PTR(opline->result.num + sizeof(void*))) != NULL)) { + /* nothing to do */ + } else if (IS_UNUSED != IS_CONST && + IS_CV == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == ce)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else if (IS_CV != IS_UNUSED) { + function_name = EX_VAR(opline->op2.var); + if (IS_CV != IS_CONST) { + if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (IS_CV & (IS_VAR|IS_CV) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + HANDLE_EXCEPTION(); + } while (0); + } + } + + if (ce->get_static_method) { + fbc = ce->get_static_method(ce, Z_STR_P(function_name)); + } else { + fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + } + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(ce, Z_STR_P(function_name)); + } + + HANDLE_EXCEPTION(); + } + if (IS_CV == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(!(fbc->common.scope->ce_flags & ZEND_ACC_TRAIT))) { + CACHE_POLYMORPHIC_PTR(opline->result.num, ce, fbc); + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + if (IS_CV != IS_CONST) { + + } + } else { + if (UNEXPECTED(ce->constructor == NULL)) { + zend_throw_error(NULL, "Cannot call constructor"); + HANDLE_EXCEPTION(); + } + if (Z_TYPE(EX(This)) == IS_OBJECT && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name)); + HANDLE_EXCEPTION(); + } + fbc = ce->constructor; + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) { + if (Z_TYPE(EX(This)) == IS_OBJECT && instanceof_function(Z_OBJCE(EX(This)), ce)) { + ce = (zend_class_entry*)Z_OBJ(EX(This)); + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + } else { + zend_non_static_method_call(fbc); + HANDLE_EXCEPTION(); + } + } else { + /* previous opcode is ZEND_FETCH_CLASS */ + if (IS_UNUSED == IS_UNUSED + && ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF)) { + if (Z_TYPE(EX(This)) == IS_OBJECT) { + ce = Z_OBJCE(EX(This)); + } else { + ce = Z_CE(EX(This)); + } + } + call_info = ZEND_CALL_NESTED_FUNCTION; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, ce); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_UNUSED != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = &EX(This); + offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_UNUSED == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = &EX(This); + offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + if (IS_UNUSED == IS_CONST || + (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_UNUSED != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_UNUSED & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = NULL; + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_UNUSED == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = NULL; + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_UNUSED == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = NULL; + + /* Consts, temporary variables and references need copying */ + if (IS_UNUSED == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_UNUSED == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_UNUSED == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CV != IS_UNUSED) { + zval *key = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + if ((IS_CV & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + + val = EX_VAR(opline->op1.var); + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + /* The result and op1 can be the same cv zval */ + const uint32_t orig_val_type = Z_TYPE_INFO_P(val); + ZVAL_TRUE(EX_VAR(opline->result.var)); + if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } else { + SAVE_OPLINE(); + ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_inc_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + SAVE_OPLINE(); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, NULL OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + increment_function(var_ptr); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_increment_function(var_ptr); + if (UNEXPECTED(0)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_pre_inc_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_increment_function(var_ptr); + if (UNEXPECTED(1)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_pre_inc_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_dec_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + SAVE_OPLINE(); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, NULL OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + decrement_function(var_ptr); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_decrement_function(var_ptr); + if (UNEXPECTED(0)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_pre_dec_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + fast_long_decrement_function(var_ptr); + if (UNEXPECTED(1)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_pre_dec_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_inc_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + SAVE_OPLINE(); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, EX_VAR(opline->result.var) OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + + increment_function(var_ptr); + } while (0); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_increment_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_post_inc_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_dec_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + SAVE_OPLINE(); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var_ptr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(var_ptr); + } + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_incdec_typed_ref(ref, EX_VAR(opline->result.var) OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + + decrement_function(var_ptr); + } while (0); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(var_ptr) == IS_LONG)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_decrement_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); + } + + ZEND_VM_TAIL_CALL(zend_post_dec_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *z; + + SAVE_OPLINE(); + z = EX_VAR(opline->op1.var); + + if (Z_TYPE_P(z) == IS_STRING) { + zend_string *str = Z_STR_P(z); + + if (ZSTR_LEN(str) != 0) { + zend_write(ZSTR_VAL(str), ZSTR_LEN(str)); + } + } else { + zend_string *str = zval_get_string_func(z); + + if (ZSTR_LEN(str) != 0) { + zend_write(ZSTR_VAL(str), ZSTR_LEN(str)); + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(z) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_string_release_ex(str, 0); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + uint8_t op1_type; + + val = EX_VAR(opline->op1.var); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + SAVE_OPLINE(); + op1_type = IS_CV; + if (i_zend_is_true(val)) { + opline++; + } else { + opline = OP_JMP_ADDR(opline, opline->op2); + } + if (op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(val); + } + ZEND_VM_JMP(opline); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + uint8_t op1_type; + + val = EX_VAR(opline->op1.var); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + op1_type = IS_CV; + if (i_zend_is_true(val)) { + opline = OP_JMP_ADDR(opline, opline->op2); + } else { + opline++; + } + if (op1_type & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_nogc(val); + } + ZEND_VM_JMP(opline); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + bool ret; + + val = EX_VAR(opline->op1.var); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_NEXT_OPCODE(); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + SAVE_OPLINE(); + ret = i_zend_is_true(val); + + if (ret) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + opline++; + } else { + ZVAL_FALSE(EX_VAR(opline->result.var)); + opline = OP_JMP_ADDR(opline, opline->op2); + } + ZEND_VM_JMP(opline); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + bool ret; + + val = EX_VAR(opline->op1.var); + + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + ret = i_zend_is_true(val); + + if (ret) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + opline = OP_JMP_ADDR(opline, opline->op2); + } else { + ZVAL_FALSE(EX_VAR(opline->result.var)); + opline++; + } + ZEND_VM_JMP(opline); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = EX_VAR(opline->op1.var); + return_value = EX(return_value); + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (IS_CV & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (IS_CV == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + + + + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + SAVE_OPLINE(); + + return_value = EX(return_value); + + do { + if ((IS_CV & (IS_CONST|IS_TMP_VAR)) || + (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { + /* Not supposed to happen, but we'll allow it */ + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + + retval_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + if (!return_value) { + + } else { + if (IS_CV == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + break; + } + + ZVAL_NEW_REF(return_value, retval_ptr); + if (IS_CV == IS_CONST) { + Z_TRY_ADDREF_P(retval_ptr); + } + } + break; + } + + retval_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { + zend_error(E_NOTICE, "Only variable references should be returned by reference"); + if (return_value) { + ZVAL_NEW_REF(return_value, retval_ptr); + } else { + + } + break; + } + } + + if (return_value) { + if (Z_ISREF_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } else { + ZVAL_MAKE_REF_EX(retval_ptr, 2); + } + ZVAL_REF(return_value, Z_REF_P(retval_ptr)); + } + + } while (0); + + + ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *retval; + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + retval = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + + /* Copy return value into generator->retval */ + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(&generator->retval, retval); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { + Z_ADDREF(generator->retval); + } + } + } else if (IS_CV == IS_CV) { + ZVAL_COPY_DEREF(&generator->retval, retval); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_refcounted *ref = Z_COUNTED_P(retval); + + retval = Z_REFVAL_P(retval); + ZVAL_COPY_VALUE(&generator->retval, retval); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval)) { + Z_ADDREF_P(retval); + } + } else { + ZVAL_COPY_VALUE(&generator->retval, retval); + } + } + + EG(current_execute_data) = EX(prev_execute_data); + + /* Close the generator to free up resources */ + zend_generator_close(generator, 1); + + /* Pass execution back to handling code */ + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + SAVE_OPLINE(); + value = EX_VAR(opline->op1.var); + + do { + if (IS_CV == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + if (EXPECTED(Z_TYPE_P(value) == IS_OBJECT)) { + break; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Can only throw objects"); + + HANDLE_EXCEPTION(); + } + } while (0); + + zend_exception_save(); + Z_TRY_ADDREF_P(value); + zend_throw_exception_object(value); + zend_exception_restore(); + + HANDLE_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *arg, *param; + + SAVE_OPLINE(); + + arg = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + param = ZEND_CALL_VAR(EX(call), opline->result.var); + if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) { + zend_param_must_be_ref(EX(call)->func, opline->op2.num); + Z_TRY_ADDREF_P(arg); + ZVAL_NEW_REF(param, arg); + } else { + ZVAL_COPY(param, arg); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val; + + val = EX_VAR(opline->op1.var); + if (Z_TYPE_INFO_P(val) == IS_TRUE) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) { + /* The result and op1 can be the same cv zval */ + const uint32_t orig_val_type = Z_TYPE_INFO_P(val); + ZVAL_FALSE(EX_VAR(opline->result.var)); + if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + } else { + SAVE_OPLINE(); + ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *obj; + zend_object *zobj; + zend_class_entry *ce, *scope; + zend_function *clone; + zend_object_clone_obj_t clone_call; + + SAVE_OPLINE(); + obj = EX_VAR(opline->op1.var); + + do { + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(obj)) { + obj = Z_REFVAL_P(obj); + if (EXPECTED(Z_TYPE_P(obj) == IS_OBJECT)) { + break; + } + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(obj) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "__clone method called on non-object"); + + HANDLE_EXCEPTION(); + } + } while (0); + + zobj = Z_OBJ_P(obj); + ce = zobj->ce; + clone = ce->clone; + clone_call = zobj->handlers->clone_obj; + if (UNEXPECTED(clone_call == NULL)) { + zend_throw_error(NULL, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (clone && !(clone->common.fn_flags & ZEND_ACC_PUBLIC)) { + scope = EX(func)->op_array.scope; + if (clone->common.scope != scope) { + if (UNEXPECTED(clone->common.fn_flags & ZEND_ACC_PRIVATE) + || UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) { + zend_wrong_clone_call(clone, scope); + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + } + + ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(zobj)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + zval *result = EX_VAR(opline->result.var); + HashTable *ht; + + SAVE_OPLINE(); + expr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + + switch (opline->extended_value) { + case IS_LONG: + ZVAL_LONG(result, zval_get_long(expr)); + break; + case IS_DOUBLE: + ZVAL_DOUBLE(result, zval_get_double(expr)); + break; + case IS_STRING: + ZVAL_STR(result, zval_get_string(expr)); + break; + default: + ZEND_ASSERT(opline->extended_value != _IS_BOOL && "Must use ZEND_BOOL instead"); + if (IS_CV & (IS_VAR|IS_CV)) { + ZVAL_DEREF(expr); + } + /* If value is already of correct type, return it directly */ + if (Z_TYPE_P(expr) == opline->extended_value) { + ZVAL_COPY_VALUE(result, expr); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_CV != IS_TMP_VAR) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (opline->extended_value == IS_ARRAY) { + if (IS_CV == IS_CONST || Z_TYPE_P(expr) != IS_OBJECT || Z_OBJCE_P(expr) == zend_ce_closure) { + if (Z_TYPE_P(expr) != IS_NULL) { + ZVAL_ARR(result, zend_new_array(1)); + expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } else { + ZVAL_EMPTY_ARRAY(result); + } + } else if (Z_OBJ_P(expr)->properties == NULL + && Z_OBJ_HT_P(expr)->get_properties_for == NULL + && Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) { + /* Optimized version without rebuilding properties HashTable */ + ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr))); + } else { + HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST); + if (obj_ht) { + /* fast copy */ + ZVAL_ARR(result, zend_proptable_to_symtable(obj_ht, + (Z_OBJCE_P(expr)->default_properties_count || + Z_OBJ_P(expr)->handlers != &std_object_handlers || + GC_IS_RECURSIVE(obj_ht)))); + zend_release_properties(obj_ht); + } else { + ZVAL_EMPTY_ARRAY(result); + } + } + } else { + ZEND_ASSERT(opline->extended_value == IS_OBJECT); + ZVAL_OBJ(result, zend_objects_new(zend_standard_class_def)); + if (Z_TYPE_P(expr) == IS_ARRAY) { + ht = zend_symtable_to_proptable(Z_ARR_P(expr)); + if (GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) { + /* TODO: try not to duplicate immutable arrays as well ??? */ + ht = zend_array_dup(ht); + } + Z_OBJ_P(result)->properties = ht; + } else if (Z_TYPE_P(expr) != IS_NULL) { + Z_OBJ_P(result)->properties = ht = zend_new_array(1); + expr = zend_hash_add_new(ht, ZSTR_KNOWN(ZEND_STR_SCALAR), expr); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(expr))) Z_ADDREF_P(expr); + } else { + if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr); + } + } + } + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_op_array *new_op_array; + zval *inc_filename; + + SAVE_OPLINE(); + inc_filename = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + new_op_array = zend_include_or_eval(inc_filename, opline->extended_value); + if (UNEXPECTED(EG(exception) != NULL)) { + + if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) { + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (new_op_array == ZEND_FAKE_OP_ARRAY) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_TRUE(EX_VAR(opline->result.var)); + } + } else if (UNEXPECTED(new_op_array == NULL)) { + if (RETURN_VALUE_USED(opline)) { + ZVAL_FALSE(EX_VAR(opline->result.var)); + } + } else if (new_op_array->last == 1 + && new_op_array->opcodes[0].opcode == ZEND_RETURN + && new_op_array->opcodes[0].op1_type == IS_CONST + && EXPECTED(zend_execute_ex == execute_ex)) { + if (RETURN_VALUE_USED(opline)) { + const zend_op *op = new_op_array->opcodes; + + ZVAL_COPY(EX_VAR(opline->result.var), RT_CONSTANT(op, op->op1)); + } + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + } else { + zval *return_value = NULL; + zend_execute_data *call; + if (RETURN_VALUE_USED(opline)) { + return_value = EX_VAR(opline->result.var); + } + + new_op_array->scope = EX(func)->op_array.scope; + + call = zend_vm_stack_push_call_frame( + (Z_TYPE_INFO(EX(This)) & ZEND_CALL_HAS_THIS) | ZEND_CALL_NESTED_CODE | ZEND_CALL_HAS_SYMBOL_TABLE, + (zend_function*)new_op_array, 0, + Z_PTR(EX(This))); + + if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) { + call->symbol_table = EX(symbol_table); + } else { + call->symbol_table = zend_rebuild_symbol_table(); + } + + call->prev_execute_data = execute_data; + i_init_code_execute_data(call, new_op_array, return_value); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + + ZEND_VM_ENTER(); + } else { + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + zend_vm_stack_free_call_frame(call); + } + + zend_destroy_static_vars(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array_ptr, *result; + + SAVE_OPLINE(); + + array_ptr = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (IS_CV != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(array_ptr); + } + Z_FE_POS_P(result) = 0; + + ZEND_VM_NEXT_OPCODE(); + } else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + zend_object *zobj = Z_OBJ_P(array_ptr); + if (!zobj->ce->get_iterator) { + HashTable *properties = zobj->properties; + if (properties) { + if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(properties); + } + properties = zobj->properties = zend_array_dup(properties); + } + } else { + properties = zobj->handlers->get_properties(zobj); + } + + result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, array_ptr); + if (IS_CV != IS_TMP_VAR) { + Z_ADDREF_P(array_ptr); + } + + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(result) = (uint32_t) -1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *array_ptr, *array_ref; + + SAVE_OPLINE(); + + if (IS_CV == IS_VAR || IS_CV == IS_CV) { + array_ref = array_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(array_ref)) { + array_ptr = Z_REFVAL_P(array_ref); + } + } else { + array_ref = array_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + } + + if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) { + if (IS_CV == IS_VAR || IS_CV == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ref = EX_VAR(opline->result.var); + ZVAL_NEW_REF(array_ref, array_ptr); + array_ptr = Z_REFVAL_P(array_ref); + } + if (IS_CV == IS_CONST) { + ZVAL_ARR(array_ptr, zend_array_dup(Z_ARRVAL_P(array_ptr))); + } else { + SEPARATE_ARRAY(array_ptr); + } + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_ARRVAL_P(array_ptr), 0); + + ZEND_VM_NEXT_OPCODE(); + } else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) { + if (!Z_OBJCE_P(array_ptr)->get_iterator) { + HashTable *properties; + if (IS_CV == IS_VAR || IS_CV == IS_CV) { + if (array_ptr == array_ref) { + ZVAL_NEW_REF(array_ref, array_ref); + array_ptr = Z_REFVAL_P(array_ref); + } + Z_ADDREF_P(array_ref); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref); + } else { + array_ptr = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(array_ptr, array_ref); + } + if (Z_OBJ_P(array_ptr)->properties + && UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(Z_OBJ_P(array_ptr)->properties); + } + Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties); + } + + properties = Z_OBJPROP_P(array_ptr); + if (zend_hash_num_elements(properties) == 0) { + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } + + Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } else if (is_empty) { + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } + } else { + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_value_name(array_ptr)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + + ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + bool ret; + + SAVE_OPLINE(); + value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + ret = i_zend_is_true(value); + + if (UNEXPECTED(EG(exception))) { + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + if (ret) { + zval *result = EX_VAR(opline->result.var); + + ZVAL_COPY_VALUE(result, value); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_CV == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if (IS_CV == IS_VAR && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zend_reference *ref = NULL; + + SAVE_OPLINE(); + value = _get_zval_ptr_cv_BP_VAR_IS(opline->op1.var EXECUTE_DATA_CC); + + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + if (IS_CV & IS_VAR) { + ref = Z_REF_P(value); + } + value = Z_REFVAL_P(value); + } + + if (Z_TYPE_P(value) > IS_NULL) { + zval *result = EX_VAR(opline->result.var); + ZVAL_COPY_VALUE(result, value); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) Z_ADDREF_P(result); + } else if (IS_CV == IS_CV) { + if (Z_OPT_REFCOUNTED_P(result)) Z_ADDREF_P(result); + } else if ((IS_CV & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); + } + + if ((IS_CV & IS_VAR) && ref) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_NULL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *val, *result; + + val = EX_VAR(opline->op1.var); + + if (Z_TYPE_P(val) > IS_NULL) { + do { + if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + if (Z_TYPE_P(val) <= IS_NULL) { + + break; + } + } + ZEND_VM_NEXT_OPCODE(); + } while (0); + } + + result = EX_VAR(opline->result.var); + uint32_t short_circuiting_type = opline->extended_value & ZEND_SHORT_CIRCUITING_CHAIN_MASK; + if (EXPECTED(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EXPR)) { + ZVAL_NULL(result); + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(val) == IS_UNDEF) + && (opline->extended_value & ZEND_JMP_NULL_BP_VAR_IS) == 0 + ) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + } else if (short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_ISSET) { + ZVAL_FALSE(result); + } else { + ZEND_ASSERT(short_circuiting_type == ZEND_SHORT_CIRCUITING_CHAIN_EMPTY); + ZVAL_TRUE(result); + } + + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *result = EX_VAR(opline->result.var); + + value = EX_VAR(opline->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(result); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_CV == IS_CV) { + ZVAL_COPY_DEREF(result, value); + } else if (IS_CV == IS_VAR) { + if (UNEXPECTED(Z_ISREF_P(value))) { + ZVAL_COPY_VALUE(result, Z_REFVAL_P(value)); + if (UNEXPECTED(Z_DELREF_P(value) == 0)) { + efree_size(Z_REF_P(value), sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(result)) { + Z_ADDREF_P(result); + } + } else { + ZVAL_COPY_VALUE(result, value); + } + } else { + ZVAL_COPY_VALUE(result, value); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(result))) { + Z_ADDREF_P(result); + } + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + zval *val; + + SAVE_OPLINE(); + val = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator"); + + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + +yield_from_try_again: + if (Z_TYPE_P(val) == IS_ARRAY) { + ZVAL_COPY_VALUE(&generator->values, val); + if (Z_OPT_REFCOUNTED_P(val)) { + Z_ADDREF_P(val); + } + Z_FE_POS(generator->values) = 0; + + } else if (IS_CV != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) { + zend_class_entry *ce = Z_OBJCE_P(val); + if (ce == zend_ce_generator) { + zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); + + Z_ADDREF_P(val); + + if (UNEXPECTED(new_gen->execute_data == NULL)) { + zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue"); + zval_ptr_dtor(val); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else if (Z_ISUNDEF(new_gen->retval)) { + if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) { + zend_throw_error(NULL, "Impossible to yield from the Generator being currently run"); + zval_ptr_dtor(val); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } else { + zend_generator_yield_from(generator, new_gen); + } + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zend_object_iterator *iter = ce->get_iterator(ce, val, 0); + + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { + if (!EG(exception)) { + zend_throw_error(NULL, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)); + } + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + iter->index = 0; + if (iter->funcs->rewind) { + iter->funcs->rewind(iter); + if (UNEXPECTED(EG(exception) != NULL)) { + OBJ_RELEASE(&iter->std); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + } + + ZVAL_OBJ(&generator->values, &iter->std); + } + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(val) == IS_REFERENCE) { + val = Z_REFVAL_P(val); + goto yield_from_try_again; + } else { + zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables"); + + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } + + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ + if (RETURN_VALUE_USED(opline)) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + + /* This generator has no send target (though the generator we delegate to might have one) */ + generator->send_target = NULL; + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = EX_VAR(opline->op1.var); + if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(value); + } + ZEND_VM_NEXT_OPCODE(); + } else { + bool strict; + + if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) { + value = Z_REFVAL_P(value); + if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value)); + + ZEND_VM_NEXT_OPCODE(); + } + } + + SAVE_OPLINE(); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + value = ZVAL_UNDEFINED_OP1(); + } + strict = EX_USES_STRICT_TYPES(); + do { + if (EXPECTED(!strict)) { + zend_string *str; + zval tmp; + + if (UNEXPECTED(Z_TYPE_P(value) == IS_NULL)) { + zend_error(E_DEPRECATED, + "strlen(): Passing null to parameter #1 ($string) of type string is deprecated"); + ZVAL_LONG(EX_VAR(opline->result.var), 0); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + break; + } + + ZVAL_COPY(&tmp, value); + if (zend_parse_arg_str_weak(&tmp, &str, 1)) { + ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str)); + zval_ptr_dtor(&tmp); + break; + } + zval_ptr_dtor(&tmp); + } + if (!EG(exception)) { + zend_type_error("strlen(): Argument #1 ($string) must be of type string, %s given", zend_zval_value_name(value)); + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } while (0); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + int result = 0; + + value = EX_VAR(opline->op1.var); + if ((opline->extended_value >> (uint32_t)Z_TYPE_P(value)) & 1) { +type_check_resource: + if (opline->extended_value != MAY_BE_RESOURCE + || EXPECTED(NULL != zend_rsrc_list_get_rsrc_type(Z_RES_P(value)))) { + result = 1; + } + } else if ((IS_CV & (IS_CV|IS_VAR)) && Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + if ((opline->extended_value >> (uint32_t)Z_TYPE_P(value)) & 1) { + goto type_check_resource; + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + result = ((1 << IS_NULL) & opline->extended_value) != 0; + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + + ZEND_VM_SMART_BRANCH(result, 1); + } else { + ZEND_VM_SMART_BRANCH(result, 0); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + uint32_t fetch_type; + zend_class_entry *called_scope, *scope; + USE_OPLINE + + if (IS_CV != IS_UNUSED) { + SAVE_OPLINE(); + zval *op = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { + ZVAL_DEREF(op); + if (Z_TYPE_P(op) != IS_OBJECT) { + zend_type_error("Cannot use \"::class\" on %s", zend_zval_value_name(op)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + + HANDLE_EXCEPTION(); + } + } + + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op)->name); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + fetch_type = opline->op1.num; + scope = EX(func)->op_array.scope; + if (UNEXPECTED(scope == NULL)) { + SAVE_OPLINE(); + zend_throw_error(NULL, "Cannot use \"%s\" in the global scope", + fetch_type == ZEND_FETCH_CLASS_SELF ? "self" : + fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + + switch (fetch_type) { + case ZEND_FETCH_CLASS_SELF: + ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->name); + break; + case ZEND_FETCH_CLASS_PARENT: + if (UNEXPECTED(scope->parent == NULL)) { + SAVE_OPLINE(); + zend_throw_error(NULL, + "Cannot use \"parent\" when current class scope has no parent"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->parent->name); + break; + case ZEND_FETCH_CLASS_STATIC: + if (Z_TYPE(EX(This)) == IS_OBJECT) { + called_scope = Z_OBJCE(EX(This)); + } else { + called_scope = Z_CE(EX(This)); + } + ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); + break; + EMPTY_SWITCH_DEFAULT_CASE() + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_STATIC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + HashTable *ht; + zval *value; + zval *variable_ptr; + + variable_ptr = EX_VAR(opline->op1.var); + + SAVE_OPLINE(); + + ht = ZEND_MAP_PTR_GET(EX(func)->op_array.static_variables_ptr); + if (!ht) { + ht = zend_array_dup(EX(func)->op_array.static_variables); + ZEND_MAP_PTR_SET(EX(func)->op_array.static_variables_ptr, ht); + } + ZEND_ASSERT(GC_REFCOUNT(ht) == 1); + + value = (zval*)((char*)ht->arData + (opline->extended_value & ~(ZEND_BIND_REF|ZEND_BIND_IMPLICIT|ZEND_BIND_EXPLICIT))); + + if (opline->extended_value & ZEND_BIND_REF) { + i_zval_ptr_dtor(variable_ptr); + if (UNEXPECTED(!Z_ISREF_P(value))) { + zend_reference *ref = (zend_reference*)emalloc(sizeof(zend_reference)); + GC_SET_REFCOUNT(ref, 2); + GC_TYPE_INFO(ref) = GC_REFERENCE; + if (opline->op2_type == IS_UNUSED) { + ZVAL_COPY_VALUE(&ref->val, value); + } else { + ZEND_ASSERT(!Z_REFCOUNTED_P(value)); + ZVAL_COPY(&ref->val, get_zval_ptr_deref(opline->op2_type, opline->op2, BP_VAR_R)); + FREE_OP(opline->op2_type, opline->op2.var); + } + ref->sources.ptr = NULL; + Z_REF_P(value) = ref; + Z_TYPE_INFO_P(value) = IS_REFERENCE_EX; + ZVAL_REF(variable_ptr, ref); + } else { + Z_ADDREF_P(value); + ZVAL_REF(variable_ptr, Z_REF_P(value)); + if (opline->op2_type != IS_UNUSED) { + FREE_OP(opline->op2_type, opline->op2.var); + } + } + } else { + i_zval_ptr_dtor(variable_ptr); + ZVAL_COPY(variable_ptr, value); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + HashTable *ht; + zval *value; + zval *variable_ptr; + + variable_ptr = EX_VAR(opline->op1.var); + + ht = ZEND_MAP_PTR_GET(EX(func)->op_array.static_variables_ptr); + if (!ht) { + ZEND_VM_NEXT_OPCODE(); + } + ZEND_ASSERT(GC_REFCOUNT(ht) == 1); + + value = (zval*)((char*)ht->arData + opline->extended_value); + if (Z_TYPE_EXTRA_P(value) & IS_STATIC_VAR_UNINITIALIZED) { + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + zval_ptr_dtor(variable_ptr); + ZEND_ASSERT(Z_TYPE_P(value) == IS_REFERENCE); + Z_ADDREF_P(value); + ZVAL_REF(variable_ptr, Z_REF_P(value)); + ZEND_VM_JMP_EX(OP_JMP_ADDR(opline, opline->op2), 1); + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + Z_LVAL_P(var_ptr)++; + if (UNEXPECTED(0)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + Z_LVAL_P(var_ptr)++; + if (UNEXPECTED(1)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + fast_long_increment_function(var_ptr); + if (UNEXPECTED(0)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + fast_long_increment_function(var_ptr); + if (UNEXPECTED(1)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + Z_LVAL_P(var_ptr)--; + if (UNEXPECTED(0)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + Z_LVAL_P(var_ptr)--; + if (UNEXPECTED(1)) { + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + fast_long_decrement_function(var_ptr); + if (UNEXPECTED(0)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + fast_long_decrement_function(var_ptr); + if (UNEXPECTED(1)) { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), var_ptr); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + Z_LVAL_P(var_ptr)++; + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_LONG_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_increment_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + Z_LVAL_P(var_ptr)--; + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_DEC_LONG_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + + var_ptr = EX_VAR(opline->op1.var); + ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(var_ptr)); + fast_long_decrement_function(var_ptr); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_SIMPLE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + varptr = EX_VAR(opline->op1.var); + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + + if (IS_CV == IS_CV) { + ZVAL_COPY(arg, varptr); + } else /* if (IS_CV == IS_VAR) */ { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + div_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + pow_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + + if ((IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CV != IS_CONST && IS_CV != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_identical_function(op1, op2); + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_not_identical_function(op1, op2); + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CV == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CV == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CV == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CV == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CV == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if (1 && IS_CV == IS_CONST && IS_CONST == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + compare_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = RT_CONSTANT(opline, opline->op2); + boolean_xor_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = RT_CONSTANT(opline, opline->op2); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +assign_dim_op_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +assign_dim_op_new_array: + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + goto assign_dim_op_ret_null; + } + } else { + if (IS_CONST == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + goto assign_dim_op_ret_null; + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto assign_dim_op_array; + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_op_ret_null; + } + } + goto assign_dim_op_new_array; + } else { + dim = RT_CONSTANT(opline, opline->op2); + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +assign_dim_op_ret_null: + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op2); + var_ptr = _get_zval_ptr_cv_BP_VAR_RW(opline->op1.var EXECUTE_DATA_CC); + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if (IS_CONST == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CV != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CONST, BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, IS_CONST OPLINE_CC EXECUTE_DATA_CC); + } + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_W(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_RW(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_read_IS(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_CONST == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_UNSET(container, RT_CONSTANT(opline, opline->op2), IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, RT_CONSTANT(opline, opline->op2)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CONST == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CV_CONST_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_CV, property, IS_CONST, + ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_cv_BP_VAR_IS(opline->op1.var EXECUTE_DATA_CC); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CONST == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CONST == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + property = RT_CONSTANT(opline, opline->op2); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, RT_CONSTANT(opline, opline->op2) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + } else { + name = zval_try_get_tmp_string(RT_CONSTANT(opline, opline->op2), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CONST == IS_UNUSED) { + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CONST == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CONST == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = RT_CONSTANT((opline+1), (opline+1)->op1); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CONST & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CONST == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = RT_CONSTANT(opline, opline->op2); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = RT_CONSTANT(opline, opline->op2); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = RT_CONSTANT(opline, opline->op2); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CONST != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CONST == IS_UNUSED) { + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_TMP_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_TMP_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CONST == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = RT_CONSTANT(opline, opline->op2); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = RT_CONSTANT(opline, opline->op2); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = RT_CONSTANT(opline, opline->op2); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CONST != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CONST == IS_UNUSED) { + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CONST == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = RT_CONSTANT(opline, opline->op2); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = RT_CONSTANT(opline, opline->op2); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = RT_CONSTANT(opline, opline->op2); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CONST != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CONST == IS_UNUSED) { + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CV == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CV == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = RT_CONSTANT(opline, opline->op2); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CV & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CONST == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = RT_CONSTANT(opline, opline->op2); + value = EX_VAR((opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = RT_CONSTANT(opline, opline->op2); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = RT_CONSTANT(opline, opline->op2); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CONST != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op2); + variable_ptr = EX_VAR(opline->op1.var); + + if (0 || UNEXPECTED(0)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(0)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES()); + } + + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = RT_CONSTANT(opline, opline->op2); + variable_ptr = EX_VAR(opline->op1.var); + + if (0 || UNEXPECTED(1)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(1)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES()); + } + + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = RT_CONSTANT(opline, opline->op2); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_CV == IS_UNUSED) { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_CV, property, IS_CONST, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = RT_CONSTANT(opline, opline->op2); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_CV == IS_UNUSED) { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CONST == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_CV, property, IS_CONST, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + if ((IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CONST == IS_CONST || IS_CONST == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CONST != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CV != IS_CONST && IS_CV != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CONST & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if (IS_CV == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if (IS_CONST == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if (IS_CV != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if (IS_CONST != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CONST != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = EX_VAR(opline->op1.var); + + if (IS_CONST != IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + + if (IS_CONST != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_CV == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_CV & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (IS_CONST != IS_CONST) { + + } + HANDLE_EXCEPTION(); + } + } + if (IS_CONST == IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + zend_invalid_method_call(object, function_name); + + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (IS_CONST == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (IS_CONST == IS_CONST) { + function_name = RT_CONSTANT(opline, opline->op2); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (IS_CONST == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (IS_CONST != IS_CONST) { + + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_CV & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_CV == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = EX_VAR(opline->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_CV == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + SAVE_OPLINE(); + if (IS_CONST == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_CONST == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var_by_ref; + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_var_by_ref: + varptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + ZEND_VM_NEXT_OPCODE(); + } + + varptr = EX_VAR(opline->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_CV == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_CV == IS_VAR || IS_CV == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + + } else { + expr_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + if (IS_CV == IS_TMP_VAR) { + /* pass */ + } else if (IS_CV == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_CV == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_CONST != IS_UNUSED) { + zval *offset = RT_CONSTANT(opline, opline->op2); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_CV != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_ulong hval; + zend_string *key; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = RT_CONSTANT(opline, opline->op2); + + do { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + +unset_dim_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +offset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + key = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(key, hval)) { + goto num_index_dim; + } + } +str_index_dim: + ZEND_ASSERT(ht != &EG(symbol_table)); + zend_hash_del(ht, key); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_dim: + zend_hash_index_del(ht, hval); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto offset_again; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_NULL) { + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index_dim; + } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else { + zend_illegal_array_offset_unset(offset); + } + break; + } else if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto unset_dim_array; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + container = ZVAL_UNDEFINED_OP1(); + } + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + offset = ZVAL_UNDEFINED_OP2(); + } + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + Z_OBJ_HT_P(container)->unset_dimension(Z_OBJ_P(container), offset); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { + zend_throw_error(NULL, "Cannot unset string offsets"); + } else if (UNEXPECTED(Z_TYPE_P(container) > IS_FALSE)) { + zend_throw_error(NULL, "Cannot unset offset in a non-array variable"); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_FALSE)) { + zend_false_to_array_deprecated(); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = RT_CONSTANT(opline, opline->op2); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = RT_CONSTANT(opline, opline->op2); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CONST != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, IS_CONST == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if (IS_CV & (IS_CONST|IS_CV)) { + /* avoid exception check */ + + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_cv_BP_VAR_IS(opline->op1.var EXECUTE_DATA_CC); + offset = RT_CONSTANT(opline, opline->op2); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = EX_VAR(opline->op1.var); + subject = RT_CONSTANT(opline, opline->op2); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + bool result; + + SAVE_OPLINE(); + expr = EX_VAR(opline->op1.var); + +try_instanceof: + if (Z_TYPE_P(expr) == IS_OBJECT) { + zend_class_entry *ce; + + if (IS_CONST == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_lookup_class_ex(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD); + if (EXPECTED(ce)) { + CACHE_PTR(opline->extended_value, ce); + } + } + } else if (IS_CONST == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + result = ce && instanceof_function(Z_OBJCE_P(expr), ce); + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) { + expr = Z_REFVAL_P(expr); + goto try_instanceof; + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(expr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + result = 0; + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_CV != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_CV == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_CV == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_CV == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CV == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CONST != IS_UNUSED) { + zval *key = RT_CONSTANT(opline, opline->op2); + if ((IS_CONST & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_string *varname; + zval *value; + zval *variable_ptr; + uintptr_t idx; + zend_reference *ref; + + ZEND_VM_REPEATABLE_OPCODE + + varname = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + + /* We store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */ + idx = (uintptr_t)CACHED_PTR(opline->extended_value) - 1; + if (EXPECTED(idx < EG(symbol_table).nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)EG(symbol_table).arData + idx); + + if (EXPECTED(p->key == varname) || + (EXPECTED(p->h == ZSTR_H(varname)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, varname)))) { + + value = (zval*)p; /* value = &p->val; */ + goto check_indirect; + } + } + + value = zend_hash_find_known_hash(&EG(symbol_table), varname); + if (UNEXPECTED(value == NULL)) { + value = zend_hash_add_new(&EG(symbol_table), varname, &EG(uninitialized_zval)); + idx = (char*)value - (char*)EG(symbol_table).arData; + /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */ + CACHE_PTR(opline->extended_value, (void*)(idx + 1)); + } else { + idx = (char*)value - (char*)EG(symbol_table).arData; + /* Store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */ + CACHE_PTR(opline->extended_value, (void*)(idx + 1)); +check_indirect: + /* GLOBAL variable may be an INDIRECT pointer to CV */ + if (UNEXPECTED(Z_TYPE_P(value) == IS_INDIRECT)) { + value = Z_INDIRECT_P(value); + if (UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + ZVAL_NULL(value); + } + } + } + + if (UNEXPECTED(!Z_ISREF_P(value))) { + ZVAL_MAKE_REF_EX(value, 2); + ref = Z_REF_P(value); + } else { + ref = Z_REF_P(value); + GC_ADDREF(ref); + } + + variable_ptr = EX_VAR(opline->op1.var); + + if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) { + zend_refcounted *garbage = Z_COUNTED_P(variable_ptr); + + ZVAL_REF(variable_ptr, ref); + SAVE_OPLINE(); + if (GC_DELREF(garbage) == 0) { + rc_dtor_func(garbage); + if (UNEXPECTED(EG(exception))) { + ZVAL_NULL(variable_ptr); + HANDLE_EXCEPTION(); + } + } else { + gc_check_possible_root(garbage); + } + } else { + ZVAL_REF(variable_ptr, ref); + } + + ZEND_VM_REPEAT_OPCODE(ZEND_BIND_GLOBAL); + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2)); + zval *result; + + op1 = EX_VAR(opline->op1.var); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find_ex(ht, Z_STR_P(op1), IS_CV == IS_CONST); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + ZEND_VM_SMART_BRANCH(result, 0); + } + + if (opline->extended_value) { + if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + ZEND_VM_SMART_BRANCH(result, 0); + } + SAVE_OPLINE(); + if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + + ZEND_VM_SMART_BRANCH(result, 0); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + result = zend_hash_index_find(ht, Z_LVAL_P(op1)); + + ZEND_VM_SMART_BRANCH(result, 0); + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + } else if (Z_TYPE_P(op1) <= IS_FALSE) { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } + } + result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC()); + ZEND_VM_SMART_BRANCH(result, 0); + } else { + zend_string *key; + zval key_tmp; + + if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + result = zend_hash_find(ht, Z_STR_P(op1)); + + ZEND_VM_SMART_BRANCH(result, 0); + } + } + + SAVE_OPLINE(); + ZEND_HASH_MAP_FOREACH_STR_KEY(ht, key) { + ZVAL_STR(&key_tmp, key); + if (zend_compare(op1, &key_tmp) == 0) { + + ZEND_VM_SMART_BRANCH(1, 1); + } + } ZEND_HASH_FOREACH_END(); + } + + ZEND_VM_SMART_BRANCH(0, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + /* This is declared below the specializations for MAY_BE_LONG/MAY_BE_DOUBLE so those will be used instead if possible. */ + /* This optimizes $x === SOME_CONST_EXPR and $x === $y for non-refs and non-undef, which can't throw. */ + /* (Infinite recursion when comparing arrays is an uncatchable fatal error) */ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_identical_function(op1, op2); + /* Free is a no-op for const/cv */ + ZEND_VM_SMART_BRANCH(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = RT_CONSTANT(opline, opline->op2); + result = fast_is_identical_function(op1, op2); + /* Free is a no-op for const/cv */ + ZEND_VM_SMART_BRANCH(!result, 0); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + zend_long offset; + HashTable *ht; + + container = EX_VAR(opline->op1.var); + dim = RT_CONSTANT(opline, opline->op2); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_index_array: + if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) { + offset = Z_LVAL_P(dim); + } else { + SAVE_OPLINE(); + zend_fetch_dimension_address_read_R(container, dim, IS_CONST OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ht = Z_ARRVAL_P(container); + ZEND_HASH_INDEX_FIND(ht, offset, value, fetch_dim_r_index_undef); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_index_array; + } else { + goto fetch_dim_r_index_slow; + } + } else { +fetch_dim_r_index_slow: + SAVE_OPLINE(); + if (IS_CONST == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + +fetch_dim_r_index_undef: + ZVAL_NULL(EX_VAR(opline->result.var)); + SAVE_OPLINE(); + zend_undefined_offset(offset); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + zend_long offset; + HashTable *ht; + + container = EX_VAR(opline->op1.var); + dim = EX_VAR(opline->op2.var); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_index_array: + if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) { + offset = Z_LVAL_P(dim); + } else { + SAVE_OPLINE(); + zend_fetch_dimension_address_read_R(container, dim, (IS_TMP_VAR|IS_VAR|IS_CV) OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ht = Z_ARRVAL_P(container); + ZEND_HASH_INDEX_FIND(ht, offset, value, fetch_dim_r_index_undef); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + SAVE_OPLINE(); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZEND_VM_NEXT_OPCODE(); + } + } else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_index_array; + } else { + goto fetch_dim_r_index_slow; + } + } else { +fetch_dim_r_index_slow: + SAVE_OPLINE(); + if ((IS_TMP_VAR|IS_VAR|IS_CV) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + +fetch_dim_r_index_undef: + ZVAL_NULL(EX_VAR(opline->result.var)); + SAVE_OPLINE(); + zend_undefined_offset(offset); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + div_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + pow_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if ((IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + ((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CV != IS_CONST && IS_CV != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && IS_CV == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && IS_CV == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && IS_CV == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && IS_CV == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && IS_CV == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (1 && IS_CV == IS_CONST && (IS_TMP_VAR|IS_VAR) == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + compare_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + boolean_xor_function(EX_VAR(opline->result.var), op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +assign_dim_op_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +assign_dim_op_new_array: + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + goto assign_dim_op_ret_null; + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + goto assign_dim_op_ret_null; + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto assign_dim_op_array; + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_op_ret_null; + } + } + goto assign_dim_op_new_array; + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +assign_dim_op_ret_null: + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + var_ptr = _get_zval_ptr_cv_BP_VAR_RW(opline->op1.var EXECUTE_DATA_CC); + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (IS_CV != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, (IS_TMP_VAR|IS_VAR), BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_W(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_RW(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_read_IS(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_UNSET(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), + (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_cv_BP_VAR_IS(opline->op1.var EXECUTE_DATA_CC); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CONST == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CONST == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = RT_CONSTANT((opline+1), (opline+1)->op1); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CONST & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_TMP_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_TMP_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CV == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CV == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CV & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + value = EX_VAR((opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_CV == IS_UNUSED) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_CV, property, (IS_TMP_VAR|IS_VAR), value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_CV == IS_UNUSED) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_CV, property, (IS_TMP_VAR|IS_VAR), value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = EX_VAR(opline->op1.var); + op2 = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if ((IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + ((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST || (IS_TMP_VAR|IS_VAR) == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CV != IS_CONST && IS_CV != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if (IS_CV == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if (IS_CV != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = EX_VAR(opline->op1.var); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_CV == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_CV & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + HANDLE_EXCEPTION(); + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + zend_invalid_method_call(object, function_name); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + function_name = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_CV & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_CV == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_CV == IS_VAR || IS_CV == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + + } else { + expr_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + if (IS_CV == IS_TMP_VAR) { + /* pass */ + } else if (IS_CV == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_CV == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_CV != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_ulong hval; + zend_string *key; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + +unset_dim_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +offset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + key = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(key, hval)) { + goto num_index_dim; + } + } +str_index_dim: + ZEND_ASSERT(ht != &EG(symbol_table)); + zend_hash_del(ht, key); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_dim: + zend_hash_index_del(ht, hval); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto offset_again; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_NULL) { + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index_dim; + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else { + zend_illegal_array_offset_unset(offset); + } + break; + } else if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto unset_dim_array; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + container = ZVAL_UNDEFINED_OP1(); + } + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + offset = ZVAL_UNDEFINED_OP2(); + } + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + Z_OBJ_HT_P(container)->unset_dimension(Z_OBJ_P(container), offset); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { + zend_throw_error(NULL, "Cannot unset string offsets"); + } else if (UNEXPECTED(Z_TYPE_P(container) > IS_FALSE)) { + zend_throw_error(NULL, "Cannot unset offset in a non-array variable"); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_FALSE)) { + zend_false_to_array_deprecated(); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, (IS_TMP_VAR|IS_VAR) == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if (IS_CV & (IS_CONST|IS_CV)) { + /* avoid exception check */ + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_cv_BP_VAR_IS(opline->op1.var EXECUTE_DATA_CC); + offset = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = EX_VAR(opline->op1.var); + subject = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_CV != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_CV == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_CV == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_CV == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CV == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) { + zval *key = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + if (((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_not_identical_function(op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = EX_VAR(opline->op1.var); + + if (0 || UNEXPECTED(0)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(0)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES()); + } + + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_tmp(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = EX_VAR(opline->op1.var); + + if (0 || UNEXPECTED(1)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(1)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES()); + } + + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var_deref(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_var_deref(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_not_identical_function(op1, op2); + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = EX_VAR(opline->op1.var); + + if (0 || UNEXPECTED(0)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(0)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES()); + } + + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = EX_VAR(opline->op1.var); + + if (0 || UNEXPECTED(1)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(1)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES()); + } + + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *variable_ptr; + zval *value_ptr; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + value_ptr = _get_zval_ptr_ptr_var(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = EX_VAR(opline->op1.var); + + if (IS_CV == IS_VAR && + UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT)) { + + zend_throw_error(NULL, "Cannot assign by reference to an array dimension of an object"); + variable_ptr = &EG(uninitialized_zval); + } else if (IS_VAR == IS_VAR && + opline->extended_value == ZEND_RETURNS_FUNCTION && + UNEXPECTED(!Z_ISREF_P(value_ptr))) { + + variable_ptr = zend_wrong_assign_to_variable_reference( + variable_ptr, value_ptr, &garbage OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_variable_reference(variable_ptr, value_ptr, &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), variable_ptr); + } + + if (garbage) { + GC_DTOR(garbage); + } + + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + bool result; + + SAVE_OPLINE(); + expr = EX_VAR(opline->op1.var); + +try_instanceof: + if (Z_TYPE_P(expr) == IS_OBJECT) { + zend_class_entry *ce; + + if (IS_VAR == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_lookup_class_ex(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD); + if (EXPECTED(ce)) { + CACHE_PTR(opline->extended_value, ce); + } + } + } else if (IS_VAR == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + result = ce && instanceof_function(Z_OBJCE_P(expr), ce); + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) { + expr = Z_REFVAL_P(expr); + goto try_instanceof; + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(expr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + result = 0; + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +assign_dim_op_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +assign_dim_op_new_array: + dim = NULL; + if (IS_UNUSED == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + goto assign_dim_op_ret_null; + } + } else { + if (IS_UNUSED == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + goto assign_dim_op_ret_null; + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto assign_dim_op_array; + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = NULL; + if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_op_ret_null; + } + } + goto assign_dim_op_new_array; + } else { + dim = NULL; + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +assign_dim_op_ret_null: + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type ZEND_OPCODE_HANDLER_ARGS_DC) +{ + USE_OPLINE + zval *varname; + zval *retval; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + varname = EX_VAR(opline->op1.var); + + if (IS_CV == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + tmp_name = NULL; + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + if (!(opline->extended_value & ZEND_FETCH_GLOBAL_LOCK)) { + + } + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + retval = zend_hash_find_ex(target_symbol_table, name, IS_CV == IS_CONST); + if (retval == NULL) { + if (UNEXPECTED(zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS)))) { +fetch_this: + zend_fetch_this_var(type OPLINE_CC EXECUTE_DATA_CC); + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + if (type == BP_VAR_W) { + retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval)); + } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) { + retval = &EG(uninitialized_zval); + } else { + if (IS_CV == IS_CV) { + /* Keep name alive in case an error handler tries to free it. */ + zend_string_addref(name); + } + zend_error(E_WARNING, "Undefined %svariable $%s", + (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name)); + if (type == BP_VAR_RW && !EG(exception)) { + retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval)); + } else { + retval = &EG(uninitialized_zval); + } + if (IS_CV == IS_CV) { + zend_string_release(name); + } + } + /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */ + } else if (Z_TYPE_P(retval) == IS_INDIRECT) { + retval = Z_INDIRECT_P(retval); + if (Z_TYPE_P(retval) == IS_UNDEF) { + if (UNEXPECTED(zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS)))) { + goto fetch_this; + } + if (type == BP_VAR_W) { + ZVAL_NULL(retval); + } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) { + retval = &EG(uninitialized_zval); + } else { + zend_error(E_WARNING, "Undefined %svariable $%s", + (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name)); + if (type == BP_VAR_RW && !EG(exception)) { + ZVAL_NULL(retval); + } else { + retval = &EG(uninitialized_zval); + } + } + } + } + + if (!(opline->extended_value & ZEND_FETCH_GLOBAL_LOCK)) { + + } + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + ZEND_ASSERT(retval != NULL); + if (type == BP_VAR_R || type == BP_VAR_IS) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else { + ZVAL_INDIRECT(EX_VAR(opline->result.var), retval); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + int fetch_type = + (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) ? + BP_VAR_W : BP_VAR_R; + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(fetch_type ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_W(container, NULL, IS_UNUSED OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_RW(container, NULL, IS_UNUSED OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_UNUSED == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_UNUSED == IS_UNUSED) { + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CONST == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CONST == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = NULL; + if (IS_UNUSED == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = RT_CONSTANT((opline+1), (opline+1)->op1); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = NULL; + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CONST & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_UNUSED == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = NULL; + value = RT_CONSTANT((opline+1), (opline+1)->op1); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = NULL; + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = NULL; +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_UNUSED != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_UNUSED == IS_UNUSED) { + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_TMP_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = NULL; + if (IS_UNUSED == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = NULL; + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_TMP_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_UNUSED == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = NULL; + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = NULL; + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = NULL; +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_UNUSED != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_UNUSED == IS_UNUSED) { + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = NULL; + if (IS_UNUSED == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = NULL; + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_UNUSED == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = NULL; + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = NULL; + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = NULL; +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_UNUSED != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_UNUSED == IS_UNUSED) { + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CV == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CV == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = NULL; + if (IS_UNUSED == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = NULL; + if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_UNUSED == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CV & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_UNUSED == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = NULL; + value = EX_VAR((opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = NULL; + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = NULL; +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_UNUSED != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + if (IS_CV == IS_UNUSED) { + SAVE_OPLINE(); + zend_verify_missing_return_type(EX(func)); + HANDLE_EXCEPTION(); + } else { +/* prevents "undefined variable opline" errors */ +#if 0 || (IS_CV != IS_UNUSED) + USE_OPLINE + zval *retval_ref, *retval_ptr; + zend_arg_info *ret_info = EX(func)->common.arg_info - 1; + retval_ref = retval_ptr = EX_VAR(opline->op1.var); + + if (IS_CV == IS_CONST) { + ZVAL_COPY(EX_VAR(opline->result.var), retval_ptr); + retval_ref = retval_ptr = EX_VAR(opline->result.var); + } else if (IS_CV == IS_VAR) { + if (UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_INDIRECT)) { + retval_ref = retval_ptr = Z_INDIRECT_P(retval_ptr); + } + ZVAL_DEREF(retval_ptr); + } else if (IS_CV == IS_CV) { + ZVAL_DEREF(retval_ptr); + } + + if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(ret_info->type, Z_TYPE_P(retval_ptr)))) { + ZEND_VM_NEXT_OPCODE(); + } + + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) { + SAVE_OPLINE(); + retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) { + ZEND_VM_NEXT_OPCODE(); + } + } + + zend_reference *ref = NULL; + void *cache_slot = CACHE_ADDR(opline->op2.num); + if (UNEXPECTED(retval_ref != retval_ptr)) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + ref = Z_REF_P(retval_ref); + } else { + /* A cast might happen - unwrap the reference if this is a by-value return */ + if (Z_REFCOUNT_P(retval_ref) == 1) { + ZVAL_UNREF(retval_ref); + } else { + Z_DELREF_P(retval_ref); + ZVAL_COPY(retval_ref, retval_ptr); + } + retval_ptr = retval_ref; + } + } + + SAVE_OPLINE(); + if (UNEXPECTED(!zend_check_type_slow(&ret_info->type, retval_ptr, ref, cache_slot, 1, 0))) { + zend_verify_return_error(EX(func), retval_ptr); + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +#endif + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = EX_VAR(opline->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_CV == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + + SAVE_OPLINE(); + if (IS_UNUSED == IS_CONST) { + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + varptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(0)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var_by_ref; + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_var_by_ref: + varptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + ZEND_VM_NEXT_OPCODE(); + } + + varptr = EX_VAR(opline->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_CV == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num; + + if (IS_UNUSED == IS_CONST) { + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + + HANDLE_EXCEPTION(); + } + } else { + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + arg_num = opline->op2.num; + } + + if (EXPECTED(1)) { + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + goto send_var_by_ref; + } + } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { +send_var_by_ref: + varptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(varptr)) { + Z_ADDREF_P(varptr); + } else { + ZVAL_MAKE_REF_EX(varptr, 2); + } + ZVAL_REF(arg, Z_REF_P(varptr)); + + ZEND_VM_NEXT_OPCODE(); + } + + varptr = EX_VAR(opline->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(varptr) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZVAL_NULL(arg); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + + if (IS_CV == IS_CV) { + ZVAL_COPY_DEREF(arg, varptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(varptr))) { + zend_refcounted *ref = Z_COUNTED_P(varptr); + + varptr = Z_REFVAL_P(varptr); + ZVAL_COPY_VALUE(arg, varptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(arg)) { + Z_ADDREF_P(arg); + } + } else { + ZVAL_COPY_VALUE(arg, varptr); + } + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_CV == IS_VAR || IS_CV == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + + } else { + expr_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + if (IS_CV == IS_TMP_VAR) { + /* pass */ + } else if (IS_CV == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_CV == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_UNUSED != IS_UNUSED) { + zval *offset = NULL; + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_UNUSED != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_UNUSED == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_CV != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_CV_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var = EX_VAR(opline->op1.var); + + if (Z_REFCOUNTED_P(var)) { + zend_refcounted *garbage = Z_COUNTED_P(var); + + ZVAL_UNDEF(var); + SAVE_OPLINE(); + GC_DTOR(garbage); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } else { + ZVAL_UNDEF(var); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varname; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + + varname = EX_VAR(opline->op1.var); + + if (IS_CV == IS_CONST) { + name = Z_STR_P(varname); + } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) { + name = Z_STR_P(varname); + tmp_name = NULL; + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) { + varname = ZVAL_UNDEFINED_OP1(); + } + name = zval_try_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(!name)) { + + HANDLE_EXCEPTION(); + } + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + zend_hash_del_ind(target_symbol_table, name); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_SET_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = EX_VAR(opline->op1.var); + if (!(0)) { + if (Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL)) { + ZEND_VM_SMART_BRANCH_TRUE(); + } else { + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else { + bool result; + + SAVE_OPLINE(); + result = !i_zend_is_true(value); + ZEND_VM_SMART_BRANCH(result, 1); + } +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_EMPTY_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + + value = EX_VAR(opline->op1.var); + if (!(1)) { + if (Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL)) { + ZEND_VM_SMART_BRANCH_TRUE(); + } else { + ZEND_VM_SMART_BRANCH_FALSE(); + } + } else { + bool result; + + SAVE_OPLINE(); + result = !i_zend_is_true(value); + ZEND_VM_SMART_BRANCH(result, 1); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + /* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */ + int result; + zval *varname; + zend_string *name, *tmp_name; + HashTable *target_symbol_table; + + SAVE_OPLINE(); + varname = _get_zval_ptr_cv_BP_VAR_IS(opline->op1.var EXECUTE_DATA_CC); + if (IS_CV == IS_CONST) { + name = Z_STR_P(varname); + } else { + name = zval_get_tmp_string(varname, &tmp_name); + } + + target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); + value = zend_hash_find_ex(target_symbol_table, name, IS_CV == IS_CONST); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (!value) { + result = (opline->extended_value & ZEND_ISEMPTY); + } else { + if (Z_TYPE_P(value) == IS_INDIRECT) { + value = Z_INDIRECT_P(value); + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + if (Z_ISREF_P(value)) { + value = Z_REFVAL_P(value); + } + result = Z_TYPE_P(value) > IS_NULL; + } else { + result = !i_zend_is_true(value); + } + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CLASS_FETCH|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr; + bool result; + + SAVE_OPLINE(); + expr = EX_VAR(opline->op1.var); + +try_instanceof: + if (Z_TYPE_P(expr) == IS_OBJECT) { + zend_class_entry *ce; + + if (IS_UNUSED == IS_CONST) { + ce = CACHED_PTR(opline->extended_value); + if (UNEXPECTED(ce == NULL)) { + ce = zend_lookup_class_ex(Z_STR_P(RT_CONSTANT(opline, opline->op2)), Z_STR_P(RT_CONSTANT(opline, opline->op2) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD); + if (EXPECTED(ce)) { + CACHE_PTR(opline->extended_value, ce); + } + } + } else if (IS_UNUSED == IS_UNUSED) { + ce = zend_fetch_class(NULL, opline->op2.num); + if (UNEXPECTED(ce == NULL)) { + + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } + } else { + ce = Z_CE_P(EX_VAR(opline->op2.var)); + } + result = ce && instanceof_function(Z_OBJCE_P(expr), ce); + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) { + expr = Z_REFVAL_P(expr); + goto try_instanceof; + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(expr) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + result = 0; + } + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_CV != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_CV == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_CV == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_CV == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CV == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_UNUSED != IS_UNUSED) { + zval *key = NULL; + if ((IS_UNUSED & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CHECK_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1 = EX_VAR(opline->op1.var); + + if (UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) { + SAVE_OPLINE(); + ZVAL_UNDEFINED_OP1(); + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MAKE_REF_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1 = EX_VAR(opline->op1.var); + + if (IS_CV == IS_CV) { + if (UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_NEW_EMPTY_REF(op1); + Z_SET_REFCOUNT_P(op1, 2); + ZVAL_NULL(Z_REFVAL_P(op1)); + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } else { + if (Z_ISREF_P(op1)) { + Z_ADDREF_P(op1); + } else { + ZVAL_MAKE_REF_EX(op1, 2); + } + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_INDIRECT)) { + op1 = Z_INDIRECT_P(op1); + if (EXPECTED(!Z_ISREF_P(op1))) { + ZVAL_MAKE_REF_EX(op1, 2); + } else { + GC_ADDREF(Z_REF_P(op1)); + } + ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1)); + } else { + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), op1); + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + zend_long count; + + SAVE_OPLINE(); + op1 = EX_VAR(opline->op1.var); + + while (1) { + if (Z_TYPE_P(op1) == IS_ARRAY) { + count = zend_hash_num_elements(Z_ARRVAL_P(op1)); + break; + } else if (Z_TYPE_P(op1) == IS_OBJECT) { + zend_object *zobj = Z_OBJ_P(op1); + + /* first, we check if the handler is defined */ + if (zobj->handlers->count_elements) { + if (SUCCESS == zobj->handlers->count_elements(zobj, &count)) { + break; + } + if (UNEXPECTED(EG(exception))) { + count = 0; + break; + } + } + + /* if not and the object implements Countable we call its count() method */ + if (zend_class_implements_interface(zobj->ce, zend_ce_countable)) { + zval retval; + + zend_function *count_fn = zend_hash_find_ptr(&zobj->ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); + zend_call_known_instance_method_with_0_params(count_fn, zobj, &retval); + count = zval_get_long(&retval); + zval_ptr_dtor(&retval); + break; + } + + /* If There's no handler and it doesn't implement Countable then emit a TypeError */ + } else if ((IS_CV & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + count = 0; + zend_type_error("%s(): Argument #1 ($value) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_value_name(op1)); + break; + } + + ZVAL_LONG(EX_VAR(opline->result.var), count); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_array *ht = Z_ARRVAL_P(EX_VAR(opline->op1.var)); + ZVAL_LONG(EX_VAR(opline->result.var), zend_hash_num_elements(ht)); + if (IS_CV & (IS_TMP_VAR|IS_VAR) && !(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + SAVE_OPLINE(); + zend_array_destroy(ht); + if (EG(exception)) { + HANDLE_EXCEPTION(); + } + } + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (IS_CV == IS_UNUSED) { + SAVE_OPLINE(); + if (UNEXPECTED(!EX(func)->common.scope)) { + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } else { + zend_error(E_DEPRECATED, "Calling get_class() without arguments is deprecated"); + ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + ZEND_VM_NEXT_OPCODE(); + } + } else { + zval *op1; + + SAVE_OPLINE(); + op1 = EX_VAR(opline->op1.var); + while (1) { + if (Z_TYPE_P(op1) == IS_OBJECT) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op1)->name); + } else if ((IS_CV & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { + op1 = Z_REFVAL_P(op1); + continue; + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_value_name(op1)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + } + break; + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_TYPE_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1; + zend_string *type; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + type = zend_zval_get_legacy_type(op1); + if (EXPECTED(type)) { + ZVAL_INTERNED_STR(EX_VAR(opline->result.var), type); + } else { + ZVAL_STRING(EX_VAR(opline->result.var), "unknown type"); + } + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *varptr, *arg; + uint32_t arg_num = opline->op2.num; + + if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) { + ZEND_VM_TAIL_CALL(ZEND_SEND_REF_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + varptr = EX_VAR(opline->op1.var); + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + + if (IS_CV == IS_CV) { + ZVAL_COPY(arg, varptr); + } else /* if (IS_CV == IS_VAR) */ { + ZVAL_COPY_VALUE(arg, varptr); + } + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + div_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + pow_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + + if ((IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CV != IS_CONST && IS_CV != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + if (UNEXPECTED(len > ZSTR_MAX_LEN - ZSTR_LEN(op2_str))) { + zend_error_noreturn(E_ERROR, "Integer overflow in memory allocation"); + } + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } else { + SAVE_OPLINE(); + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + op1 = ZVAL_UNDEFINED_OP1(); + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + op2 = ZVAL_UNDEFINED_OP2(); + } + concat_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_identical_function(op1, op2); + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = fast_is_not_identical_function(op1, op2); + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CV == IS_CONST && IS_CV == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CV == IS_CONST && IS_CV == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CV == IS_CONST && IS_CV == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) { +is_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_equal_double: + if (d1 == d2) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (result) { + goto is_equal_true; + } else { + goto is_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CV == IS_CONST && IS_CV == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_NONE(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_NONE(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CV == IS_CONST && IS_CV == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + double d1, d2; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if (1 && IS_CV == IS_CONST && IS_CV == IS_CONST) { + /* pass */ + } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) { +is_not_equal_true: + ZEND_VM_SMART_BRANCH_TRUE_JMPNZ(); + } else { +is_not_equal_false: + ZEND_VM_SMART_BRANCH_FALSE_JMPNZ(); + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = (double)Z_LVAL_P(op1); + d2 = Z_DVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) { + d1 = Z_DVAL_P(op1); + d2 = Z_DVAL_P(op2); +is_not_equal_double: + if (d1 != d2) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { + d1 = Z_DVAL_P(op1); + d2 = (double)Z_LVAL_P(op2); + goto is_not_equal_double; + } + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2)); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op1); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zval_ptr_dtor_str(op2); + } + if (!result) { + goto is_not_equal_true; + } else { + goto is_not_equal_false; + } + } + } + ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC)); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + compare_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + + SAVE_OPLINE(); + op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + boolean_xor_function(EX_VAR(opline->result.var), op1, op2); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_OP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *value; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_op_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +assign_op_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + zval *orig_zptr = zptr; + zend_reference *ref; + + do { + if (UNEXPECTED(Z_ISREF_P(zptr))) { + ref = Z_REF_P(zptr); + zptr = Z_REFVAL_P(zptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), orig_zptr); + } + if (UNEXPECTED(prop_info)) { + /* special case for typed properties */ + zend_binary_assign_op_typed_prop(prop_info, zptr, value OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_binary_op(zptr, zptr, value OPLINE_CC); + } + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), zptr); + } + } + } else { + zend_assign_op_overloaded_property(zobj, name, cache_slot, value OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMP|VAR|CV, UNUSED|CONST|TMPVAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_OP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value, *container, *dim; + HashTable *ht; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +assign_dim_op_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +assign_dim_op_new_array: + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_UNUSED) { + var_ptr = zend_hash_next_index_insert(ht, &EG(uninitialized_zval)); + if (UNEXPECTED(!var_ptr)) { + zend_cannot_add_element(); + goto assign_dim_op_ret_null; + } + } else { + if (IS_CV == IS_CONST) { + var_ptr = zend_fetch_dimension_address_inner_RW_CONST(ht, dim EXECUTE_DATA_CC); + } else { + var_ptr = zend_fetch_dimension_address_inner_RW(ht, dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(!var_ptr)) { + goto assign_dim_op_ret_null; + } + } + + value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_ISREF_P(var_ptr))) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + } else { + if (EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto assign_dim_op_array; + } + } + + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(container); + + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_binary_assign_op_obj_dim(obj, dim OPLINE_CC EXECUTE_DATA_CC); + } else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) { + uint8_t old_type; + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + ht = zend_new_array(8); + old_type = Z_TYPE_P(container); + ZVAL_ARR(container, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_op_ret_null; + } + } + goto assign_dim_op_new_array; + } else { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); +assign_dim_op_ret_null: + FREE_OP((opline+1)->op1_type, (opline+1)->op1.var); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *var_ptr; + zval *value; + + SAVE_OPLINE(); + value = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + var_ptr = _get_zval_ptr_cv_BP_VAR_RW(opline->op1.var EXECUTE_DATA_CC); + + do { + if (UNEXPECTED(Z_TYPE_P(var_ptr) == IS_REFERENCE)) { + zend_reference *ref = Z_REF_P(var_ptr); + var_ptr = Z_REFVAL_P(var_ptr); + if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { + zend_binary_assign_op_typed_ref(ref, value OPLINE_CC EXECUTE_DATA_CC); + break; + } + } + zend_binary_op(var_ptr, var_ptr, value OPLINE_CC); + } while (0); + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), var_ptr); + } + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto pre_incdec_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +pre_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + UNDEF_RESULT(); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } else { + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + zend_pre_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_pre_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object; + zval *property; + zval *zptr; + void **cache_slot; + zend_property_info *prop_info; + zend_object *zobj; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto post_incdec_object; + } + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_throw_non_object_error(object, property OPLINE_CC EXECUTE_DATA_CC); + break; + } + +post_incdec_object: + /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_try_get_tmp_string(property, &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { + if (UNEXPECTED(Z_ISERROR_P(zptr))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } else { + if (IS_CV == IS_CONST) { + prop_info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2); + } else { + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(object), zptr); + } + + zend_post_incdec_property_zval(zptr, prop_info OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_post_incdec_overloaded_property(zobj, name, cache_slot OPLINE_CC EXECUTE_DATA_CC); + } + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *dim, *value; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + dim = EX_VAR(opline->op2.var); + if (IS_CV != IS_CONST) { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +fetch_dim_r_array: + value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CV, BP_VAR_R EXECUTE_DATA_CC); + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto fetch_dim_r_array; + } else { + goto fetch_dim_r_slow; + } + } else { +fetch_dim_r_slow: + if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + zend_fetch_dimension_address_read_R_slow(container, dim OPLINE_CC EXECUTE_DATA_CC); + } + } else { + zend_fetch_dimension_address_read_R(container, dim, IS_CV OPLINE_CC EXECUTE_DATA_CC); + } + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_W(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_RW(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_read_IS(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + if (IS_CV == IS_UNUSED) { + ZEND_VM_TAIL_CALL(zend_use_undef_in_read_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + zend_fetch_dimension_address_UNSET(container, EX_VAR(opline->op2.var), IS_CV OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + zend_wrong_property_read(container, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CV == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_REF /* FUNC_ARG fetch may contain it */); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) { + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { +fetch_obj_r_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_r_copy; + } else { + goto fetch_obj_r_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + +#if ZEND_DEBUG + /* For non-standard object handlers, verify a declared property type in debug builds. + * Fetch prop_info before calling read_property(), as it may deallocate the object. */ + zend_property_info *prop_info = NULL; + if (zobj->handlers->read_property != zend_std_read_property) { + prop_info = zend_get_property_info(zobj->ce, name, /* silent */ true); + } +#endif + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); +#if ZEND_DEBUG + if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO + && ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_OPT_DEREF(retval); + zend_verify_property_type(prop_info, retval, /* strict */ true); + } +#endif + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_r_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_r_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address( + result, container, IS_CV, property, IS_CV, + ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), + BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *result; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + void **cache_slot = NULL; + + SAVE_OPLINE(); + container = _get_zval_ptr_cv_BP_VAR_IS(opline->op1.var EXECUTE_DATA_CC); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + break; + } + } + if (IS_CV == IS_CV && Z_TYPE_P(EX_VAR(opline->op2.var)) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + } + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; + } while (0); + } + + /* here we are sure we are dealing with an object */ + do { + zend_object *zobj = Z_OBJ_P(container); + zend_string *name, *tmp_name; + zval *retval; + + if (IS_CV == IS_CONST) { + cache_slot = CACHE_ADDR(opline->extended_value); + + if (EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + retval = OBJ_PROP(zobj, prop_offset); + if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) { + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { +fetch_obj_is_fast_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + ZEND_VM_NEXT_OPCODE(); + } + } + } else if (EXPECTED(zobj->properties != NULL)) { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (!IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(prop_offset)) { + uintptr_t idx = ZEND_DECODE_DYN_PROP_OFFSET(prop_offset); + + if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { + Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); + + if (EXPECTED(p->key == name) || + (EXPECTED(p->h == ZSTR_H(name)) && + EXPECTED(p->key != NULL) && + EXPECTED(zend_string_equal_content(p->key, name)))) { + retval = &p->val; + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); + } + retval = zend_hash_find_known_hash(zobj->properties, name); + if (EXPECTED(retval)) { + uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; + CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); + if (0 || (IS_CV & (IS_TMP_VAR|IS_VAR)) != 0) { + goto fetch_obj_is_copy; + } else { + goto fetch_obj_is_fast_copy; + } + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + ZVAL_UNDEF(EX_VAR(opline->result.var)); + break; + } + } + + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + + if (retval != EX_VAR(opline->result.var)) { +fetch_obj_is_copy: + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); + } + } while (0); + +fetch_obj_is_finish: + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ +#if 0 + USE_OPLINE +#endif + + if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) { + /* Behave like FETCH_OBJ_W */ + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZEND_VM_TAIL_CALL(zend_use_tmp_in_write_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container, *property, *result; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + result = EX_VAR(opline->result.var); + zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); + + if (IS_CV == IS_VAR) { + FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CONST != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CONST == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CONST == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_TMP_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_VAR != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_VAR == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_VAR == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object, *value, tmp; + zend_object *zobj; + zend_string *name, *tmp_name; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + object = EX_VAR(opline->op1.var); + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { + if (Z_ISREF_P(object) && Z_TYPE_P(Z_REFVAL_P(object)) == IS_OBJECT) { + object = Z_REFVAL_P(object); + goto assign_object; + } + zend_throw_non_object_error(object, _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC) OPLINE_CC EXECUTE_DATA_CC); + value = &EG(uninitialized_zval); + goto free_and_exit_assign_obj; + } + +assign_object: + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + if (EXPECTED(zobj->ce == CACHED_PTR(opline->extended_value))) { + void **cache_slot = CACHE_ADDR(opline->extended_value); + uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); + zval *property_val; + + if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { + property_val = OBJ_PROP(zobj, prop_offset); + if (Z_TYPE_P(property_val) != IS_UNDEF) { + zend_property_info *prop_info = (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); + + if (UNEXPECTED(prop_info != NULL)) { + value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC); + goto free_and_exit_assign_obj; + } else { +fast_assign_obj: + value = zend_assign_to_variable_ex(property_val, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } else { + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + if (EXPECTED(zobj->properties != NULL)) { + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { + if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { + GC_DELREF(zobj->properties); + } + zobj->properties = zend_array_dup(zobj->properties); + } + property_val = zend_hash_find_known_hash(zobj->properties, name); + if (property_val) { + goto fast_assign_obj; + } + } + + if (!zobj->ce->__set && (zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES)) { + if (EXPECTED(zobj->properties == NULL)) { + rebuild_object_properties(zobj); + } + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } else if (IS_CV != IS_TMP_VAR) { + if (Z_ISREF_P(value)) { + if (IS_CV == IS_VAR) { + zend_reference *ref = Z_REF_P(value); + if (GC_DELREF(ref) == 0) { + ZVAL_COPY_VALUE(&tmp, Z_REFVAL_P(value)); + efree_size(ref, sizeof(zend_reference)); + value = &tmp; + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else { + value = Z_REFVAL_P(value); + Z_TRY_ADDREF_P(value); + } + } else if (IS_CV == IS_CV) { + Z_TRY_ADDREF_P(value); + } + } + zend_hash_add_new(zobj->properties, name, value); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + goto exit_assign_obj; + } + } + } + name = Z_STR_P(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC)); + } else { + name = zval_try_get_tmp_string(_get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC), &tmp_name); + if (UNEXPECTED(!name)) { + + UNDEF_RESULT(); + goto exit_assign_obj; + } + } + + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + + value = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +free_and_exit_assign_obj: + if (UNEXPECTED(RETURN_VALUE_USED(opline)) && value) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value); + } + +exit_assign_obj: + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + + + /* assign_obj has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CV == IS_UNUSED) { + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CONST == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CONST == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = RT_CONSTANT((opline+1), (opline+1)->op1); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = RT_CONSTANT((opline+1), (opline+1)->op1); + if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CONST & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CV == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = EX_VAR(opline->op2.var); + value = RT_CONSTANT((opline+1), (opline+1)->op1); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CV != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CV == IS_UNUSED) { + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_TMP_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_TMP_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_TMP_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_TMP_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CV == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = EX_VAR(opline->op2.var); + value = _get_zval_ptr_tmp((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CV != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CV == IS_UNUSED) { + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_VAR == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_VAR == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_VAR, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_VAR & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CV == IS_UNUSED) { + zend_use_new_element_for_string(); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + dim = EX_VAR(opline->op2.var); + value = _get_zval_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CV != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *object_ptr, *orig_object_ptr; + zval *value; + zval *variable_ptr; + zval *dim; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + orig_object_ptr = object_ptr = EX_VAR(opline->op1.var); + + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { +try_assign_dim_array: + SEPARATE_ARRAY(object_ptr); + if (IS_CV == IS_UNUSED) { + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) { + HashTable *ht = Z_ARRVAL_P(object_ptr); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) { + GC_ADDREF(ht); + } + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + if (IS_CV == IS_CV || IS_CV == IS_VAR) { + ZVAL_DEREF(value); + } + value = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value); + if (UNEXPECTED(value == NULL)) { + zend_cannot_add_element(); + goto assign_dim_error; + } else if (IS_CV == IS_CV) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + } else if (IS_CV == IS_VAR) { + zval *free_op_data = EX_VAR((opline+1)->op1.var); + if (Z_ISREF_P(free_op_data)) { + if (Z_REFCOUNTED_P(value)) { + Z_ADDREF_P(value); + } + zval_ptr_dtor_nogc(free_op_data); + } + } else if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); + } + } + } else { + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CONST) { + variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } else { + variable_ptr = zend_fetch_dimension_address_inner_W(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC); + } + if (UNEXPECTED(variable_ptr == NULL)) { + goto assign_dim_error; + } + value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC); + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + if (EXPECTED(Z_ISREF_P(object_ptr))) { + object_ptr = Z_REFVAL_P(object_ptr); + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) { + goto try_assign_dim_array; + } + } + if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) { + zend_object *obj = Z_OBJ_P(object_ptr); + + GC_ADDREF(obj); + dim = EX_VAR(opline->op2.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(dim))) { + dim = ZVAL_UNDEFINED_OP2(); + } else if (IS_CV == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + + value = EX_VAR((opline+1)->op1.var); + if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(value))) { + value = zval_undefined_cv((opline+1)->op1.var EXECUTE_DATA_CC); + } else if (IS_CV & (IS_CV|IS_VAR)) { + ZVAL_DEREF(value); + } + + zend_assign_to_object_dim(obj, dim, value OPLINE_CC EXECUTE_DATA_CC); + + if (UNEXPECTED(GC_DELREF(obj) == 0)) { + zend_objects_store_del(obj); + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING)) { + if (IS_CV == IS_UNUSED) { + zend_use_new_element_for_string(); + + UNDEF_RESULT(); + } else { + dim = EX_VAR(opline->op2.var); + value = EX_VAR((opline+1)->op1.var); + zend_assign_to_string_offset(object_ptr, dim, value OPLINE_CC EXECUTE_DATA_CC); + + } + } else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) { + if (Z_ISREF_P(orig_object_ptr) + && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(orig_object_ptr)) + && !zend_verify_ref_array_assignable(Z_REF_P(orig_object_ptr))) { + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + UNDEF_RESULT(); + } else { + HashTable *ht = zend_new_array(8); + uint8_t old_type = Z_TYPE_P(object_ptr); + + ZVAL_ARR(object_ptr, ht); + if (UNEXPECTED(old_type == IS_FALSE)) { + GC_ADDREF(ht); + zend_false_to_array_deprecated(); + if (UNEXPECTED(GC_DELREF(ht) == 0)) { + zend_array_destroy(ht); + goto assign_dim_error; + } + } + goto try_assign_dim_array; + } + } else { + zend_use_scalar_as_array(); + dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); +assign_dim_error: + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); + } + } + } + if (IS_CV != IS_UNUSED) { + + } + + /* assign_dim has two opcodes! */ + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = EX_VAR(opline->op1.var); + + if (0 || UNEXPECTED(0)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(0)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + } + + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *value; + zval *variable_ptr; + + SAVE_OPLINE(); + value = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = EX_VAR(opline->op1.var); + + if (0 || UNEXPECTED(1)) { + zend_refcounted *garbage = NULL; + + value = zend_assign_to_variable_ex(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES(), &garbage); + if (UNEXPECTED(1)) { + ZVAL_COPY(EX_VAR(opline->result.var), value); + } + if (garbage) { + GC_DTOR_NO_REF(garbage); + } + } else { + value = zend_assign_to_variable(variable_ptr, value, IS_CV, EX_USES_STRICT_TYPES()); + } + + /* zend_assign_to_variable() always takes care of op2, never free it! */ + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *variable_ptr; + zval *value_ptr; + zend_refcounted *garbage = NULL; + + SAVE_OPLINE(); + value_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op2.var EXECUTE_DATA_CC); + variable_ptr = EX_VAR(opline->op1.var); + + if (IS_CV == IS_VAR && + UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT)) { + + zend_throw_error(NULL, "Cannot assign by reference to an array dimension of an object"); + variable_ptr = &EG(uninitialized_zval); + } else if (IS_CV == IS_VAR && + opline->extended_value == ZEND_RETURNS_FUNCTION && + UNEXPECTED(!Z_ISREF_P(value_ptr))) { + + variable_ptr = zend_wrong_assign_to_variable_reference( + variable_ptr, value_ptr, &garbage OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_variable_reference(variable_ptr, value_ptr, &garbage); + } + + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), variable_ptr); + } + + if (garbage) { + GC_DTOR(garbage); + } + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_ptr_var((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_CV == IS_UNUSED) { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_CV, property, IS_CV, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + + zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var)); + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *property, *container, *value_ptr; + + SAVE_OPLINE(); + + container = EX_VAR(opline->op1.var); + property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + value_ptr = _get_zval_ptr_cv_BP_VAR_W((opline+1)->op1.var EXECUTE_DATA_CC); + + if (1) { + if (IS_CV == IS_UNUSED) { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_this_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_this_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } else { + if (IS_CV == IS_CONST) { + zend_assign_to_property_reference_var_const(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } else { + zend_assign_to_property_reference_var_var(container, property, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + } + } else { + zend_assign_to_property_reference(container, IS_CV, property, IS_CV, value_ptr OPLINE_CC EXECUTE_DATA_CC); + } + + + + ZEND_VM_NEXT_OPCODE_EX(1, 2); +} + +/* No specialization for op_types (CONST|TMPVAR|CV, UNUSED|CONST|VAR) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + zend_string *op1_str, *op2_str, *str; + + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + if ((IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) && + (IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) { + zend_string *op1_str = Z_STR_P(op1); + zend_string *op2_str = Z_STR_P(op2); + zend_string *str; + uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_str, op2_str); + + if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + } else if (IS_CV != IS_CONST && UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST || IS_CV == IS_CV) { + ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str); + } else { + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else if (IS_CV != IS_CONST && IS_CV != IS_CV && + !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) { + size_t len = ZSTR_LEN(op1_str); + + str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } else { + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + GC_ADD_FLAGS(str, flags); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV & (IS_TMP_VAR|IS_VAR)) { + zend_string_release_ex(op2_str, 0); + } + } + ZEND_VM_NEXT_OPCODE(); + } + + SAVE_OPLINE(); + if (IS_CV == IS_CONST) { + op1_str = Z_STR_P(op1); + } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { + op1_str = zend_string_copy(Z_STR_P(op1)); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + op1_str = zval_get_string_func(op1); + } + if (IS_CV == IS_CONST) { + op2_str = Z_STR_P(op2); + } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { + op2_str = zend_string_copy(Z_STR_P(op2)); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + op2_str = zval_get_string_func(op2); + } + do { + if (IS_CV != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) { + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op2))) { + GC_ADDREF(op2_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op2_str); + zend_string_release_ex(op1_str, 0); + break; + } + } + if (IS_CV != IS_CONST) { + if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) { + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_REFCOUNTED_P(op1))) { + GC_ADDREF(op1_str); + } + } + ZVAL_STR(EX_VAR(opline->result.var), op1_str); + zend_string_release_ex(op2_str, 0); + break; + } + } + str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0); + memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str)); + memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1); + + ZSTR_COPY_CONCAT_PROPERTIES_BOTH(str, op1_str, op2_str); + ZVAL_NEW_STR(EX_VAR(opline->result.var), str); + if (IS_CV != IS_CONST) { + zend_string_release_ex(op1_str, 0); + } + if (IS_CV != IS_CONST) { + zend_string_release_ex(op2_str, 0); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *function_name; + zval *object; + zend_function *fbc; + zend_class_entry *called_scope; + zend_object *obj; + zend_execute_data *call; + uint32_t call_info; + + SAVE_OPLINE(); + + object = EX_VAR(opline->op1.var); + + if (IS_CV != IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + + if (IS_CV != IS_CONST && + UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { + do { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) { + function_name = Z_REFVAL_P(function_name); + if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { + break; + } + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + if (UNEXPECTED(EG(exception) != NULL)) { + + HANDLE_EXCEPTION(); + } + } + zend_throw_error(NULL, "Method name must be a string"); + + + HANDLE_EXCEPTION(); + } while (0); + } + + if (IS_CV == IS_UNUSED) { + obj = Z_OBJ_P(object); + } else { + do { + if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + } else { + if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) { + zend_reference *ref = Z_REF_P(object); + + object = &ref->val; + if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { + obj = Z_OBJ_P(object); + if (IS_CV & IS_VAR) { + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else { + Z_ADDREF_P(object); + } + } + break; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) { + object = ZVAL_UNDEFINED_OP1(); + if (UNEXPECTED(EG(exception) != NULL)) { + if (IS_CV != IS_CONST) { + + } + HANDLE_EXCEPTION(); + } + } + if (IS_CV == IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + zend_invalid_method_call(object, function_name); + + + HANDLE_EXCEPTION(); + } + } while (0); + } + + called_scope = obj->ce; + + if (IS_CV == IS_CONST && + EXPECTED(CACHED_PTR(opline->result.num) == called_scope)) { + fbc = CACHED_PTR(opline->result.num + sizeof(void*)); + } else { + zend_object *orig_obj = obj; + + if (IS_CV == IS_CONST) { + function_name = EX_VAR(opline->op2.var); + } + + /* First, locate the function. */ + fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL)); + if (UNEXPECTED(fbc == NULL)) { + if (EXPECTED(!EG(exception))) { + zend_undefined_method(obj->ce, Z_STR_P(function_name)); + } + + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + HANDLE_EXCEPTION(); + } + if (IS_CV == IS_CONST && + EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) && + EXPECTED(obj == orig_obj)) { + CACHE_POLYMORPHIC_PTR(opline->result.num, called_scope, fbc); + } + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(obj != orig_obj)) { + GC_ADDREF(obj); /* For $this pointer */ + if (GC_DELREF(orig_obj) == 0) { + zend_objects_store_del(orig_obj); + } + } + if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) { + init_func_run_time_cache(&fbc->op_array); + } + } + + if (IS_CV != IS_CONST) { + + } + + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS; + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) { + if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + if (UNEXPECTED(EG(exception))) { + HANDLE_EXCEPTION(); + } + } + /* call static method */ + obj = (zend_object*)called_scope; + call_info = ZEND_CALL_NESTED_FUNCTION; + } else if (IS_CV & (IS_VAR|IS_TMP_VAR|IS_CV)) { + if (IS_CV == IS_CV) { + GC_ADDREF(obj); /* For $this pointer */ + } + /* CV may be changed indirectly (e.g. when it's a reference) */ + call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_HAS_THIS | ZEND_CALL_RELEASE_THIS; + } + + call = zend_vm_stack_push_call_frame(call_info, + fbc, opline->extended_value, obj); + call->prev_execute_data = EX(call); + EX(call) = call; + + ZEND_VM_NEXT_OPCODE(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *expr_ptr, new_expr; + + SAVE_OPLINE(); + if ((IS_CV == IS_VAR || IS_CV == IS_CV) && + UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) { + expr_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + if (Z_ISREF_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } else { + ZVAL_MAKE_REF_EX(expr_ptr, 2); + } + + } else { + expr_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + if (IS_CV == IS_TMP_VAR) { + /* pass */ + } else if (IS_CV == IS_CONST) { + Z_TRY_ADDREF_P(expr_ptr); + } else if (IS_CV == IS_CV) { + ZVAL_DEREF(expr_ptr); + Z_TRY_ADDREF_P(expr_ptr); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(expr_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(expr_ptr); + + expr_ptr = Z_REFVAL_P(expr_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + ZVAL_COPY_VALUE(&new_expr, expr_ptr); + expr_ptr = &new_expr; + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) { + Z_ADDREF_P(expr_ptr); + } + } + } + } + + if (IS_CV != IS_UNUSED) { + zval *offset = EX_VAR(opline->op2.var); + zend_string *str; + zend_ulong hval; + +add_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index; + } + } +str_index: + zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index: + zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto add_again; + } else if (Z_TYPE_P(offset) == IS_NULL) { + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index; + } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + str = ZSTR_EMPTY_ALLOC(); + goto str_index; + } else { + zend_illegal_array_offset_access(offset); + zval_ptr_dtor_nogc(expr_ptr); + } + + } else { + if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) { + zend_cannot_add_element(); + zval_ptr_dtor_nogc(expr_ptr); + } + } + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *array; + uint32_t size; + USE_OPLINE + + array = EX_VAR(opline->result.var); + if (IS_CV != IS_UNUSED) { + size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT; + ZVAL_ARR(array, zend_new_array(size)); + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) { + zend_hash_real_init_mixed(Z_ARRVAL_P(array)); + } + ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } else { + ZVAL_ARR(array, zend_new_array(0)); + ZEND_VM_NEXT_OPCODE(); + } +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_ulong hval; + zend_string *key; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = EX_VAR(opline->op2.var); + + do { + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + +unset_dim_array: + SEPARATE_ARRAY(container); + ht = Z_ARRVAL_P(container); +offset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + key = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(key, hval)) { + goto num_index_dim; + } + } +str_index_dim: + ZEND_ASSERT(ht != &EG(symbol_table)); + zend_hash_del(ht, key); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_dim: + zend_hash_index_del(ht, hval); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) { + offset = Z_REFVAL_P(offset); + goto offset_again; + } else if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval_safe(Z_DVAL_P(offset)); + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_NULL) { + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_index_dim; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + zend_use_resource_as_offset(offset); + hval = Z_RES_HANDLE_P(offset); + goto num_index_dim; + } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { + ZVAL_UNDEFINED_OP2(); + key = ZSTR_EMPTY_ALLOC(); + goto str_index_dim; + } else { + zend_illegal_array_offset_unset(offset); + } + break; + } else if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto unset_dim_array; + } + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + container = ZVAL_UNDEFINED_OP1(); + } + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + offset = ZVAL_UNDEFINED_OP2(); + } + if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + Z_OBJ_HT_P(container)->unset_dimension(Z_OBJ_P(container), offset); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { + zend_throw_error(NULL, "Cannot unset string offsets"); + } else if (UNEXPECTED(Z_TYPE_P(container) > IS_FALSE)) { + zend_throw_error(NULL, "Cannot unset offset in a non-array variable"); + } else if (UNEXPECTED(Z_TYPE_P(container) == IS_FALSE)) { + zend_false_to_array_deprecated(); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + do { + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + if (Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (Z_TYPE_P(container) != IS_OBJECT) { + if (IS_CV == IS_CV + && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); + } + break; + } + } else { + break; + } + } + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + break; + } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + } while (0); + + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + bool result; + zend_ulong hval; + zval *offset; + + SAVE_OPLINE(); + container = EX_VAR(opline->op1.var); + offset = EX_VAR(opline->op2.var); + + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + HashTable *ht; + zval *value; + zend_string *str; + +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); +isset_again: + if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { + str = Z_STR_P(offset); + if (IS_CV != IS_CONST) { + if (ZEND_HANDLE_NUMERIC(str, hval)) { + goto num_index_prop; + } + } + value = zend_hash_find_ex(ht, str, IS_CV == IS_CONST); + } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + hval = Z_LVAL_P(offset); +num_index_prop: + value = zend_hash_index_find(ht, hval); + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { + offset = Z_REFVAL_P(offset); + goto isset_again; + } else { + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); + if (UNEXPECTED(EG(exception))) { + result = 0; + goto isset_dim_obj_exit; + } + } + + if (!(opline->extended_value & ZEND_ISEMPTY)) { + /* > IS_NULL means not IS_UNDEF and not IS_NULL */ + result = value != NULL && Z_TYPE_P(value) > IS_NULL && + (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL); + + if (IS_CV & (IS_CONST|IS_CV)) { + /* avoid exception check */ + + ZEND_VM_SMART_BRANCH(result, 0); + } + } else { + result = (value == NULL || !i_zend_is_true(value)); + } + goto isset_dim_obj_exit; + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; + } + if (!(opline->extended_value & ZEND_ISEMPTY)) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); + } else { + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); + } + +isset_dim_obj_exit: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *container; + int result; + zval *offset; + zend_string *name, *tmp_name; + + SAVE_OPLINE(); + container = _get_zval_ptr_cv_BP_VAR_IS(opline->op1.var EXECUTE_DATA_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + + if (IS_CV == IS_CONST || + (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) { + if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } else { + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; + } + } + + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_try_get_tmp_string(offset, &tmp_name); + if (UNEXPECTED(!name)) { + result = 0; + goto isset_object_finish; + } + } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } + +isset_object_finish: + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zval *key, *subject; + HashTable *ht; + bool result; + + SAVE_OPLINE(); + + key = EX_VAR(opline->op1.var); + subject = EX_VAR(opline->op2.var); + + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { +array_key_exists_array: + ht = Z_ARRVAL_P(subject); + result = zend_array_key_exists_fast(ht, key OPLINE_CC EXECUTE_DATA_CC); + } else { + if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(subject))) { + subject = Z_REFVAL_P(subject); + if (EXPECTED(Z_TYPE_P(subject) == IS_ARRAY)) { + goto array_key_exists_array; + } + } + zend_array_key_exists_error(subject, key OPLINE_CC EXECUTE_DATA_CC); + result = 0; + } + + + ZEND_VM_SMART_BRANCH(result, 1); +} + +/* No specialization for op_types (CONST|TMPVAR|UNUSED|CV, ANY) */ +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); + + SAVE_OPLINE(); + if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) { + ZEND_VM_TAIL_CALL(zend_yield_in_closed_generator_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); + } + + /* Destroy the previously yielded value */ + zval_ptr_dtor(&generator->value); + + /* Destroy the previously yielded key */ + zval_ptr_dtor(&generator->key); + + /* Set the new yielded value */ + if (IS_CV != IS_UNUSED) { + if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { + /* Constants and temporary variables aren't yieldable by reference, + * but we still allow them with a notice. */ + if (IS_CV & (IS_CONST|IS_TMP_VAR)) { + zval *value; + + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + + value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } + } else { + zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); + + /* If a function call result is yielded and the function did + * not return by reference we throw a notice. */ + do { + if (IS_CV == IS_VAR) { + ZEND_ASSERT(value_ptr != &EG(uninitialized_zval)); + if (opline->extended_value == ZEND_RETURNS_FUNCTION + && !Z_ISREF_P(value_ptr)) { + zend_error(E_NOTICE, "Only variable references should be yielded by reference"); + ZVAL_COPY(&generator->value, value_ptr); + break; + } + } + if (Z_ISREF_P(value_ptr)) { + Z_ADDREF_P(value_ptr); + } else { + ZVAL_MAKE_REF_EX(value_ptr, 2); + } + ZVAL_REF(&generator->value, Z_REF_P(value_ptr)); + } while (0); + + } + } else { + zval *value = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); + + /* Consts, temporary variables and references need copying */ + if (IS_CV == IS_CONST) { + ZVAL_COPY_VALUE(&generator->value, value); + if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) { + Z_ADDREF(generator->value); + } + } else if (IS_CV == IS_TMP_VAR) { + ZVAL_COPY_VALUE(&generator->value, value); + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) { + ZVAL_COPY(&generator->value, Z_REFVAL_P(value)); + + } else { + ZVAL_COPY_VALUE(&generator->value, value); + if (IS_CV == IS_CV) { + if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value); + } + } + } + } else { + /* If no value was specified yield null */ + ZVAL_NULL(&generator->value); + } + + /* Set the new yielded key */ + if (IS_CV != IS_UNUSED) { + zval *key = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); + if ((IS_CV & (IS_CV|IS_VAR)) && UNEXPECTED(Z_TYPE_P(key) == IS_REFERENCE)) { + key = Z_REFVAL_P(key); + } + ZVAL_COPY(&generator->key, key); + + if (Z_TYPE(generator->key) == IS_LONG + && Z_LVAL(generator->key) > generator->largest_used_integer_key + ) { + generator->largest_used_integer_key = Z_LVAL(generator->key); + } + } else { + /* If no key was specified we use auto-increment keys */ + generator->largest_used_integer_key++; + ZVAL_LONG(&generator->key, generator->largest_used_integer_key); + } + + if (RETURN_VALUE_USED(opline)) { + /* If the return value of yield is used set the send + * target and initialize it to NULL */ + generator->send_target = EX_VAR(opline->result.var); + ZVAL_NULL(generator->send_target); + } else { + generator->send_target = NULL; + } + + /* We increment to the next op, so we are at the correct position when the + * generator is resumed. */ + ZEND_VM_INC_OPCODE(); + + /* The GOTO VM uses a local opline variable. We need to set the opline + * variable in execute_data so we don't resume at an old position. */ + SAVE_OPLINE(); + + ZEND_VM_RETURN(); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + /* This is declared below the specializations for MAY_BE_LONG/MAY_BE_DOUBLE so those will be used instead if possible. */ + /* This optimizes $x === SOME_CONST_EXPR and $x === $y for non-refs and non-undef, which can't throw. */ + /* (Infinite recursion when comparing arrays is an uncatchable fatal error) */ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = fast_is_identical_function(op1, op2); + /* Free is a no-op for const/cv */ + ZEND_VM_SMART_BRANCH(result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zval *op1, *op2; + bool result; + + op1 = EX_VAR(opline->op1.var); + op2 = EX_VAR(opline->op2.var); + result = fast_is_identical_function(op1, op2); + /* Free is a no-op for const/cv */ + ZEND_VM_SMART_BRANCH(!result, 0); +} + +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + SAVE_OPLINE(); + zend_error_noreturn(E_ERROR, "Invalid opcode %d/%d/%d.", OPLINE->opcode, OPLINE->op1_type, OPLINE->op2_type); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ +} + + +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) +# undef ZEND_VM_TAIL_CALL +# undef ZEND_VM_CONTINUE +# undef ZEND_VM_RETURN + +# define ZEND_VM_TAIL_CALL(call) call; ZEND_VM_CONTINUE() +# define ZEND_VM_CONTINUE() HYBRID_NEXT() +# define ZEND_VM_RETURN() goto HYBRID_HALT_LABEL +#endif + + +#if (ZEND_VM_KIND != ZEND_VM_KIND_CALL) && (ZEND_GCC_VERSION >= 4000) && !defined(__clang__) +# pragma GCC push_options +# pragma GCC optimize("no-gcse") +# pragma GCC optimize("no-ivopts") +#endif +ZEND_API void execute_ex(zend_execute_data *ex) +{ + DCL_OPLINE + +#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_FP_GLOBAL_REG) + struct { +#ifdef ZEND_VM_IP_GLOBAL_REG + const zend_op *orig_opline; +#endif +#ifdef ZEND_VM_FP_GLOBAL_REG + zend_execute_data *orig_execute_data; +#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE + char hybrid_jit_red_zone[ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE]; +#endif +#endif + } vm_stack_data; +#endif +#ifdef ZEND_VM_IP_GLOBAL_REG + vm_stack_data.orig_opline = opline; +#endif +#ifdef ZEND_VM_FP_GLOBAL_REG + vm_stack_data.orig_execute_data = execute_data; + execute_data = ex; +#else + zend_execute_data *execute_data = ex; +#endif + +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) + if (UNEXPECTED(execute_data == NULL)) { + static const void * const labels[] = { + (void*)&&ZEND_NOP_SPEC_LABEL, + (void*)&&ZEND_ADD_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_ADD_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_SUB_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_DIV_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_DIV_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_DIV_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_DIV_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_DIV_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_DIV_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_DIV_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_DIV_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_DIV_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_DIV_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_DIV_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_DIV_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_DIV_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_DIV_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_DIV_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_DIV_SPEC_CV_CV_LABEL, + (void*)&&ZEND_MOD_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_MOD_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_MOD_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MOD_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_SL_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SL_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SL_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SR_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_SR_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SR_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SR_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CONCAT_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_CONCAT_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CONCAT_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_CONCAT_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CONCAT_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_CONCAT_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CONCAT_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CONCAT_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_CONCAT_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_CONCAT_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CONCAT_SPEC_CV_CV_LABEL, + (void*)&&ZEND_BW_OR_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_AND_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_POW_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_POW_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_POW_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POW_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_POW_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_POW_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_POW_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POW_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_POW_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_POW_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_POW_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POW_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POW_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_POW_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_POW_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POW_SPEC_CV_CV_LABEL, + (void*)&&ZEND_BW_NOT_SPEC_CONST_LABEL, + (void*)&&ZEND_BW_NOT_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_BW_NOT_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BW_NOT_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_BOOL_NOT_SPEC_CONST_LABEL, + (void*)&&ZEND_BOOL_NOT_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_BOOL_NOT_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BOOL_NOT_SPEC_CV_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BOOL_XOR_SPEC_CV_CV_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_TMP_TMP_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_VAR_TMP_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_VAR_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_CV_TMP_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_CV_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_IDENTICAL_SPEC_CV_CV_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_CV_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_CV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_USED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_USED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_USED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_USED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_CV_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_SPEC_CV_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CONST_LABEL, + (void*)&&ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_TMP_LABEL, + (void*)&&ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OP_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OP_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OP_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OP_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_OP_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OP_SPEC_CV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_ASSIGN_DIM_OP_SPEC_CV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_OP_SPEC_CV_CV_LABEL, + (void*)&&ZEND_ASSIGN_STATIC_PROP_OP_SPEC_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_REF_SPEC_VAR_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_REF_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_REF_SPEC_CV_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_REF_SPEC_CV_CV_LABEL, + (void*)&&ZEND_QM_ASSIGN_SPEC_CONST_LABEL, + (void*)&&ZEND_QM_ASSIGN_SPEC_TMP_LABEL, + (void*)&&ZEND_QM_ASSIGN_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_QM_ASSIGN_SPEC_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_CV_LABEL, + (void*)&&ZEND_ASSIGN_STATIC_PROP_REF_SPEC_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_PRE_INC_SPEC_VAR_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_PRE_INC_SPEC_VAR_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_PRE_INC_SPEC_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_PRE_INC_SPEC_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_PRE_DEC_SPEC_VAR_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_PRE_DEC_SPEC_VAR_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_PRE_DEC_SPEC_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_PRE_DEC_SPEC_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POST_INC_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POST_INC_SPEC_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POST_DEC_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POST_DEC_SPEC_CV_LABEL, + (void*)&&ZEND_PRE_INC_STATIC_PROP_SPEC_LABEL, + (void*)&&ZEND_POST_INC_STATIC_PROP_SPEC_LABEL, + (void*)&&ZEND_JMP_SPEC_LABEL, + (void*)&&ZEND_JMPZ_SPEC_CONST_LABEL, + (void*)&&ZEND_JMPZ_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_JMPZ_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_JMPZ_SPEC_CV_LABEL, + (void*)&&ZEND_JMPNZ_SPEC_CONST_LABEL, + (void*)&&ZEND_JMPNZ_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_JMPNZ_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_JMPNZ_SPEC_CV_LABEL, + (void*)&&ZEND_JMPZ_EX_SPEC_CONST_LABEL, + (void*)&&ZEND_JMPZ_EX_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_JMPZ_EX_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_JMPZ_EX_SPEC_CV_LABEL, + (void*)&&ZEND_JMPNZ_EX_SPEC_CONST_LABEL, + (void*)&&ZEND_JMPNZ_EX_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_JMPNZ_EX_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_JMPNZ_EX_SPEC_CV_LABEL, + (void*)&&ZEND_CASE_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_CASE_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_CASE_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CASE_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_CHECK_VAR_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_QUICK_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CAST_SPEC_CONST_LABEL, + (void*)&&ZEND_CAST_SPEC_TMP_LABEL, + (void*)&&ZEND_CAST_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CAST_SPEC_CV_LABEL, + (void*)&&ZEND_BOOL_SPEC_CONST_LABEL, + (void*)&&ZEND_BOOL_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_BOOL_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BOOL_SPEC_CV_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FAST_CONCAT_SPEC_CV_CV_LABEL, + (void*)&&ZEND_ROPE_INIT_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ROPE_INIT_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_ROPE_ADD_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_ROPE_ADD_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_ROPE_ADD_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ROPE_ADD_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_ROPE_END_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_ROPE_END_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_ROPE_END_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ROPE_END_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_BEGIN_SILENCE_SPEC_LABEL, + (void*)&&ZEND_END_SILENCE_SPEC_TMP_LABEL, + (void*)&&ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_LABEL, + (void*)&&ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_DO_FCALL_SPEC_RETVAL_USED_LABEL, + (void*)&&ZEND_DO_FCALL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_FCALL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_INIT_FCALL_SPEC_CONST_LABEL, + (void*)&&ZEND_RETURN_SPEC_CONST_LABEL, + (void*)&&ZEND_RETURN_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_SPEC_TMP_LABEL, + (void*)&&ZEND_RETURN_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_SPEC_VAR_LABEL, + (void*)&&ZEND_RETURN_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_RETURN_SPEC_CV_LABEL, + (void*)&&ZEND_RETURN_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_RECV_SPEC_UNUSED_LABEL, + (void*)&&ZEND_RECV_INIT_SPEC_CONST_LABEL, + (void*)&&ZEND_SEND_VAL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAL_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAL_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAL_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_QUICK_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_QUICK_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_REF_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_REF_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_REF_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_REF_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NEW_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NEW_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NEW_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_LABEL, + (void*)&&ZEND_FREE_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_INIT_ARRAY_SPEC_CV_CV_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_CONST_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_CV_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_UNSET_VAR_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_VAR_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_DIM_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_UNSET_DIM_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_UNSET_DIM_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_DIM_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_DIM_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_UNSET_DIM_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_UNSET_DIM_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_DIM_SPEC_CV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_UNSET_OBJ_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FE_RESET_R_SPEC_CONST_LABEL, + (void*)&&ZEND_FE_RESET_R_SPEC_TMP_LABEL, + (void*)&&ZEND_FE_RESET_R_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FE_RESET_R_SPEC_CV_LABEL, + (void*)&&ZEND_FE_FETCH_R_SPEC_VAR_LABEL, + (void*)&&ZEND_EXIT_SPEC_LABEL, + (void*)&&ZEND_FETCH_R_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_FETCH_R_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_R_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_R_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_R_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_W_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_FETCH_W_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_W_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_W_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_W_SPEC_CV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_W_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_RW_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_RW_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_RW_SPEC_CV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_RW_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_IS_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_IS_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_IS_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_IS_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_UNSET_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV_LABEL, + (void*)&&ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_QUICK_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_EXT_STMT_SPEC_LABEL, + (void*)&&ZEND_EXT_FCALL_BEGIN_SPEC_LABEL, + (void*)&&ZEND_EXT_FCALL_END_SPEC_LABEL, + (void*)&&ZEND_EXT_NOP_SPEC_LABEL, + (void*)&&ZEND_TICKS_SPEC_LABEL, + (void*)&&ZEND_SEND_VAR_NO_REF_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_NO_REF_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CATCH_SPEC_CONST_LABEL, + (void*)&&ZEND_THROW_SPEC_CONST_LABEL, + (void*)&&ZEND_THROW_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_THROW_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_THROW_SPEC_CV_LABEL, + (void*)&&ZEND_FETCH_CLASS_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_CLASS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_FETCH_CLASS_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_CLONE_SPEC_CONST_LABEL, + (void*)&&ZEND_CLONE_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_CLONE_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_CLONE_SPEC_UNUSED_LABEL, + (void*)&&ZEND_CLONE_SPEC_CV_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_CONST_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_TMP_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_VAR_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_CV_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CV_CV_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_QUICK_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_QUICK_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_USER_CALL_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_USER_CALL_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_SEND_ARRAY_SPEC_LABEL, + (void*)&&ZEND_SEND_USER_SPEC_CONST_LABEL, + (void*)&&ZEND_SEND_USER_SPEC_TMP_LABEL, + (void*)&&ZEND_SEND_USER_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_USER_SPEC_CV_LABEL, + (void*)&&ZEND_STRLEN_SPEC_CONST_LABEL, + (void*)&&ZEND_STRLEN_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_STRLEN_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_STRLEN_SPEC_CV_LABEL, + (void*)&&ZEND_DEFINED_SPEC_CONST_LABEL, + (void*)&&ZEND_TYPE_CHECK_SPEC_CONST_LABEL, + (void*)&&ZEND_TYPE_CHECK_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_TYPE_CHECK_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_TYPE_CHECK_SPEC_CV_LABEL, + (void*)&&ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UNUSED_LABEL, + (void*)&&ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_FE_RESET_RW_SPEC_CONST_LABEL, + (void*)&&ZEND_FE_RESET_RW_SPEC_TMP_LABEL, + (void*)&&ZEND_FE_RESET_RW_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FE_RESET_RW_SPEC_CV_LABEL, + (void*)&&ZEND_FE_FETCH_RW_SPEC_VAR_LABEL, + (void*)&&ZEND_FE_FREE_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_INIT_DYNAMIC_CALL_SPEC_CONST_LABEL, + (void*)&&ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INIT_DYNAMIC_CALL_SPEC_CV_LABEL, + (void*)&&ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_DO_ICALL_SPEC_RETVAL_USED_LABEL, + (void*)&&ZEND_DO_ICALL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_ICALL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_DO_UCALL_SPEC_RETVAL_USED_LABEL, + (void*)&&ZEND_DO_UCALL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_UCALL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_LABEL, + (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_PRE_INC_OBJ_SPEC_CV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_POST_INC_OBJ_SPEC_CV_CV_LABEL, + (void*)&&ZEND_ECHO_SPEC_CONST_LABEL, + (void*)&&ZEND_ECHO_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_ECHO_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ECHO_SPEC_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_TMPVAR_VAR_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_TMPVAR_VAR_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_CV_VAR_LABEL, + (void*)&&ZEND_INSTANCEOF_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_GENERATOR_CREATE_SPEC_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MAKE_REF_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MAKE_REF_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_DECLARE_FUNCTION_SPEC_LABEL, + (void*)&&ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_LABEL, + (void*)&&ZEND_DECLARE_CONST_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_DECLARE_CLASS_SPEC_CONST_LABEL, + (void*)&&ZEND_DECLARE_CLASS_DELAYED_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_DECLARE_ANON_CLASS_SPEC_LABEL, + (void*)&&ZEND_ADD_ARRAY_UNPACK_SPEC_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_LABEL, + (void*)&&ZEND_HANDLE_EXCEPTION_SPEC_LABEL, + (void*)&&ZEND_USER_OPCODE_SPEC_LABEL, + (void*)&&ZEND_ASSERT_CHECK_SPEC_LABEL, + (void*)&&ZEND_JMP_SET_SPEC_CONST_LABEL, + (void*)&&ZEND_JMP_SET_SPEC_TMP_LABEL, + (void*)&&ZEND_JMP_SET_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_JMP_SET_SPEC_CV_LABEL, + (void*)&&ZEND_UNSET_CV_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_SET_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_EMPTY_LABEL, + (void*)&&ZEND_FETCH_LIST_W_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_LIST_W_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_SEPARATE_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_FETCH_CLASS_NAME_SPEC_UNUSED_LABEL, + (void*)&&ZEND_FETCH_CLASS_NAME_SPEC_CV_LABEL, + (void*)&&ZEND_CALL_TRAMPOLINE_SPEC_LABEL, + (void*)&&ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DISCARD_EXCEPTION_SPEC_LABEL, + (void*)&&ZEND_YIELD_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_YIELD_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_YIELD_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_YIELD_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_YIELD_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_TMP_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_TMP_UNUSED_LABEL, + (void*)&&ZEND_YIELD_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_YIELD_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_YIELD_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_VAR_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_YIELD_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_YIELD_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_YIELD_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_UNUSED_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_YIELD_SPEC_UNUSED_CV_LABEL, + (void*)&&ZEND_YIELD_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_YIELD_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_YIELD_SPEC_CV_CV_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_CONST_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_TMP_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_VAR_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_CV_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_FAST_CALL_SPEC_LABEL, + (void*)&&ZEND_FAST_RET_SPEC_LABEL, + (void*)&&ZEND_RECV_VARIADIC_SPEC_UNUSED_LABEL, + (void*)&&ZEND_SEND_UNPACK_SPEC_LABEL, + (void*)&&ZEND_YIELD_FROM_SPEC_CONST_LABEL, + (void*)&&ZEND_YIELD_FROM_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_YIELD_FROM_SPEC_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_YIELD_FROM_SPEC_CV_LABEL, + (void*)&&ZEND_COPY_TMP_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_BIND_GLOBAL_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_COALESCE_SPEC_CONST_LABEL, + (void*)&&ZEND_COALESCE_SPEC_TMP_LABEL, + (void*)&&ZEND_COALESCE_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_COALESCE_SPEC_CV_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SPACESHIP_SPEC_CV_CV_LABEL, + (void*)&&ZEND_FUNC_NUM_ARGS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_STATIC_PROP_R_SPEC_LABEL, + (void*)&&ZEND_FETCH_STATIC_PROP_W_SPEC_LABEL, + (void*)&&ZEND_FETCH_STATIC_PROP_RW_SPEC_LABEL, + (void*)&&ZEND_FETCH_STATIC_PROP_IS_SPEC_LABEL, + (void*)&&ZEND_FETCH_STATIC_PROP_FUNC_ARG_SPEC_LABEL, + (void*)&&ZEND_FETCH_STATIC_PROP_UNSET_SPEC_LABEL, + (void*)&&ZEND_UNSET_STATIC_PROP_SPEC_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_BIND_LEXICAL_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_BIND_STATIC_SPEC_CV_LABEL, + (void*)&&ZEND_FETCH_THIS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_SEND_FUNC_ARG_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_FUNC_ARG_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ISSET_ISEMPTY_THIS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_SWITCH_LONG_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SWITCH_STRING_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IN_ARRAY_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_IN_ARRAY_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_IN_ARRAY_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IN_ARRAY_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_COUNT_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_COUNT_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_COUNT_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_COUNT_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_GET_CLASS_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_GET_CLASS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_GET_CLASS_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_GET_CALLED_CLASS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_GET_TYPE_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_GET_TYPE_SPEC_TMP_UNUSED_LABEL, + (void*)&&ZEND_GET_TYPE_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_GET_TYPE_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CV_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CV_LABEL, + (void*)&&ZEND_MATCH_SPEC_CONST_CONST_LABEL, + (void*)&&ZEND_MATCH_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MATCH_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MATCH_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CASE_STRICT_SPEC_TMP_CONST_LABEL, + (void*)&&ZEND_CASE_STRICT_SPEC_TMP_TMP_LABEL, + (void*)&&ZEND_CASE_STRICT_SPEC_TMP_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CASE_STRICT_SPEC_TMP_CV_LABEL, + (void*)&&ZEND_CASE_STRICT_SPEC_VAR_CONST_LABEL, + (void*)&&ZEND_CASE_STRICT_SPEC_VAR_TMP_LABEL, + (void*)&&ZEND_CASE_STRICT_SPEC_VAR_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CASE_STRICT_SPEC_VAR_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MATCH_ERROR_SPEC_CONST_UNUSED_LABEL, + (void*)&&ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED_LABEL, + (void*)&&ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED_LABEL, + (void*)&&ZEND_JMP_NULL_SPEC_CONST_LABEL, + (void*)&&ZEND_JMP_NULL_SPEC_TMP_LABEL, + (void*)&&ZEND_JMP_NULL_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_JMP_NULL_SPEC_CV_LABEL, + (void*)&&ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_FETCH_GLOBALS_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_VERIFY_NEVER_TYPE_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV_LABEL, + (void*)&&ZEND_RECV_NOTYPE_SPEC_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_COUNT_ARRAY_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_JMP_FORWARD_SPEC_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL, + (void*)&&ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL, + (void*)&&ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV_LABEL, + (void*)&&ZEND_POST_INC_LONG_SPEC_CV_LABEL, + (void*)&&ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV_LABEL, + (void*)&&ZEND_POST_DEC_LONG_SPEC_CV_LABEL, + (void*)&&ZEND_QM_ASSIGN_LONG_SPEC_CONST_LABEL, + (void*)&&ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST_LABEL, + (void*)&&ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_QM_ASSIGN_NOREF_SPEC_CONST_LABEL, + (void*)&&ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_SIMPLE_SPEC_VAR_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_SIMPLE_SPEC_CV_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED_LABEL, + (void*)&&ZEND_SEND_VAL_SIMPLE_SPEC_CONST_LABEL, + (void*)&&ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST_LABEL, + (void*)&&ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED_LABEL, + (void*)&&ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED_LABEL, + (void*)&&ZEND_NULL_LABEL + }; + zend_opcode_handlers = (const void **) labels; + zend_handlers_count = sizeof(labels) / sizeof(void*); + memset(&hybrid_halt_op, 0, sizeof(hybrid_halt_op)); + hybrid_halt_op.handler = (void*)&&HYBRID_HALT_LABEL; +#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE + memset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE); +#endif + if (zend_touch_vm_stack_data) { + zend_touch_vm_stack_data(&vm_stack_data); + } + goto HYBRID_HALT_LABEL; + } +#endif + + LOAD_OPLINE(); + ZEND_VM_LOOP_INTERRUPT_CHECK(); + +#ifdef ZEND_CHECK_STACK_LIMIT + if (UNEXPECTED(zend_call_stack_overflowed(EG(stack_limit)))) { + zend_call_stack_size_error(); + /* No opline was executed before exception */ + EG(opline_before_exception) = NULL; + LOAD_OPLINE(); + /* Fall through to handle exception below. */ + } +#endif /* ZEND_CHECK_STACK_LIMIT */ + + while (1) { +#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG) + int ret; +#endif +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) + HYBRID_SWITCH() { +#else +#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG) + ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + if (UNEXPECTED(!OPLINE)) { +#else + if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) != 0)) { +#endif +#endif +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) + HYBRID_CASE(ZEND_ASSIGN_STATIC_PROP_OP_SPEC): + VM_TRACE(ZEND_ASSIGN_STATIC_PROP_OP_SPEC) + ZEND_ASSIGN_STATIC_PROP_OP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_STATIC_PROP_SPEC): + VM_TRACE(ZEND_PRE_INC_STATIC_PROP_SPEC) + ZEND_PRE_INC_STATIC_PROP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_STATIC_PROP_SPEC): + VM_TRACE(ZEND_POST_INC_STATIC_PROP_SPEC) + ZEND_POST_INC_STATIC_PROP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_STATIC_PROP_R_SPEC): + VM_TRACE(ZEND_FETCH_STATIC_PROP_R_SPEC) + ZEND_FETCH_STATIC_PROP_R_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_STATIC_PROP_W_SPEC): + VM_TRACE(ZEND_FETCH_STATIC_PROP_W_SPEC) + ZEND_FETCH_STATIC_PROP_W_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_STATIC_PROP_RW_SPEC): + VM_TRACE(ZEND_FETCH_STATIC_PROP_RW_SPEC) + ZEND_FETCH_STATIC_PROP_RW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_STATIC_PROP_FUNC_ARG_SPEC): + VM_TRACE(ZEND_FETCH_STATIC_PROP_FUNC_ARG_SPEC) + ZEND_FETCH_STATIC_PROP_FUNC_ARG_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_STATIC_PROP_UNSET_SPEC): + VM_TRACE(ZEND_FETCH_STATIC_PROP_UNSET_SPEC) + ZEND_FETCH_STATIC_PROP_UNSET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_STATIC_PROP_IS_SPEC): + VM_TRACE(ZEND_FETCH_STATIC_PROP_IS_SPEC) + ZEND_FETCH_STATIC_PROP_IS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CONST) + ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_TMP) + ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_VAR) + ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CV) + ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_STATIC_PROP_REF_SPEC): + VM_TRACE(ZEND_ASSIGN_STATIC_PROP_REF_SPEC) + ZEND_ASSIGN_STATIC_PROP_REF_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); +zend_leave_helper_SPEC_LABEL: +{ + zend_execute_data *old_execute_data; + uint32_t call_info = EX_CALL_INFO(); + SAVE_OPLINE(); + + if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED|ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); + +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(execute_data->This)); + } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + EG(vm_stack_top) = (zval*)execute_data; + execute_data = EX(prev_execute_data); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); + +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) { + zend_clean_and_cache_symbol_table(EX(symbol_table)); + } + + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(EX(extra_named_params)); + } + + /* Free extra args before releasing the closure, + * as that may free the op_array. */ + zend_vm_stack_free_extra_args_ex(call_info, execute_data); + + if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) { + OBJ_RELEASE(Z_OBJ(execute_data->This)); + } else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + + old_execute_data = execute_data; + execute_data = EX(prev_execute_data); + zend_vm_stack_free_call_frame_ex(call_info, old_execute_data); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else if (EXPECTED((call_info & ZEND_CALL_TOP) == 0)) { + if (EX(func)->op_array.last_var > 0) { + zend_detach_symbol_table(execute_data); + call_info |= ZEND_CALL_NEEDS_REATTACH; + } + zend_destroy_static_vars(&EX(func)->op_array); + destroy_op_array(&EX(func)->op_array); + efree_size(EX(func), sizeof(zend_op_array)); + old_execute_data = execute_data; + execute_data = EG(current_execute_data) = EX(prev_execute_data); + zend_vm_stack_free_call_frame_ex(call_info, old_execute_data); + + if (call_info & ZEND_CALL_NEEDS_REATTACH) { + if (EX(func)->op_array.last_var > 0) { + zend_attach_symbol_table(execute_data); + } else { + ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_NEEDS_REATTACH); + } + } + if (UNEXPECTED(EG(exception) != NULL)) { + zend_rethrow_exception(execute_data); + HANDLE_EXCEPTION_LEAVE(); + } + + LOAD_NEXT_OPLINE(); + ZEND_VM_LEAVE(); + } else { + if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) { + EG(current_execute_data) = EX(prev_execute_data); + i_free_compiled_variables(execute_data); +#ifdef ZEND_PREFER_RELOAD + call_info = EX_CALL_INFO(); +#endif + if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_HAS_EXTRA_NAMED_PARAMS))) { + if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) { + zend_clean_and_cache_symbol_table(EX(symbol_table)); + } + zend_vm_stack_free_extra_args_ex(call_info, execute_data); + if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { + zend_free_extra_named_params(EX(extra_named_params)); + } + } + if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); + } + ZEND_VM_RETURN(); + } else /* if (call_kind == ZEND_CALL_TOP_CODE) */ { + zend_array *symbol_table = EX(symbol_table); + + if (EX(func)->op_array.last_var > 0) { + zend_detach_symbol_table(execute_data); + call_info |= ZEND_CALL_NEEDS_REATTACH; + } + if (call_info & ZEND_CALL_NEEDS_REATTACH) { + old_execute_data = EX(prev_execute_data); + while (old_execute_data) { + if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) { + if (old_execute_data->symbol_table == symbol_table) { + if (old_execute_data->func->op_array.last_var > 0) { + zend_attach_symbol_table(old_execute_data); + } else { + ZEND_ADD_CALL_FLAG(old_execute_data, ZEND_CALL_NEEDS_REATTACH); + } + } + break; + } + old_execute_data = old_execute_data->prev_execute_data; + } + } + EG(current_execute_data) = EX(prev_execute_data); + ZEND_VM_RETURN(); + } + } +} + + HYBRID_CASE(ZEND_JMP_SPEC): + VM_TRACE(ZEND_JMP_SPEC) + ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_ICALL_SPEC_RETVAL_UNUSED): + VM_TRACE(ZEND_DO_ICALL_SPEC_RETVAL_UNUSED) + ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_ICALL_SPEC_RETVAL_USED): + VM_TRACE(ZEND_DO_ICALL_SPEC_RETVAL_USED) + ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_ICALL_SPEC_OBSERVER): + VM_TRACE(ZEND_DO_ICALL_SPEC_OBSERVER) + ZEND_DO_ICALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_UCALL_SPEC_RETVAL_UNUSED): + VM_TRACE(ZEND_DO_UCALL_SPEC_RETVAL_UNUSED) + ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_UCALL_SPEC_RETVAL_USED): + VM_TRACE(ZEND_DO_UCALL_SPEC_RETVAL_USED) + ZEND_DO_UCALL_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_UCALL_SPEC_OBSERVER): + VM_TRACE(ZEND_DO_UCALL_SPEC_OBSERVER) + ZEND_DO_UCALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED): + VM_TRACE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED) + ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED): + VM_TRACE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED) + ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER): + VM_TRACE(ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER) + ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_FCALL_SPEC_RETVAL_UNUSED): + VM_TRACE(ZEND_DO_FCALL_SPEC_RETVAL_UNUSED) + ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_FCALL_SPEC_RETVAL_USED): + VM_TRACE(ZEND_DO_FCALL_SPEC_RETVAL_USED) + ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DO_FCALL_SPEC_OBSERVER): + VM_TRACE(ZEND_DO_FCALL_SPEC_OBSERVER) + ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GENERATOR_CREATE_SPEC): + VM_TRACE(ZEND_GENERATOR_CREATE_SPEC) + ZEND_GENERATOR_CREATE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_UNPACK_SPEC): + VM_TRACE(ZEND_SEND_UNPACK_SPEC) + ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_ARRAY_SPEC): + VM_TRACE(ZEND_SEND_ARRAY_SPEC) + ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RECV_NOTYPE_SPEC): + VM_TRACE(ZEND_RECV_NOTYPE_SPEC) + ZEND_RECV_NOTYPE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_UNPACK_SPEC): + VM_TRACE(ZEND_ADD_ARRAY_UNPACK_SPEC) + ZEND_ADD_ARRAY_UNPACK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_STATIC_PROP_SPEC): + VM_TRACE(ZEND_UNSET_STATIC_PROP_SPEC) + ZEND_UNSET_STATIC_PROP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC): + VM_TRACE(ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC) + ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_EXIT_SPEC): + VM_TRACE(ZEND_EXIT_SPEC) + ZEND_EXIT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BEGIN_SILENCE_SPEC): + VM_TRACE(ZEND_BEGIN_SILENCE_SPEC) + ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_EXT_STMT_SPEC): + VM_TRACE(ZEND_EXT_STMT_SPEC) + ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_EXT_FCALL_BEGIN_SPEC): + VM_TRACE(ZEND_EXT_FCALL_BEGIN_SPEC) + ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_EXT_FCALL_END_SPEC): + VM_TRACE(ZEND_EXT_FCALL_END_SPEC) + ZEND_EXT_FCALL_END_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DECLARE_ANON_CLASS_SPEC): + VM_TRACE(ZEND_DECLARE_ANON_CLASS_SPEC) + ZEND_DECLARE_ANON_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DECLARE_FUNCTION_SPEC): + VM_TRACE(ZEND_DECLARE_FUNCTION_SPEC) + ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_TICKS_SPEC): + VM_TRACE(ZEND_TICKS_SPEC) + ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_EXT_NOP_SPEC): + VM_TRACE(ZEND_EXT_NOP_SPEC) + ZEND_EXT_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_NOP_SPEC): + VM_TRACE(ZEND_NOP_SPEC) + ZEND_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_HANDLE_EXCEPTION_SPEC): + VM_TRACE(ZEND_HANDLE_EXCEPTION_SPEC) + ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_USER_OPCODE_SPEC): + VM_TRACE(ZEND_USER_OPCODE_SPEC) + ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DISCARD_EXCEPTION_SPEC): + VM_TRACE(ZEND_DISCARD_EXCEPTION_SPEC) + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CALL_SPEC): + VM_TRACE(ZEND_FAST_CALL_SPEC) + ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_RET_SPEC): + VM_TRACE(ZEND_FAST_RET_SPEC) + ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSERT_CHECK_SPEC): + VM_TRACE(ZEND_ASSERT_CHECK_SPEC) + ZEND_ASSERT_CHECK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CALL_TRAMPOLINE_SPEC): + VM_TRACE(ZEND_CALL_TRAMPOLINE_SPEC) + ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER): + VM_TRACE(ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER) + ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_FORWARD_SPEC): + VM_TRACE(ZEND_JMP_FORWARD_SPEC) + ZEND_JMP_FORWARD_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_FCALL_BY_NAME_SPEC_CONST): + VM_TRACE(ZEND_INIT_FCALL_BY_NAME_SPEC_CONST) + ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_DYNAMIC_CALL_SPEC_CONST): + VM_TRACE(ZEND_INIT_DYNAMIC_CALL_SPEC_CONST) + ZEND_INIT_DYNAMIC_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST): + VM_TRACE(ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST) + ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_FCALL_SPEC_CONST): + VM_TRACE(ZEND_INIT_FCALL_SPEC_CONST) + ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RECV_INIT_SPEC_CONST): + VM_TRACE(ZEND_RECV_INIT_SPEC_CONST) + ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR): + VM_TRACE(ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR) + ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RECV_SPEC_UNUSED): + VM_TRACE(ZEND_RECV_SPEC_UNUSED) + ZEND_RECV_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RECV_VARIADIC_SPEC_UNUSED): + VM_TRACE(ZEND_RECV_VARIADIC_SPEC_UNUSED) + ZEND_RECV_VARIADIC_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_DYNAMIC_CALL_SPEC_CV): + VM_TRACE(ZEND_INIT_DYNAMIC_CALL_SPEC_CV) + ZEND_INIT_DYNAMIC_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_NOT_SPEC_CONST): + VM_TRACE(ZEND_BW_NOT_SPEC_CONST) + ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_NOT_SPEC_CONST): + VM_TRACE(ZEND_BOOL_NOT_SPEC_CONST) + ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ECHO_SPEC_CONST): + VM_TRACE(ZEND_ECHO_SPEC_CONST) + ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPZ_SPEC_CONST): + VM_TRACE(ZEND_JMPZ_SPEC_CONST) + ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPNZ_SPEC_CONST): + VM_TRACE(ZEND_JMPNZ_SPEC_CONST) + ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPZ_EX_SPEC_CONST): + VM_TRACE(ZEND_JMPZ_EX_SPEC_CONST) + ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPNZ_EX_SPEC_CONST): + VM_TRACE(ZEND_JMPNZ_EX_SPEC_CONST) + ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RETURN_SPEC_CONST): + VM_TRACE(ZEND_RETURN_SPEC_CONST) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = RT_CONSTANT(opline, opline->op1); + return_value = EX(return_value); + + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (IS_CONST & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (IS_CONST == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (IS_CONST == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (IS_CONST == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + + + + goto zend_leave_helper_SPEC_LABEL; +} + + HYBRID_CASE(ZEND_RETURN_SPEC_OBSERVER): + VM_TRACE(ZEND_RETURN_SPEC_OBSERVER) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + zval observer_retval; + + retval_ptr = get_zval_ptr_undef(opline->op1_type, opline->op1, BP_VAR_R); + return_value = EX(return_value); + if (!return_value) { return_value = &observer_retval; }; + if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((opline->op1_type & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (opline->op1_type == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (opline->op1_type == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (opline->op1_type == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + SAVE_OPLINE(); + zend_observer_fcall_end(execute_data, return_value); + if (return_value == &observer_retval) { zval_ptr_dtor_nogc(&observer_retval); }; + goto zend_leave_helper_SPEC_LABEL; +} + + HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_CONST): + VM_TRACE(ZEND_RETURN_BY_REF_SPEC_CONST) + ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_OBSERVER): + VM_TRACE(ZEND_RETURN_BY_REF_SPEC_OBSERVER) + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_CONST): + VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_CONST) + ZEND_GENERATOR_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_OBSERVER): + VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_OBSERVER) + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_THROW_SPEC_CONST): + VM_TRACE(ZEND_THROW_SPEC_CONST) + ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CATCH_SPEC_CONST): + VM_TRACE(ZEND_CATCH_SPEC_CONST) + ZEND_CATCH_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_USER_SPEC_CONST): + VM_TRACE(ZEND_SEND_USER_SPEC_CONST) + ZEND_SEND_USER_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_SPEC_CONST): + VM_TRACE(ZEND_BOOL_SPEC_CONST) + ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CLONE_SPEC_CONST): + VM_TRACE(ZEND_CLONE_SPEC_CONST) + ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CAST_SPEC_CONST): + VM_TRACE(ZEND_CAST_SPEC_CONST) + ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INCLUDE_OR_EVAL_SPEC_CONST): + VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_CONST) + ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER): + VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_RESET_R_SPEC_CONST): + VM_TRACE(ZEND_FE_RESET_R_SPEC_CONST) + ZEND_FE_RESET_R_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_RESET_RW_SPEC_CONST): + VM_TRACE(ZEND_FE_RESET_RW_SPEC_CONST) + ZEND_FE_RESET_RW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_SET_SPEC_CONST): + VM_TRACE(ZEND_JMP_SET_SPEC_CONST) + ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COALESCE_SPEC_CONST): + VM_TRACE(ZEND_COALESCE_SPEC_CONST) + ZEND_COALESCE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_NULL_SPEC_CONST): + VM_TRACE(ZEND_JMP_NULL_SPEC_CONST) + ZEND_JMP_NULL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_SPEC_CONST): + VM_TRACE(ZEND_QM_ASSIGN_SPEC_CONST) + ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DECLARE_CLASS_SPEC_CONST): + VM_TRACE(ZEND_DECLARE_CLASS_SPEC_CONST) + ZEND_DECLARE_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST): + VM_TRACE(ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST) + ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_FROM_SPEC_CONST): + VM_TRACE(ZEND_YIELD_FROM_SPEC_CONST) + ZEND_YIELD_FROM_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_STRLEN_SPEC_CONST): + VM_TRACE(ZEND_STRLEN_SPEC_CONST) + ZEND_STRLEN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_TYPE_CHECK_SPEC_CONST): + VM_TRACE(ZEND_TYPE_CHECK_SPEC_CONST) + ZEND_TYPE_CHECK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DEFINED_SPEC_CONST): + VM_TRACE(ZEND_DEFINED_SPEC_CONST) + ZEND_DEFINED_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_LONG_SPEC_CONST): + VM_TRACE(ZEND_QM_ASSIGN_LONG_SPEC_CONST) + ZEND_QM_ASSIGN_LONG_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST): + VM_TRACE(ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST) + ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_NOREF_SPEC_CONST): + VM_TRACE(ZEND_QM_ASSIGN_NOREF_SPEC_CONST) + ZEND_QM_ASSIGN_NOREF_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_SIMPLE_SPEC_CONST): + VM_TRACE(ZEND_SEND_VAL_SIMPLE_SPEC_CONST) + ZEND_SEND_VAL_SIMPLE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST): + VM_TRACE(ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST) + ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_SPEC_CONST_CONST): + VM_TRACE(ZEND_ADD_SPEC_CONST_CONST) + ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_SPEC_CONST_CONST): + VM_TRACE(ZEND_SUB_SPEC_CONST_CONST) + ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_SPEC_CONST_CONST): + VM_TRACE(ZEND_MUL_SPEC_CONST_CONST) + ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_CONST_CONST): + VM_TRACE(ZEND_DIV_SPEC_CONST_CONST) + ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MOD_SPEC_CONST_CONST): + VM_TRACE(ZEND_MOD_SPEC_CONST_CONST) + ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SL_SPEC_CONST_CONST): + VM_TRACE(ZEND_SL_SPEC_CONST_CONST) + ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SR_SPEC_CONST_CONST): + VM_TRACE(ZEND_SR_SPEC_CONST_CONST) + ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_CONST_CONST): + VM_TRACE(ZEND_POW_SPEC_CONST_CONST) + ZEND_POW_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_CONST_CONST): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_CONST_CONST) + ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST) + ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CONST_CONST): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CONST_CONST) + ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST) + ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_CONST_CONST): + VM_TRACE(ZEND_IS_SMALLER_SPEC_CONST_CONST) + ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_CONST_CONST): + VM_TRACE(ZEND_SPACESHIP_SPEC_CONST_CONST) + ZEND_SPACESHIP_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_OR_SPEC_CONST_CONST): + VM_TRACE(ZEND_BW_OR_SPEC_CONST_CONST) + ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_AND_SPEC_CONST_CONST): + VM_TRACE(ZEND_BW_AND_SPEC_CONST_CONST) + ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_XOR_SPEC_CONST_CONST): + VM_TRACE(ZEND_BW_XOR_SPEC_CONST_CONST) + ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_XOR_SPEC_CONST_CONST): + VM_TRACE(ZEND_BOOL_XOR_SPEC_CONST_CONST) + ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_CONST_CONST): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_CONST_CONST) + ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_CONST_CONST): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_CONST_CONST) + ZEND_FETCH_DIM_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_CONST_CONST): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_CONST_CONST) + ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST) + ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_R_SPEC_CONST_CONST): + VM_TRACE(ZEND_FETCH_LIST_R_SPEC_CONST_CONST) + ZEND_FETCH_LIST_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_CONST_CONST): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_CONST_CONST) + ZEND_FAST_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST) + ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_USER_CALL_SPEC_CONST_CONST): + VM_TRACE(ZEND_INIT_USER_CALL_SPEC_CONST_CONST) + ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_SPEC_CONST_CONST): + VM_TRACE(ZEND_SEND_VAL_SPEC_CONST_CONST) + ZEND_SEND_VAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_EX_SPEC_CONST_CONST): + VM_TRACE(ZEND_SEND_VAL_EX_SPEC_CONST_CONST) + ZEND_SEND_VAL_EX_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST): + VM_TRACE(ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST) + ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST) + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_CONST_CONST): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_CONST_CONST) + ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CONST): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CONST) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CONST): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CONST) + ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DECLARE_CLASS_DELAYED_SPEC_CONST_CONST): + VM_TRACE(ZEND_DECLARE_CLASS_DELAYED_SPEC_CONST_CONST) + ZEND_DECLARE_CLASS_DELAYED_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DECLARE_CONST_SPEC_CONST_CONST): + VM_TRACE(ZEND_DECLARE_CONST_SPEC_CONST_CONST) + ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_CONST_CONST): + VM_TRACE(ZEND_YIELD_SPEC_CONST_CONST) + ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SWITCH_LONG_SPEC_CONST_CONST): + VM_TRACE(ZEND_SWITCH_LONG_SPEC_CONST_CONST) + ZEND_SWITCH_LONG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SWITCH_STRING_SPEC_CONST_CONST): + VM_TRACE(ZEND_SWITCH_STRING_SPEC_CONST_CONST) + ZEND_SWITCH_STRING_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MATCH_SPEC_CONST_CONST): + VM_TRACE(ZEND_MATCH_SPEC_CONST_CONST) + ZEND_MATCH_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IN_ARRAY_SPEC_CONST_CONST): + VM_TRACE(ZEND_IN_ARRAY_SPEC_CONST_CONST) + ZEND_IN_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_ADD_SPEC_CONST_TMPVARCV) + ZEND_ADD_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_SUB_SPEC_CONST_TMPVARCV) + ZEND_SUB_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MOD_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_MOD_SPEC_CONST_TMPVARCV) + ZEND_MOD_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SL_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_SL_SPEC_CONST_TMPVARCV) + ZEND_SL_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SR_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_SR_SPEC_CONST_TMPVARCV) + ZEND_SR_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV) + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV) + ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_LONG_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) + ZEND_SUB_LONG_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) + ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV): + VM_TRACE(ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) + ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_DIV_SPEC_CONST_TMPVAR) + ZEND_DIV_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_POW_SPEC_CONST_TMPVAR) + ZEND_POW_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CONCAT_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_CONCAT_SPEC_CONST_TMPVAR) + ZEND_CONCAT_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_SPACESHIP_SPEC_CONST_TMPVAR) + ZEND_SPACESHIP_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR) + ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR) + ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR) + ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR) + ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR) + ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR) + ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR) + ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR) + ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR) + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR) + ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR) + ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_CONST_TMPVAR): + VM_TRACE(ZEND_YIELD_SPEC_CONST_TMPVAR) + ZEND_YIELD_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_R_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_FETCH_R_SPEC_CONST_UNUSED) + ZEND_FETCH_R_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_W_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_FETCH_W_SPEC_CONST_UNUSED) + ZEND_FETCH_W_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_RW_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_FETCH_RW_SPEC_CONST_UNUSED) + ZEND_FETCH_RW_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED) + ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_UNSET_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_FETCH_UNSET_SPEC_CONST_UNUSED) + ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_IS_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_FETCH_IS_SPEC_CONST_UNUSED) + ZEND_FETCH_IS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED) + ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_SEND_VAL_SPEC_CONST_UNUSED) + ZEND_SEND_VAL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED) + ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_QUICK): + VM_TRACE(ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_QUICK) + ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_NEW_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_NEW_SPEC_CONST_UNUSED) + ZEND_NEW_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED) + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_CONST_UNUSED) + ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_VAR_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_UNSET_VAR_SPEC_CONST_UNUSED) + ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED) + ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_YIELD_SPEC_CONST_UNUSED) + ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MATCH_ERROR_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_MATCH_ERROR_SPEC_CONST_UNUSED) + ZEND_MATCH_ERROR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COUNT_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_COUNT_SPEC_CONST_UNUSED) + ZEND_COUNT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_CLASS_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_GET_CLASS_SPEC_CONST_UNUSED) + ZEND_GET_CLASS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_TYPE_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_GET_TYPE_SPEC_CONST_UNUSED) + ZEND_GET_TYPE_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSED): + VM_TRACE(ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSED) + ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_CONST_CV): + VM_TRACE(ZEND_DIV_SPEC_CONST_CV) + ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_CONST_CV): + VM_TRACE(ZEND_POW_SPEC_CONST_CV) + ZEND_POW_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CONCAT_SPEC_CONST_CV): + VM_TRACE(ZEND_CONCAT_SPEC_CONST_CV) + ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_CONST_CV): + VM_TRACE(ZEND_SPACESHIP_SPEC_CONST_CV) + ZEND_SPACESHIP_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_CONST_CV): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_CONST_CV) + ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_CONST_CV): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_CONST_CV) + ZEND_FETCH_DIM_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_CONST_CV): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_CONST_CV) + ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_CONST_CV): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_CONST_CV) + ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_R_SPEC_CONST_CV): + VM_TRACE(ZEND_FETCH_LIST_R_SPEC_CONST_CV) + ZEND_FETCH_LIST_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_CONST_CV): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_CONST_CV) + ZEND_FAST_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_CONST_CV): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_CONST_CV) + ZEND_INIT_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_USER_CALL_SPEC_CONST_CV): + VM_TRACE(ZEND_INIT_USER_CALL_SPEC_CONST_CV) + ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV) + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_CONST_CV): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_CONST_CV) + ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CV): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CV) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CV): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CV) + ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_CONST_CV): + VM_TRACE(ZEND_YIELD_SPEC_CONST_CV) + ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_NOT_SPEC_TMPVARCV): + VM_TRACE(ZEND_BW_NOT_SPEC_TMPVARCV) + ZEND_BW_NOT_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV): + VM_TRACE(ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) + ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV): + VM_TRACE(ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) + ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV): + VM_TRACE(ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) + ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_ADD_SPEC_TMPVARCV_CONST) + ZEND_ADD_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_SUB_SPEC_TMPVARCV_CONST) + ZEND_SUB_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_MUL_SPEC_TMPVARCV_CONST) + ZEND_MUL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MOD_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_MOD_SPEC_TMPVARCV_CONST) + ZEND_MOD_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SL_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_SL_SPEC_TMPVARCV_CONST) + ZEND_SL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SR_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_SR_SPEC_TMPVARCV_CONST) + ZEND_SR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST) + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_OR_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_BW_OR_SPEC_TMPVARCV_CONST) + ZEND_BW_OR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_AND_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_BW_AND_SPEC_TMPVARCV_CONST) + ZEND_BW_AND_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_XOR_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_BW_XOR_SPEC_TMPVARCV_CONST) + ZEND_BW_XOR_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST) + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST) + ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST) + ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MATCH_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_MATCH_SPEC_TMPVARCV_CONST) + ZEND_MATCH_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_LONG_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) + ZEND_ADD_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_LONG_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) + ZEND_SUB_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_LONG_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) + ZEND_MUL_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MOD_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SL_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_SL_SPEC_TMPVARCV_TMPVARCV) + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SR_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_SR_SPEC_TMPVARCV_TMPVARCV) + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ): + VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR): + VM_TRACE(ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR) + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED): + VM_TRACE(ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED) + ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV): + VM_TRACE(ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV) + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_NOT_SPEC_TMPVAR): + VM_TRACE(ZEND_BOOL_NOT_SPEC_TMPVAR) + ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ECHO_SPEC_TMPVAR): + VM_TRACE(ZEND_ECHO_SPEC_TMPVAR) + ZEND_ECHO_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPZ_SPEC_TMPVAR): + VM_TRACE(ZEND_JMPZ_SPEC_TMPVAR) + ZEND_JMPZ_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPNZ_SPEC_TMPVAR): + VM_TRACE(ZEND_JMPNZ_SPEC_TMPVAR) + ZEND_JMPNZ_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPZ_EX_SPEC_TMPVAR): + VM_TRACE(ZEND_JMPZ_EX_SPEC_TMPVAR) + ZEND_JMPZ_EX_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPNZ_EX_SPEC_TMPVAR): + VM_TRACE(ZEND_JMPNZ_EX_SPEC_TMPVAR) + ZEND_JMPNZ_EX_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FREE_SPEC_TMPVAR): + VM_TRACE(ZEND_FREE_SPEC_TMPVAR) + ZEND_FREE_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_FREE_SPEC_TMPVAR): + VM_TRACE(ZEND_FE_FREE_SPEC_TMPVAR) + ZEND_FE_FREE_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_THROW_SPEC_TMPVAR): + VM_TRACE(ZEND_THROW_SPEC_TMPVAR) + ZEND_THROW_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_SPEC_TMPVAR): + VM_TRACE(ZEND_BOOL_SPEC_TMPVAR) + ZEND_BOOL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CLONE_SPEC_TMPVAR): + VM_TRACE(ZEND_CLONE_SPEC_TMPVAR) + ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR): + VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR) + ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_FROM_SPEC_TMPVAR): + VM_TRACE(ZEND_YIELD_FROM_SPEC_TMPVAR) + ZEND_YIELD_FROM_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_STRLEN_SPEC_TMPVAR): + VM_TRACE(ZEND_STRLEN_SPEC_TMPVAR) + ZEND_STRLEN_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_TYPE_CHECK_SPEC_TMPVAR): + VM_TRACE(ZEND_TYPE_CHECK_SPEC_TMPVAR) + ZEND_TYPE_CHECK_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR): + VM_TRACE(ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR) + ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_DIV_SPEC_TMPVAR_CONST) + ZEND_DIV_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_POW_SPEC_TMPVAR_CONST) + ZEND_POW_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CONCAT_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_CONCAT_SPEC_TMPVAR_CONST) + ZEND_CONCAT_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_IS_EQUAL_SPEC_TMPVAR_CONST) + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ) + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ) + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST) + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ) + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ) + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_SPACESHIP_SPEC_TMPVAR_CONST) + ZEND_SPACESHIP_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_XOR_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_BOOL_XOR_SPEC_TMPVAR_CONST) + ZEND_BOOL_XOR_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST) + ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST) + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST) + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST) + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST) + ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST) + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_SEND_VAL_SPEC_TMPVAR_CONST) + ZEND_SEND_VAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_CASE_SPEC_TMPVAR_CONST) + ZEND_CASE_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST) + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INSTANCEOF_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_INSTANCEOF_SPEC_TMPVAR_CONST) + ZEND_INSTANCEOF_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST): + VM_TRACE(ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV): + VM_TRACE(ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_DIV_SPEC_TMPVAR_TMPVAR) + ZEND_DIV_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_POW_SPEC_TMPVAR_TMPVAR) + ZEND_POW_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CONCAT_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_CONCAT_SPEC_TMPVAR_TMPVAR) + ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR) + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR) + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR) + ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR) + ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR) + ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR) + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR) + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR) + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR) + ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR) + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_CASE_SPEC_TMPVAR_TMPVAR) + ZEND_CASE_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR) + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INSTANCEOF_SPEC_TMPVAR_VAR): + VM_TRACE(ZEND_INSTANCEOF_SPEC_TMPVAR_VAR) + ZEND_INSTANCEOF_SPEC_TMPVAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_R_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_FETCH_R_SPEC_TMPVAR_UNUSED) + ZEND_FETCH_R_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_W_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_FETCH_W_SPEC_TMPVAR_UNUSED) + ZEND_FETCH_W_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED) + ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED) + ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED) + ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED) + ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED) + ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED) + ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED) + ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED) + ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COUNT_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_COUNT_SPEC_TMPVAR_UNUSED) + ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) + ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED) + ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COPY_TMP_SPEC_TMPVAR_UNUSED): + VM_TRACE(ZEND_COPY_TMP_SPEC_TMPVAR_UNUSED) + ZEND_COPY_TMP_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_DIV_SPEC_TMPVAR_CV) + ZEND_DIV_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_POW_SPEC_TMPVAR_CV) + ZEND_POW_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CONCAT_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_CONCAT_SPEC_TMPVAR_CV) + ZEND_CONCAT_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_SPACESHIP_SPEC_TMPVAR_CV) + ZEND_SPACESHIP_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV) + ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV) + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV) + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV) + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_TMPVAR_CV) + ZEND_FAST_CONCAT_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV) + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_CASE_SPEC_TMPVAR_CV) + ZEND_CASE_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV) + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RETURN_SPEC_TMP): + VM_TRACE(ZEND_RETURN_SPEC_TMP) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); + return_value = EX(return_value); + + if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (IS_TMP_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (IS_TMP_VAR == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (IS_TMP_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + + + + goto zend_leave_helper_SPEC_LABEL; +} + + HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_TMP): + VM_TRACE(ZEND_RETURN_BY_REF_SPEC_TMP) + ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_TMP): + VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_TMP) + ZEND_GENERATOR_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_USER_SPEC_TMP): + VM_TRACE(ZEND_SEND_USER_SPEC_TMP) + ZEND_SEND_USER_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CAST_SPEC_TMP): + VM_TRACE(ZEND_CAST_SPEC_TMP) + ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_RESET_R_SPEC_TMP): + VM_TRACE(ZEND_FE_RESET_R_SPEC_TMP) + ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_RESET_RW_SPEC_TMP): + VM_TRACE(ZEND_FE_RESET_RW_SPEC_TMP) + ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_END_SILENCE_SPEC_TMP): + VM_TRACE(ZEND_END_SILENCE_SPEC_TMP) + ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_SET_SPEC_TMP): + VM_TRACE(ZEND_JMP_SET_SPEC_TMP) + ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COALESCE_SPEC_TMP): + VM_TRACE(ZEND_COALESCE_SPEC_TMP) + ZEND_COALESCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_NULL_SPEC_TMP): + VM_TRACE(ZEND_JMP_NULL_SPEC_TMP) + ZEND_JMP_NULL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_SPEC_TMP): + VM_TRACE(ZEND_QM_ASSIGN_SPEC_TMP) + ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_TMP_CONST): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_TMP_CONST) + ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_STRICT_SPEC_TMP_CONST): + VM_TRACE(ZEND_CASE_STRICT_SPEC_TMP_CONST) + ZEND_CASE_STRICT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST) + ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_ADD_SPEC_TMP_CONST): + VM_TRACE(ZEND_ROPE_ADD_SPEC_TMP_CONST) + ZEND_ROPE_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_END_SPEC_TMP_CONST): + VM_TRACE(ZEND_ROPE_END_SPEC_TMP_CONST) + ZEND_ROPE_END_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_EX_SPEC_TMP_CONST): + VM_TRACE(ZEND_SEND_VAL_EX_SPEC_TMP_CONST) + ZEND_SEND_VAL_EX_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST) + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_TMP_CONST): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_TMP_CONST) + ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_TMP_CONST): + VM_TRACE(ZEND_YIELD_SPEC_TMP_CONST) + ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IN_ARRAY_SPEC_TMP_CONST): + VM_TRACE(ZEND_IN_ARRAY_SPEC_TMP_CONST) + ZEND_IN_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_ADD_SPEC_TMP_TMPVAR): + VM_TRACE(ZEND_ROPE_ADD_SPEC_TMP_TMPVAR) + ZEND_ROPE_ADD_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_END_SPEC_TMP_TMPVAR): + VM_TRACE(ZEND_ROPE_END_SPEC_TMP_TMPVAR) + ZEND_ROPE_END_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR) + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR) + ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_TMP_TMPVAR): + VM_TRACE(ZEND_YIELD_SPEC_TMP_TMPVAR) + ZEND_YIELD_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_TMP_TMP): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_TMP_TMP) + ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_STRICT_SPEC_TMP_TMP): + VM_TRACE(ZEND_CASE_STRICT_SPEC_TMP_TMP) + ZEND_CASE_STRICT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP) + ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_STRICT_SPEC_TMP_VAR): + VM_TRACE(ZEND_CASE_STRICT_SPEC_TMP_VAR) + ZEND_CASE_STRICT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UNUSED): + VM_TRACE(ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UNUSED) + ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED): + VM_TRACE(ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED) + ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_QUICK): + VM_TRACE(ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_QUICK) + ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED) + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_TMP_UNUSED): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_TMP_UNUSED) + ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_TMP_UNUSED): + VM_TRACE(ZEND_YIELD_SPEC_TMP_UNUSED) + ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_TYPE_SPEC_TMP_UNUSED): + VM_TRACE(ZEND_GET_TYPE_SPEC_TMP_UNUSED) + ZEND_GET_TYPE_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_STRICT_SPEC_TMP_CV): + VM_TRACE(ZEND_CASE_STRICT_SPEC_TMP_CV) + ZEND_CASE_STRICT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_ADD_SPEC_TMP_CV): + VM_TRACE(ZEND_ROPE_ADD_SPEC_TMP_CV) + ZEND_ROPE_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_END_SPEC_TMP_CV): + VM_TRACE(ZEND_ROPE_END_SPEC_TMP_CV) + ZEND_ROPE_END_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV) + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_TMP_CV): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_TMP_CV) + ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_TMP_CV): + VM_TRACE(ZEND_YIELD_SPEC_TMP_CV) + ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BIND_LEXICAL_SPEC_TMP_CV): + VM_TRACE(ZEND_BIND_LEXICAL_SPEC_TMP_CV) + ZEND_BIND_LEXICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_SPEC_VAR_RETVAL_UNUSED): + VM_TRACE(ZEND_PRE_INC_SPEC_VAR_RETVAL_UNUSED) + ZEND_PRE_INC_SPEC_VAR_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_SPEC_VAR_RETVAL_USED): + VM_TRACE(ZEND_PRE_INC_SPEC_VAR_RETVAL_USED) + ZEND_PRE_INC_SPEC_VAR_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_DEC_SPEC_VAR_RETVAL_UNUSED): + VM_TRACE(ZEND_PRE_DEC_SPEC_VAR_RETVAL_UNUSED) + ZEND_PRE_DEC_SPEC_VAR_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_DEC_SPEC_VAR_RETVAL_USED): + VM_TRACE(ZEND_PRE_DEC_SPEC_VAR_RETVAL_USED) + ZEND_PRE_DEC_SPEC_VAR_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_SPEC_VAR): + VM_TRACE(ZEND_POST_INC_SPEC_VAR) + ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_DEC_SPEC_VAR): + VM_TRACE(ZEND_POST_DEC_SPEC_VAR) + ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RETURN_SPEC_VAR): + VM_TRACE(ZEND_RETURN_SPEC_VAR) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + return_value = EX(return_value); + + if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (IS_VAR & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (IS_VAR == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (IS_VAR == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (IS_VAR == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + + + + goto zend_leave_helper_SPEC_LABEL; +} + + HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_VAR): + VM_TRACE(ZEND_RETURN_BY_REF_SPEC_VAR) + ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_VAR): + VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_VAR) + ZEND_GENERATOR_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_USER_SPEC_VAR): + VM_TRACE(ZEND_SEND_USER_SPEC_VAR) + ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CAST_SPEC_VAR): + VM_TRACE(ZEND_CAST_SPEC_VAR) + ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_RESET_R_SPEC_VAR): + VM_TRACE(ZEND_FE_RESET_R_SPEC_VAR) + ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_RESET_RW_SPEC_VAR): + VM_TRACE(ZEND_FE_RESET_RW_SPEC_VAR) + ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_FETCH_R_SPEC_VAR): + VM_TRACE(ZEND_FE_FETCH_R_SPEC_VAR) + ZEND_FE_FETCH_R_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_FETCH_RW_SPEC_VAR): + VM_TRACE(ZEND_FE_FETCH_RW_SPEC_VAR) + ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_SET_SPEC_VAR): + VM_TRACE(ZEND_JMP_SET_SPEC_VAR) + ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COALESCE_SPEC_VAR): + VM_TRACE(ZEND_COALESCE_SPEC_VAR) + ZEND_COALESCE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_NULL_SPEC_VAR): + VM_TRACE(ZEND_JMP_NULL_SPEC_VAR) + ZEND_JMP_NULL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_SPEC_VAR): + VM_TRACE(ZEND_QM_ASSIGN_SPEC_VAR) + ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_SIMPLE_SPEC_VAR): + VM_TRACE(ZEND_SEND_VAR_SIMPLE_SPEC_VAR) + ZEND_SEND_VAR_SIMPLE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_VAR_CONST): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_VAR_CONST) + ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_STRICT_SPEC_VAR_CONST): + VM_TRACE(ZEND_CASE_STRICT_SPEC_VAR_CONST) + ZEND_CASE_STRICT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST) + ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CONST) + ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_OP_SPEC_VAR_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_OP_SPEC_VAR_CONST) + ZEND_ASSIGN_DIM_OP_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OP_SPEC_VAR_CONST): + VM_TRACE(ZEND_ASSIGN_OP_SPEC_VAR_CONST) + ZEND_ASSIGN_OP_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_VAR_CONST): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_VAR_CONST) + ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_VAR_CONST): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_VAR_CONST) + ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_W_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_DIM_W_SPEC_VAR_CONST) + ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_RW_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_DIM_RW_SPEC_VAR_CONST) + ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST) + ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_VAR_CONST) + ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST) + ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST) + ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_W_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_LIST_W_SPEC_VAR_CONST) + ZEND_FETCH_LIST_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CONST) + ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_TMP) + ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_VAR) + ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CV) + ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_UNUSED): + VM_TRACE(ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_UNUSED) + ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_USED): + VM_TRACE(ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_USED) + ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_SPEC_VAR_CONST): + VM_TRACE(ZEND_SEND_VAR_SPEC_VAR_CONST) + ZEND_SEND_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_NO_REF_SPEC_VAR_CONST): + VM_TRACE(ZEND_SEND_VAR_NO_REF_SPEC_VAR_CONST) + ZEND_SEND_VAR_NO_REF_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST): + VM_TRACE(ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST) + ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_REF_SPEC_VAR_CONST): + VM_TRACE(ZEND_SEND_REF_SPEC_VAR_CONST) + ZEND_SEND_REF_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_EX_SPEC_VAR_CONST): + VM_TRACE(ZEND_SEND_VAR_EX_SPEC_VAR_CONST) + ZEND_SEND_VAR_EX_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_FUNC_ARG_SPEC_VAR_CONST): + VM_TRACE(ZEND_SEND_FUNC_ARG_SPEC_VAR_CONST) + ZEND_SEND_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_CONST): + VM_TRACE(ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_CONST) + ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST) + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_VAR_CONST): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_VAR_CONST) + ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_DIM_SPEC_VAR_CONST): + VM_TRACE(ZEND_UNSET_DIM_SPEC_VAR_CONST) + ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_VAR_CONST): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_VAR_CONST) + ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_VAR_CONST): + VM_TRACE(ZEND_YIELD_SPEC_VAR_CONST) + ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IN_ARRAY_SPEC_VAR_CONST): + VM_TRACE(ZEND_IN_ARRAY_SPEC_VAR_CONST) + ZEND_IN_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV): + VM_TRACE(ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV) + ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR) + ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR) + ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR) + ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR) + ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR) + ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR) + ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR) + ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR) + ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR) + ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR) + ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR) + ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR) + ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST) + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP) + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR) + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV) + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR) + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR) + ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_DIM_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_UNSET_DIM_SPEC_VAR_TMPVAR) + ZEND_UNSET_DIM_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR) + ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_VAR_TMPVAR): + VM_TRACE(ZEND_YIELD_SPEC_VAR_TMPVAR) + ZEND_YIELD_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_VAR_TMP): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_VAR_TMP) + ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_STRICT_SPEC_VAR_TMP): + VM_TRACE(ZEND_CASE_STRICT_SPEC_VAR_TMP) + ZEND_CASE_STRICT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP) + ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_UNUSED): + VM_TRACE(ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_UNUSED) + ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_USED): + VM_TRACE(ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_USED) + ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_VAR_VAR): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_VAR_VAR) + ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_STRICT_SPEC_VAR_VAR): + VM_TRACE(ZEND_CASE_STRICT_SPEC_VAR_VAR) + ZEND_CASE_STRICT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR) + ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_UNUSED): + VM_TRACE(ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_UNUSED) + ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_USED): + VM_TRACE(ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_USED) + ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_REF_SPEC_VAR_VAR): + VM_TRACE(ZEND_ASSIGN_REF_SPEC_VAR_VAR) + ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_OP_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_ASSIGN_DIM_OP_SPEC_VAR_UNUSED) + ZEND_ASSIGN_DIM_OP_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED) + ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED) + ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CONST) + ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_TMP) + ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_VAR) + ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CV) + ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED) + ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_SEND_VAR_SPEC_VAR_UNUSED) + ZEND_SEND_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_NO_REF_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_SEND_VAR_NO_REF_SPEC_VAR_UNUSED) + ZEND_SEND_VAR_NO_REF_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED) + ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_QUICK): + VM_TRACE(ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_QUICK) + ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_REF_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_SEND_REF_SPEC_VAR_UNUSED) + ZEND_SEND_REF_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED) + ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_QUICK): + VM_TRACE(ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_QUICK) + ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_FUNC_ARG_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_SEND_FUNC_ARG_SPEC_VAR_UNUSED) + ZEND_SEND_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_NEW_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_NEW_SPEC_VAR_UNUSED) + ZEND_NEW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED) + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_VAR_UNUSED) + ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEPARATE_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_SEPARATE_SPEC_VAR_UNUSED) + ZEND_SEPARATE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_YIELD_SPEC_VAR_UNUSED) + ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MAKE_REF_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_MAKE_REF_SPEC_VAR_UNUSED) + ZEND_MAKE_REF_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_TYPE_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_GET_TYPE_SPEC_VAR_UNUSED) + ZEND_GET_TYPE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED): + VM_TRACE(ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED) + ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CASE_STRICT_SPEC_VAR_CV): + VM_TRACE(ZEND_CASE_STRICT_SPEC_VAR_CV) + ZEND_CASE_STRICT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CV) + ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_OP_SPEC_VAR_CV): + VM_TRACE(ZEND_ASSIGN_DIM_OP_SPEC_VAR_CV) + ZEND_ASSIGN_DIM_OP_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OP_SPEC_VAR_CV): + VM_TRACE(ZEND_ASSIGN_OP_SPEC_VAR_CV) + ZEND_ASSIGN_OP_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_VAR_CV): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_VAR_CV) + ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_VAR_CV): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_VAR_CV) + ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_W_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_DIM_W_SPEC_VAR_CV) + ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_RW_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_DIM_RW_SPEC_VAR_CV) + ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV) + ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_VAR_CV) + ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_VAR_CV) + ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV) + ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_LIST_W_SPEC_VAR_CV): + VM_TRACE(ZEND_FETCH_LIST_W_SPEC_VAR_CV) + ZEND_FETCH_LIST_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CONST) + ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_TMP) + ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_VAR) + ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CV) + ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_UNUSED) + ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_USED): + VM_TRACE(ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_USED) + ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_REF_SPEC_VAR_CV): + VM_TRACE(ZEND_ASSIGN_REF_SPEC_VAR_CV) + ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV) + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_VAR_CV): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_VAR_CV) + ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_DIM_SPEC_VAR_CV): + VM_TRACE(ZEND_UNSET_DIM_SPEC_VAR_CV) + ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_VAR_CV): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_VAR_CV) + ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_VAR_CV): + VM_TRACE(ZEND_YIELD_SPEC_VAR_CV) + ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED) + ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED): + VM_TRACE(ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED) + ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CLONE_SPEC_UNUSED): + VM_TRACE(ZEND_CLONE_SPEC_UNUSED) + ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_NAME_SPEC_UNUSED): + VM_TRACE(ZEND_FETCH_CLASS_NAME_SPEC_UNUSED) + ZEND_FETCH_CLASS_NAME_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CONST) + ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST) + ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST) + ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST) + ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST) + ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST) + ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST) + ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST) + ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_INIT_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_ROPE_INIT_SPEC_UNUSED_CONST) + ZEND_ROPE_INIT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_CLASS_SPEC_UNUSED_CONST) + ZEND_FETCH_CLASS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST) + ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CONST) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST) + ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST) + ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_CONST) + ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_UNUSED_CONST) + ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_UNUSED_CONST) + ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_YIELD_SPEC_UNUSED_CONST) + ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV): + VM_TRACE(ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV) + ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR) + ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR) + ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR) + ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR) + ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR) + ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR) + ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR) + ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR) + ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR) + ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR) + ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR) + ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR) + ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR) + ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_UNUSED_TMPVAR): + VM_TRACE(ZEND_YIELD_SPEC_UNUSED_TMPVAR) + ZEND_YIELD_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_FETCH_CLASS_SPEC_UNUSED_UNUSED) + ZEND_FETCH_CLASS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_UNUSED) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED_UNUSED) + ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_VERIFY_NEVER_TYPE_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_VERIFY_NEVER_TYPE_SPEC_UNUSED_UNUSED) + ZEND_VERIFY_NEVER_TYPE_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED) + ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_QUICK): + VM_TRACE(ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_QUICK) + ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED) + ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_NEW_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_NEW_SPEC_UNUSED_UNUSED) + ZEND_NEW_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED) + ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_YIELD_SPEC_UNUSED_UNUSED) + ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_THIS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_FETCH_THIS_SPEC_UNUSED_UNUSED) + ZEND_FETCH_THIS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_GLOBALS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_FETCH_GLOBALS_SPEC_UNUSED_UNUSED) + ZEND_FETCH_GLOBALS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_THIS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_ISSET_ISEMPTY_THIS_SPEC_UNUSED_UNUSED) + ZEND_ISSET_ISEMPTY_THIS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_CLASS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_GET_CLASS_SPEC_UNUSED_UNUSED) + ZEND_GET_CLASS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_CALLED_CLASS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_GET_CALLED_CLASS_SPEC_UNUSED_UNUSED) + ZEND_GET_CALLED_CLASS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FUNC_NUM_ARGS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_FUNC_NUM_ARGS_SPEC_UNUSED_UNUSED) + ZEND_FUNC_NUM_ARGS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUSED) + ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED) + ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CV) + ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV) + ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_UNUSED_CV): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_UNUSED_CV) + ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV) + ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV) + ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV) + ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV) + ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV) + ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ROPE_INIT_SPEC_UNUSED_CV): + VM_TRACE(ZEND_ROPE_INIT_SPEC_UNUSED_CV) + ZEND_ROPE_INIT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_SPEC_UNUSED_CV): + VM_TRACE(ZEND_FETCH_CLASS_SPEC_UNUSED_CV) + ZEND_FETCH_CLASS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV) + ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CV): + VM_TRACE(ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CV) + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_UNUSED_CV): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_UNUSED_CV) + ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_UNUSED_CV): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_UNUSED_CV) + ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_UNUSED_CV): + VM_TRACE(ZEND_YIELD_SPEC_UNUSED_CV) + ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_NOT_SPEC_CV): + VM_TRACE(ZEND_BOOL_NOT_SPEC_CV) + ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_SPEC_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_PRE_INC_SPEC_CV_RETVAL_UNUSED) + ZEND_PRE_INC_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_SPEC_CV_RETVAL_USED): + VM_TRACE(ZEND_PRE_INC_SPEC_CV_RETVAL_USED) + ZEND_PRE_INC_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_DEC_SPEC_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_PRE_DEC_SPEC_CV_RETVAL_UNUSED) + ZEND_PRE_DEC_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_DEC_SPEC_CV_RETVAL_USED): + VM_TRACE(ZEND_PRE_DEC_SPEC_CV_RETVAL_USED) + ZEND_PRE_DEC_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_SPEC_CV): + VM_TRACE(ZEND_POST_INC_SPEC_CV) + ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_DEC_SPEC_CV): + VM_TRACE(ZEND_POST_DEC_SPEC_CV) + ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ECHO_SPEC_CV): + VM_TRACE(ZEND_ECHO_SPEC_CV) + ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPZ_SPEC_CV): + VM_TRACE(ZEND_JMPZ_SPEC_CV) + ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPNZ_SPEC_CV): + VM_TRACE(ZEND_JMPNZ_SPEC_CV) + ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPZ_EX_SPEC_CV): + VM_TRACE(ZEND_JMPZ_EX_SPEC_CV) + ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMPNZ_EX_SPEC_CV): + VM_TRACE(ZEND_JMPNZ_EX_SPEC_CV) + ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_RETURN_SPEC_CV): + VM_TRACE(ZEND_RETURN_SPEC_CV) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = EX_VAR(opline->op1.var); + return_value = EX(return_value); + + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (IS_CV & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (IS_CV == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (IS_CV == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & (ZEND_CALL_CODE|ZEND_CALL_OBSERVED)))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + SAVE_OPLINE(); + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (IS_CV == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + + + + goto zend_leave_helper_SPEC_LABEL; +} + + HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_CV): + VM_TRACE(ZEND_RETURN_BY_REF_SPEC_CV) + ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_CV): + VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_CV) + ZEND_GENERATOR_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_THROW_SPEC_CV): + VM_TRACE(ZEND_THROW_SPEC_CV) + ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_USER_SPEC_CV): + VM_TRACE(ZEND_SEND_USER_SPEC_CV) + ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_SPEC_CV): + VM_TRACE(ZEND_BOOL_SPEC_CV) + ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CLONE_SPEC_CV): + VM_TRACE(ZEND_CLONE_SPEC_CV) + ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CAST_SPEC_CV): + VM_TRACE(ZEND_CAST_SPEC_CV) + ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INCLUDE_OR_EVAL_SPEC_CV): + VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_CV) + ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_RESET_R_SPEC_CV): + VM_TRACE(ZEND_FE_RESET_R_SPEC_CV) + ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FE_RESET_RW_SPEC_CV): + VM_TRACE(ZEND_FE_RESET_RW_SPEC_CV) + ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_SET_SPEC_CV): + VM_TRACE(ZEND_JMP_SET_SPEC_CV) + ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COALESCE_SPEC_CV): + VM_TRACE(ZEND_COALESCE_SPEC_CV) + ZEND_COALESCE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_JMP_NULL_SPEC_CV): + VM_TRACE(ZEND_JMP_NULL_SPEC_CV) + ZEND_JMP_NULL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_QM_ASSIGN_SPEC_CV): + VM_TRACE(ZEND_QM_ASSIGN_SPEC_CV) + ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_FROM_SPEC_CV): + VM_TRACE(ZEND_YIELD_FROM_SPEC_CV) + ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_STRLEN_SPEC_CV): + VM_TRACE(ZEND_STRLEN_SPEC_CV) + ZEND_STRLEN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_TYPE_CHECK_SPEC_CV): + VM_TRACE(ZEND_TYPE_CHECK_SPEC_CV) + ZEND_TYPE_CHECK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_CLASS_NAME_SPEC_CV): + VM_TRACE(ZEND_FETCH_CLASS_NAME_SPEC_CV) + ZEND_FETCH_CLASS_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BIND_STATIC_SPEC_CV): + VM_TRACE(ZEND_BIND_STATIC_SPEC_CV) + ZEND_BIND_STATIC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV): + VM_TRACE(ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV) + ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) + ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED): + VM_TRACE(ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) + ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED) + ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED): + VM_TRACE(ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED) + ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) + ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED): + VM_TRACE(ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) + ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED) + ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED): + VM_TRACE(ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED) + ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV): + VM_TRACE(ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV) + ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_LONG_SPEC_CV): + VM_TRACE(ZEND_POST_INC_LONG_SPEC_CV) + ZEND_POST_INC_LONG_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV): + VM_TRACE(ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV) + ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_DEC_LONG_SPEC_CV): + VM_TRACE(ZEND_POST_DEC_LONG_SPEC_CV) + ZEND_POST_DEC_LONG_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_SIMPLE_SPEC_CV): + VM_TRACE(ZEND_SEND_VAR_SIMPLE_SPEC_CV) + ZEND_SEND_VAR_SIMPLE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_CV_CONST): + VM_TRACE(ZEND_DIV_SPEC_CV_CONST) + ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_CV_CONST): + VM_TRACE(ZEND_POW_SPEC_CV_CONST) + ZEND_POW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CONCAT_SPEC_CV_CONST): + VM_TRACE(ZEND_CONCAT_SPEC_CV_CONST) + ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_CV_CONST): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_CV_CONST) + ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST) + ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_CONST): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_CONST) + ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ) + ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ) + ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_CONST): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_CONST) + ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPZ) + ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPNZ) + ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_CV_CONST): + VM_TRACE(ZEND_SPACESHIP_SPEC_CV_CONST) + ZEND_SPACESHIP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_XOR_SPEC_CV_CONST): + VM_TRACE(ZEND_BOOL_XOR_SPEC_CV_CONST) + ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_CV_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_CV_CONST) + ZEND_ASSIGN_OBJ_OP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_OP_SPEC_CV_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_OP_SPEC_CV_CONST) + ZEND_ASSIGN_DIM_OP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OP_SPEC_CV_CONST): + VM_TRACE(ZEND_ASSIGN_OP_SPEC_CV_CONST) + ZEND_ASSIGN_OP_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_CV_CONST): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_CV_CONST) + ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_CV_CONST): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_CV_CONST) + ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_CV_CONST) + ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_W_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_DIM_W_SPEC_CV_CONST) + ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_RW_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_DIM_RW_SPEC_CV_CONST) + ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_CV_CONST) + ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST) + ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_CV_CONST) + ZEND_FETCH_OBJ_R_SPEC_CV_CONST_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_CV_CONST) + ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_CV_CONST) + ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_CV_CONST) + ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST) + ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST) + ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_TMP) + ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_VAR) + ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CV) + ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED): + VM_TRACE(ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED) + ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_USED): + VM_TRACE(ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_USED) + ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_CV_CONST): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_CV_CONST) + ZEND_FAST_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_CV_CONST): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_CV_CONST) + ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_SPEC_CV_CONST): + VM_TRACE(ZEND_SEND_VAR_SPEC_CV_CONST) + ZEND_SEND_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_REF_SPEC_CV_CONST): + VM_TRACE(ZEND_SEND_REF_SPEC_CV_CONST) + ZEND_SEND_REF_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_EX_SPEC_CV_CONST): + VM_TRACE(ZEND_SEND_VAR_EX_SPEC_CV_CONST) + ZEND_SEND_VAR_EX_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST) + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_CV_CONST): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_CV_CONST) + ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_DIM_SPEC_CV_CONST): + VM_TRACE(ZEND_UNSET_DIM_SPEC_CV_CONST) + ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_CV_CONST): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_CV_CONST) + ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CONST): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CONST) + ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INSTANCEOF_SPEC_CV_CONST): + VM_TRACE(ZEND_INSTANCEOF_SPEC_CV_CONST) + ZEND_INSTANCEOF_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_CV_CONST): + VM_TRACE(ZEND_YIELD_SPEC_CV_CONST) + ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BIND_GLOBAL_SPEC_CV_CONST): + VM_TRACE(ZEND_BIND_GLOBAL_SPEC_CV_CONST) + ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IN_ARRAY_SPEC_CV_CONST): + VM_TRACE(ZEND_IN_ARRAY_SPEC_CV_CONST) + ZEND_IN_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST): + VM_TRACE(ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST) + ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST) + ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST): + VM_TRACE(ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST) + ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV): + VM_TRACE(ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) + ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_DIV_SPEC_CV_TMPVAR) + ZEND_DIV_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_POW_SPEC_CV_TMPVAR) + ZEND_POW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CONCAT_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_CONCAT_SPEC_CV_TMPVAR) + ZEND_CONCAT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_TMPVAR) + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ) + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ) + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR) + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ) + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ) + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_SPACESHIP_SPEC_CV_TMPVAR) + ZEND_SPACESHIP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_XOR_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_BOOL_XOR_SPEC_CV_TMPVAR) + ZEND_BOOL_XOR_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR) + ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR) + ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OP_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_ASSIGN_OP_SPEC_CV_TMPVAR) + ZEND_ASSIGN_OP_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR) + ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR) + ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR) + ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR) + ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR) + ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR) + ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR) + ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR) + ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR) + ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR) + ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR) + ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR) + ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST) + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP) + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR) + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV) + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_CV_TMPVAR) + ZEND_FAST_CONCAT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR) + ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR) + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_CV_TMPVAR) + ZEND_INIT_ARRAY_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_DIM_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_UNSET_DIM_SPEC_CV_TMPVAR) + ZEND_UNSET_DIM_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_CV_TMPVAR) + ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR) + ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_CV_TMPVAR): + VM_TRACE(ZEND_YIELD_SPEC_CV_TMPVAR) + ZEND_YIELD_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_CV_TMP): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_CV_TMP) + ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP) + ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_UNUSED): + VM_TRACE(ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_UNUSED) + ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_USED): + VM_TRACE(ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_USED) + ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_CV_VAR): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_CV_VAR) + ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR) + ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_UNUSED): + VM_TRACE(ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_UNUSED) + ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_USED): + VM_TRACE(ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_USED) + ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_REF_SPEC_CV_VAR): + VM_TRACE(ZEND_ASSIGN_REF_SPEC_CV_VAR) + ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INSTANCEOF_SPEC_CV_VAR): + VM_TRACE(ZEND_INSTANCEOF_SPEC_CV_VAR) + ZEND_INSTANCEOF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_OP_SPEC_CV_UNUSED): + VM_TRACE(ZEND_ASSIGN_DIM_OP_SPEC_CV_UNUSED) + ZEND_ASSIGN_DIM_OP_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_R_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_R_SPEC_CV_UNUSED) + ZEND_FETCH_R_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_W_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_W_SPEC_CV_UNUSED) + ZEND_FETCH_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_RW_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_RW_SPEC_CV_UNUSED) + ZEND_FETCH_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED) + ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_UNSET_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_UNSET_SPEC_CV_UNUSED) + ZEND_FETCH_UNSET_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_IS_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_IS_SPEC_CV_UNUSED) + ZEND_FETCH_IS_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_W_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_DIM_W_SPEC_CV_UNUSED) + ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED) + ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST) + ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_TMP) + ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_VAR) + ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CV) + ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNUSED): + VM_TRACE(ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNUSED) + ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_SPEC_CV_UNUSED): + VM_TRACE(ZEND_SEND_VAR_SPEC_CV_UNUSED) + ZEND_SEND_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_REF_SPEC_CV_UNUSED): + VM_TRACE(ZEND_SEND_REF_SPEC_CV_UNUSED) + ZEND_SEND_REF_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_EX_SPEC_CV_UNUSED): + VM_TRACE(ZEND_SEND_VAR_EX_SPEC_CV_UNUSED) + ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_QUICK): + VM_TRACE(ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_QUICK) + ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_QUICK_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED) + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_CV_UNUSED): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_CV_UNUSED) + ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_CV_SPEC_CV_UNUSED): + VM_TRACE(ZEND_UNSET_CV_SPEC_CV_UNUSED) + ZEND_UNSET_CV_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_VAR_SPEC_CV_UNUSED): + VM_TRACE(ZEND_UNSET_VAR_SPEC_CV_UNUSED) + ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_SET): + VM_TRACE(ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_SET) + ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_SET_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_EMPTY): + VM_TRACE(ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_EMPTY) + ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_EMPTY_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED): + VM_TRACE(ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED) + ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INSTANCEOF_SPEC_CV_UNUSED): + VM_TRACE(ZEND_INSTANCEOF_SPEC_CV_UNUSED) + ZEND_INSTANCEOF_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_CV_UNUSED): + VM_TRACE(ZEND_YIELD_SPEC_CV_UNUSED) + ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CHECK_VAR_SPEC_CV_UNUSED): + VM_TRACE(ZEND_CHECK_VAR_SPEC_CV_UNUSED) + ZEND_CHECK_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_MAKE_REF_SPEC_CV_UNUSED): + VM_TRACE(ZEND_MAKE_REF_SPEC_CV_UNUSED) + ZEND_MAKE_REF_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COUNT_SPEC_CV_UNUSED): + VM_TRACE(ZEND_COUNT_SPEC_CV_UNUSED) + ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_COUNT_ARRAY_SPEC_CV_UNUSED): + VM_TRACE(ZEND_COUNT_ARRAY_SPEC_CV_UNUSED) + ZEND_COUNT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_CLASS_SPEC_CV_UNUSED): + VM_TRACE(ZEND_GET_CLASS_SPEC_CV_UNUSED) + ZEND_GET_CLASS_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_GET_TYPE_SPEC_CV_UNUSED): + VM_TRACE(ZEND_GET_TYPE_SPEC_CV_UNUSED) + ZEND_GET_TYPE_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED): + VM_TRACE(ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED) + ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_DIV_SPEC_CV_CV): + VM_TRACE(ZEND_DIV_SPEC_CV_CV) + ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POW_SPEC_CV_CV): + VM_TRACE(ZEND_POW_SPEC_CV_CV) + ZEND_POW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_CONCAT_SPEC_CV_CV): + VM_TRACE(ZEND_CONCAT_SPEC_CV_CV) + ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_SPEC_CV_CV): + VM_TRACE(ZEND_IS_IDENTICAL_SPEC_CV_CV) + ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV) + ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_CV): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_CV) + ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ) + ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ): + VM_TRACE(ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ) + ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_CV): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_CV) + ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ) + ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ): + VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ) + ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_SPACESHIP_SPEC_CV_CV): + VM_TRACE(ZEND_SPACESHIP_SPEC_CV_CV) + ZEND_SPACESHIP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_BOOL_XOR_SPEC_CV_CV): + VM_TRACE(ZEND_BOOL_XOR_SPEC_CV_CV) + ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_OP_SPEC_CV_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_OP_SPEC_CV_CV) + ZEND_ASSIGN_OBJ_OP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_OP_SPEC_CV_CV): + VM_TRACE(ZEND_ASSIGN_DIM_OP_SPEC_CV_CV) + ZEND_ASSIGN_DIM_OP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OP_SPEC_CV_CV): + VM_TRACE(ZEND_ASSIGN_OP_SPEC_CV_CV) + ZEND_ASSIGN_OP_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_PRE_INC_OBJ_SPEC_CV_CV): + VM_TRACE(ZEND_PRE_INC_OBJ_SPEC_CV_CV) + ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_POST_INC_OBJ_SPEC_CV_CV): + VM_TRACE(ZEND_POST_INC_OBJ_SPEC_CV_CV) + ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_R_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_DIM_R_SPEC_CV_CV) + ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_W_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_DIM_W_SPEC_CV_CV) + ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_RW_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_DIM_RW_SPEC_CV_CV) + ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_IS_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_DIM_IS_SPEC_CV_CV) + ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV) + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_DIM_UNSET_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_DIM_UNSET_SPEC_CV_CV) + ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_R_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_OBJ_R_SPEC_CV_CV) + ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_W_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_OBJ_W_SPEC_CV_CV) + ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_RW_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_OBJ_RW_SPEC_CV_CV) + ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_IS_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_OBJ_IS_SPEC_CV_CV) + ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV) + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV): + VM_TRACE(ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV) + ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CONST) + ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_TMP) + ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CV) + ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CONST): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CONST) + ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_TMP): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_TMP) + ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_VAR) + ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CV) + ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_CV_CV_RETVAL_UNUSED): + VM_TRACE(ZEND_ASSIGN_SPEC_CV_CV_RETVAL_UNUSED) + ZEND_ASSIGN_SPEC_CV_CV_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_SPEC_CV_CV_RETVAL_USED): + VM_TRACE(ZEND_ASSIGN_SPEC_CV_CV_RETVAL_USED) + ZEND_ASSIGN_SPEC_CV_CV_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_REF_SPEC_CV_CV): + VM_TRACE(ZEND_ASSIGN_REF_SPEC_CV_CV) + ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_VAR): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_VAR) + ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_CV): + VM_TRACE(ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_CV) + ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_FAST_CONCAT_SPEC_CV_CV): + VM_TRACE(ZEND_FAST_CONCAT_SPEC_CV_CV) + ZEND_FAST_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_METHOD_CALL_SPEC_CV_CV): + VM_TRACE(ZEND_INIT_METHOD_CALL_SPEC_CV_CV) + ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV): + VM_TRACE(ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV) + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_INIT_ARRAY_SPEC_CV_CV): + VM_TRACE(ZEND_INIT_ARRAY_SPEC_CV_CV) + ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_DIM_SPEC_CV_CV): + VM_TRACE(ZEND_UNSET_DIM_SPEC_CV_CV) + ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_UNSET_OBJ_SPEC_CV_CV): + VM_TRACE(ZEND_UNSET_OBJ_SPEC_CV_CV) + ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV): + VM_TRACE(ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV) + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV): + VM_TRACE(ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV) + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CV): + VM_TRACE(ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CV) + ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_YIELD_SPEC_CV_CV): + VM_TRACE(ZEND_YIELD_SPEC_CV_CV) + ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV): + VM_TRACE(ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV) + ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV): + VM_TRACE(ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV) + ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); + HYBRID_CASE(HYBRID_HALT): +#ifdef ZEND_VM_FP_GLOBAL_REG + execute_data = vm_stack_data.orig_execute_data; +#endif +#ifdef ZEND_VM_IP_GLOBAL_REG + opline = vm_stack_data.orig_opline; +#endif + return; + HYBRID_DEFAULT: + VM_TRACE(ZEND_NULL) + ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_BREAK(); /* Never reached */ +#else +#ifdef ZEND_VM_FP_GLOBAL_REG + execute_data = vm_stack_data.orig_execute_data; +# ifdef ZEND_VM_IP_GLOBAL_REG + opline = vm_stack_data.orig_opline; +# endif + return; +#else + if (EXPECTED(ret > 0)) { + execute_data = EG(current_execute_data); + ZEND_VM_LOOP_INTERRUPT_CHECK(); + } else { +# ifdef ZEND_VM_IP_GLOBAL_REG + opline = vm_stack_data.orig_opline; +# endif + return; + } +#endif +#endif + } + + } + zend_error_noreturn(E_CORE_ERROR, "Arrived at end of main loop which shouldn't happen"); +} +#if (ZEND_VM_KIND != ZEND_VM_KIND_CALL) && (ZEND_GCC_VERSION >= 4000) && !defined(__clang__) +# pragma GCC pop_options +#endif + +ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value) +{ + zend_execute_data *execute_data; + void *object_or_called_scope; + uint32_t call_info; + + if (EG(exception) != NULL) { + return; + } + + object_or_called_scope = zend_get_this_object(EG(current_execute_data)); + if (EXPECTED(!object_or_called_scope)) { + object_or_called_scope = zend_get_called_scope(EG(current_execute_data)); + call_info = ZEND_CALL_TOP_CODE | ZEND_CALL_HAS_SYMBOL_TABLE; + } else { + call_info = ZEND_CALL_TOP_CODE | ZEND_CALL_HAS_SYMBOL_TABLE | ZEND_CALL_HAS_THIS; + } + execute_data = zend_vm_stack_push_call_frame(call_info, + (zend_function*)op_array, 0, object_or_called_scope); + if (EG(current_execute_data)) { + execute_data->symbol_table = zend_rebuild_symbol_table(); + } else { + execute_data->symbol_table = &EG(symbol_table); + } + EX(prev_execute_data) = EG(current_execute_data); + i_init_code_execute_data(execute_data, op_array, return_value); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); + zend_execute_ex(execute_data); + /* Observer end handlers are called from ZEND_RETURN */ + zend_vm_stack_free_call_frame(execute_data); +} + + +void zend_vm_init(void) +{ + static const void * const labels[] = { + ZEND_NOP_SPEC_HANDLER, + ZEND_ADD_SPEC_CONST_CONST_HANDLER, + ZEND_ADD_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_ADD_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_SPEC_CONST_CONST_HANDLER, + ZEND_SUB_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SUB_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_DIV_SPEC_CONST_CONST_HANDLER, + ZEND_DIV_SPEC_CONST_TMPVAR_HANDLER, + ZEND_DIV_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_DIV_SPEC_CONST_CV_HANDLER, + ZEND_DIV_SPEC_TMPVAR_CONST_HANDLER, + ZEND_DIV_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_DIV_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_DIV_SPEC_TMPVAR_CV_HANDLER, + ZEND_DIV_SPEC_TMPVAR_CONST_HANDLER, + ZEND_DIV_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_DIV_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_DIV_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_DIV_SPEC_CV_CONST_HANDLER, + ZEND_DIV_SPEC_CV_TMPVAR_HANDLER, + ZEND_DIV_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_DIV_SPEC_CV_CV_HANDLER, + ZEND_MOD_SPEC_CONST_CONST_HANDLER, + ZEND_MOD_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_MOD_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MOD_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MOD_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SL_SPEC_CONST_CONST_HANDLER, + ZEND_SL_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SL_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SL_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SR_SPEC_CONST_CONST_HANDLER, + ZEND_SR_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SR_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SR_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CONCAT_SPEC_CONST_TMPVAR_HANDLER, + ZEND_CONCAT_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CONCAT_SPEC_CONST_CV_HANDLER, + ZEND_CONCAT_SPEC_TMPVAR_CONST_HANDLER, + ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CONCAT_SPEC_TMPVAR_CV_HANDLER, + ZEND_CONCAT_SPEC_TMPVAR_CONST_HANDLER, + ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CONCAT_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CONCAT_SPEC_CV_CONST_HANDLER, + ZEND_CONCAT_SPEC_CV_TMPVAR_HANDLER, + ZEND_CONCAT_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CONCAT_SPEC_CV_CV_HANDLER, + ZEND_BW_OR_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_AND_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_POW_SPEC_CONST_CONST_HANDLER, + ZEND_POW_SPEC_CONST_TMPVAR_HANDLER, + ZEND_POW_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POW_SPEC_CONST_CV_HANDLER, + ZEND_POW_SPEC_TMPVAR_CONST_HANDLER, + ZEND_POW_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_POW_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POW_SPEC_TMPVAR_CV_HANDLER, + ZEND_POW_SPEC_TMPVAR_CONST_HANDLER, + ZEND_POW_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_POW_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POW_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POW_SPEC_CV_CONST_HANDLER, + ZEND_POW_SPEC_CV_TMPVAR_HANDLER, + ZEND_POW_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POW_SPEC_CV_CV_HANDLER, + ZEND_BW_NOT_SPEC_CONST_HANDLER, + ZEND_BW_NOT_SPEC_TMPVARCV_HANDLER, + ZEND_BW_NOT_SPEC_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BW_NOT_SPEC_TMPVARCV_HANDLER, + ZEND_BOOL_NOT_SPEC_CONST_HANDLER, + ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER, + ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BOOL_NOT_SPEC_CV_HANDLER, + ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BOOL_XOR_SPEC_TMPVAR_CONST_HANDLER, + ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BOOL_XOR_SPEC_TMPVAR_CONST_HANDLER, + ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER, + ZEND_BOOL_XOR_SPEC_CV_TMPVAR_HANDLER, + ZEND_BOOL_XOR_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER, + ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER, + ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER, + ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER, + ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER, + ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER, + ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER, + ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ_HANDLER, + ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_UNUSED_HANDLER, + ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_USED_HANDLER, + ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_UNUSED_HANDLER, + ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_USED_HANDLER, + ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_UNUSED_HANDLER, + ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_UNUSED_HANDLER, + ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED_HANDLER, + ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_USED_HANDLER, + ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_UNUSED_HANDLER, + ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_USED_HANDLER, + ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_UNUSED_HANDLER, + ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_SPEC_CV_CV_RETVAL_UNUSED_HANDLER, + ZEND_ASSIGN_SPEC_CV_CV_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CONST_HANDLER, + ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_TMP_HANDLER, + ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OP_SPEC_VAR_CONST_HANDLER, + ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR_HANDLER, + ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OP_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OP_SPEC_CV_CONST_HANDLER, + ZEND_ASSIGN_OP_SPEC_CV_TMPVAR_HANDLER, + ZEND_ASSIGN_OP_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OP_SPEC_CV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_VAR_CONST_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_VAR_UNUSED_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_CV_CONST_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_CV_UNUSED_HANDLER, + ZEND_ASSIGN_DIM_OP_SPEC_CV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CONST_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CV_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CONST_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CV_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_CV_CONST_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_OP_SPEC_CV_CV_HANDLER, + ZEND_ASSIGN_STATIC_PROP_OP_SPEC_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER, + ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, + ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, + ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_QM_ASSIGN_SPEC_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_CV_HANDLER, + ZEND_ASSIGN_STATIC_PROP_REF_SPEC_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_PRE_INC_SPEC_VAR_RETVAL_UNUSED_HANDLER, + ZEND_PRE_INC_SPEC_VAR_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_PRE_INC_SPEC_CV_RETVAL_UNUSED_HANDLER, + ZEND_PRE_INC_SPEC_CV_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_PRE_DEC_SPEC_VAR_RETVAL_UNUSED_HANDLER, + ZEND_PRE_DEC_SPEC_VAR_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_PRE_DEC_SPEC_CV_RETVAL_UNUSED_HANDLER, + ZEND_PRE_DEC_SPEC_CV_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POST_INC_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POST_INC_SPEC_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POST_DEC_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POST_DEC_SPEC_CV_HANDLER, + ZEND_PRE_INC_STATIC_PROP_SPEC_HANDLER, + ZEND_POST_INC_STATIC_PROP_SPEC_HANDLER, + ZEND_JMP_SPEC_HANDLER, + ZEND_JMPZ_SPEC_CONST_HANDLER, + ZEND_JMPZ_SPEC_TMPVAR_HANDLER, + ZEND_JMPZ_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_JMPZ_SPEC_CV_HANDLER, + ZEND_JMPNZ_SPEC_CONST_HANDLER, + ZEND_JMPNZ_SPEC_TMPVAR_HANDLER, + ZEND_JMPNZ_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_JMPNZ_SPEC_CV_HANDLER, + ZEND_JMPZ_EX_SPEC_CONST_HANDLER, + ZEND_JMPZ_EX_SPEC_TMPVAR_HANDLER, + ZEND_JMPZ_EX_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_JMPZ_EX_SPEC_CV_HANDLER, + ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, + ZEND_JMPNZ_EX_SPEC_TMPVAR_HANDLER, + ZEND_JMPNZ_EX_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_JMPNZ_EX_SPEC_CV_HANDLER, + ZEND_CASE_SPEC_TMPVAR_CONST_HANDLER, + ZEND_CASE_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_CASE_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CASE_SPEC_TMPVAR_CV_HANDLER, + ZEND_CHECK_VAR_SPEC_CV_UNUSED_HANDLER, + ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST_HANDLER, + ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_HANDLER, + ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_QUICK_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CAST_SPEC_CONST_HANDLER, + ZEND_CAST_SPEC_TMP_HANDLER, + ZEND_CAST_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CAST_SPEC_CV_HANDLER, + ZEND_BOOL_SPEC_CONST_HANDLER, + ZEND_BOOL_SPEC_TMPVAR_HANDLER, + ZEND_BOOL_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BOOL_SPEC_CV_HANDLER, + ZEND_FAST_CONCAT_SPEC_CONST_CONST_HANDLER, + ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FAST_CONCAT_SPEC_CONST_CV_HANDLER, + ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FAST_CONCAT_SPEC_TMPVAR_CV_HANDLER, + ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FAST_CONCAT_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FAST_CONCAT_SPEC_CV_CONST_HANDLER, + ZEND_FAST_CONCAT_SPEC_CV_TMPVAR_HANDLER, + ZEND_FAST_CONCAT_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FAST_CONCAT_SPEC_CV_CV_HANDLER, + ZEND_ROPE_INIT_SPEC_UNUSED_CONST_HANDLER, + ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ROPE_INIT_SPEC_UNUSED_CV_HANDLER, + ZEND_ROPE_ADD_SPEC_TMP_CONST_HANDLER, + ZEND_ROPE_ADD_SPEC_TMP_TMPVAR_HANDLER, + ZEND_ROPE_ADD_SPEC_TMP_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ROPE_ADD_SPEC_TMP_CV_HANDLER, + ZEND_ROPE_END_SPEC_TMP_CONST_HANDLER, + ZEND_ROPE_END_SPEC_TMP_TMPVAR_HANDLER, + ZEND_ROPE_END_SPEC_TMP_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ROPE_END_SPEC_TMP_CV_HANDLER, + ZEND_BEGIN_SILENCE_SPEC_HANDLER, + ZEND_END_SILENCE_SPEC_TMP_HANDLER, + ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, + ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER, + ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER, + ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER, + ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER, + ZEND_INIT_FCALL_SPEC_CONST_HANDLER, + ZEND_RETURN_SPEC_CONST_HANDLER, + ZEND_RETURN_SPEC_OBSERVER_HANDLER, + ZEND_RETURN_SPEC_TMP_HANDLER, + ZEND_RETURN_SPEC_OBSERVER_HANDLER, + ZEND_RETURN_SPEC_VAR_HANDLER, + ZEND_RETURN_SPEC_OBSERVER_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_RETURN_SPEC_CV_HANDLER, + ZEND_RETURN_SPEC_OBSERVER_HANDLER, + ZEND_RECV_SPEC_UNUSED_HANDLER, + ZEND_RECV_INIT_SPEC_CONST_HANDLER, + ZEND_SEND_VAL_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAL_SPEC_CONST_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAL_SPEC_TMPVAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAL_SPEC_TMPVAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_EX_SPEC_VAR_CONST_HANDLER, + ZEND_SEND_VAR_EX_SPEC_VAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_HANDLER, + ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_QUICK_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_EX_SPEC_CV_CONST_HANDLER, + ZEND_SEND_VAR_EX_SPEC_CV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_HANDLER, + ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_QUICK_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_REF_SPEC_VAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_REF_SPEC_VAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_REF_SPEC_CV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_REF_SPEC_CV_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NEW_SPEC_CONST_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NEW_SPEC_VAR_UNUSED_HANDLER, + ZEND_NEW_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER, + ZEND_FREE_SPEC_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER, + ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER, + ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER, + ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER, + ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER, + ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER, + ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER, + ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER, + ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER, + ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER, + ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER, + ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER, + ZEND_INIT_ARRAY_SPEC_CV_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_CV_TMPVAR_HANDLER, + ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER, + ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER, + ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER, + ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER, + ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER, + ZEND_UNSET_DIM_SPEC_VAR_TMPVAR_HANDLER, + ZEND_UNSET_DIM_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER, + ZEND_UNSET_DIM_SPEC_CV_TMPVAR_HANDLER, + ZEND_UNSET_DIM_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER, + ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HANDLER, + ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER, + ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER, + ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER, + ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER, + ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER, + ZEND_FE_RESET_R_SPEC_CONST_HANDLER, + ZEND_FE_RESET_R_SPEC_TMP_HANDLER, + ZEND_FE_RESET_R_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FE_RESET_R_SPEC_CV_HANDLER, + ZEND_FE_FETCH_R_SPEC_VAR_HANDLER, + ZEND_EXIT_SPEC_HANDLER, + ZEND_FETCH_R_SPEC_CONST_UNUSED_HANDLER, + ZEND_FETCH_R_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_FETCH_R_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_R_SPEC_CV_UNUSED_HANDLER, + ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER, + ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER, + ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_HANDLER, + ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER, + ZEND_FETCH_W_SPEC_CONST_UNUSED_HANDLER, + ZEND_FETCH_W_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_FETCH_W_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_W_SPEC_CV_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER, + ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER, + ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER, + ZEND_FETCH_RW_SPEC_CONST_UNUSED_HANDLER, + ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_RW_SPEC_CV_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER, + ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER, + ZEND_FETCH_IS_SPEC_CONST_UNUSED_HANDLER, + ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_IS_SPEC_CV_UNUSED_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_CONST_CONST_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_CONST_CV_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER, + ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER, + ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER, + ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER, + ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER, + ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_UNSET_SPEC_CV_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER, + ZEND_FETCH_LIST_R_SPEC_CONST_CONST_HANDLER, + ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR_HANDLER, + ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_LIST_R_SPEC_CONST_CV_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV_HANDLER, + ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER, + ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER, + ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_QUICK_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_EXT_STMT_SPEC_HANDLER, + ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, + ZEND_EXT_FCALL_END_SPEC_HANDLER, + ZEND_EXT_NOP_SPEC_HANDLER, + ZEND_TICKS_SPEC_HANDLER, + ZEND_SEND_VAR_NO_REF_SPEC_VAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_NO_REF_SPEC_VAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CATCH_SPEC_CONST_HANDLER, + ZEND_THROW_SPEC_CONST_HANDLER, + ZEND_THROW_SPEC_TMPVAR_HANDLER, + ZEND_THROW_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_THROW_SPEC_CV_HANDLER, + ZEND_FETCH_CLASS_SPEC_UNUSED_CONST_HANDLER, + ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_FETCH_CLASS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_FETCH_CLASS_SPEC_UNUSED_CV_HANDLER, + ZEND_CLONE_SPEC_CONST_HANDLER, + ZEND_CLONE_SPEC_TMPVAR_HANDLER, + ZEND_CLONE_SPEC_TMPVAR_HANDLER, + ZEND_CLONE_SPEC_UNUSED_HANDLER, + ZEND_CLONE_SPEC_CV_HANDLER, + ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER, + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER, + ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER, + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER, + ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER, + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_RETURN_BY_REF_SPEC_CV_HANDLER, + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_CONST_CV_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER, + ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CV_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER, + ZEND_SEND_VAL_EX_SPEC_CONST_CONST_HANDLER, + ZEND_SEND_VAL_EX_SPEC_CONST_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_HANDLER, + ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_QUICK_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAL_EX_SPEC_TMP_CONST_HANDLER, + ZEND_SEND_VAL_EX_SPEC_TMP_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_HANDLER, + ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_QUICK_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_SPEC_VAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_SPEC_VAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_SPEC_CV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_SPEC_CV_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER, + ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_HANDLER, + ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER, + ZEND_SEND_ARRAY_SPEC_HANDLER, + ZEND_SEND_USER_SPEC_CONST_HANDLER, + ZEND_SEND_USER_SPEC_TMP_HANDLER, + ZEND_SEND_USER_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_USER_SPEC_CV_HANDLER, + ZEND_STRLEN_SPEC_CONST_HANDLER, + ZEND_STRLEN_SPEC_TMPVAR_HANDLER, + ZEND_STRLEN_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_STRLEN_SPEC_CV_HANDLER, + ZEND_DEFINED_SPEC_CONST_HANDLER, + ZEND_TYPE_CHECK_SPEC_CONST_HANDLER, + ZEND_TYPE_CHECK_SPEC_TMPVAR_HANDLER, + ZEND_TYPE_CHECK_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_TYPE_CHECK_SPEC_CV_HANDLER, + ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED_HANDLER, + ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UNUSED_HANDLER, + ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED_HANDLER, + ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNUSED_HANDLER, + ZEND_FE_RESET_RW_SPEC_CONST_HANDLER, + ZEND_FE_RESET_RW_SPEC_TMP_HANDLER, + ZEND_FE_RESET_RW_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FE_RESET_RW_SPEC_CV_HANDLER, + ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER, + ZEND_FE_FREE_SPEC_TMPVAR_HANDLER, + ZEND_INIT_DYNAMIC_CALL_SPEC_CONST_HANDLER, + ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_HANDLER, + ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INIT_DYNAMIC_CALL_SPEC_CV_HANDLER, + ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER, + ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER, + ZEND_DO_ICALL_SPEC_OBSERVER_HANDLER, + ZEND_DO_ICALL_SPEC_OBSERVER_HANDLER, + ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_HANDLER, + ZEND_DO_UCALL_SPEC_RETVAL_USED_HANDLER, + ZEND_DO_UCALL_SPEC_OBSERVER_HANDLER, + ZEND_DO_UCALL_SPEC_OBSERVER_HANDLER, + ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_HANDLER, + ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER, + ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER, + ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER, + ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR_HANDLER, + ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER, + ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER, + ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER, + ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER, + ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER, + ZEND_ECHO_SPEC_CONST_HANDLER, + ZEND_ECHO_SPEC_TMPVAR_HANDLER, + ZEND_ECHO_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ECHO_SPEC_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INSTANCEOF_SPEC_TMPVAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INSTANCEOF_SPEC_TMPVAR_VAR_HANDLER, + ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INSTANCEOF_SPEC_TMPVAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INSTANCEOF_SPEC_TMPVAR_VAR_HANDLER, + ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INSTANCEOF_SPEC_CV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_INSTANCEOF_SPEC_CV_VAR_HANDLER, + ZEND_INSTANCEOF_SPEC_CV_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_GENERATOR_CREATE_SPEC_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MAKE_REF_SPEC_VAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MAKE_REF_SPEC_CV_UNUSED_HANDLER, + ZEND_DECLARE_FUNCTION_SPEC_HANDLER, + ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_HANDLER, + ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER, + ZEND_DECLARE_CLASS_SPEC_CONST_HANDLER, + ZEND_DECLARE_CLASS_DELAYED_SPEC_CONST_CONST_HANDLER, + ZEND_DECLARE_ANON_CLASS_SPEC_HANDLER, + ZEND_ADD_ARRAY_UNPACK_SPEC_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER, + ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, + ZEND_USER_OPCODE_SPEC_HANDLER, + ZEND_ASSERT_CHECK_SPEC_HANDLER, + ZEND_JMP_SET_SPEC_CONST_HANDLER, + ZEND_JMP_SET_SPEC_TMP_HANDLER, + ZEND_JMP_SET_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_JMP_SET_SPEC_CV_HANDLER, + ZEND_UNSET_CV_SPEC_CV_UNUSED_HANDLER, + ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_SET_HANDLER, + ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_EMPTY_HANDLER, + ZEND_FETCH_LIST_W_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR_HANDLER, + ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_LIST_W_SPEC_VAR_CV_HANDLER, + ZEND_SEPARATE_SPEC_VAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR_HANDLER, + ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR_HANDLER, + ZEND_FETCH_CLASS_NAME_SPEC_UNUSED_HANDLER, + ZEND_FETCH_CLASS_NAME_SPEC_CV_HANDLER, + ZEND_CALL_TRAMPOLINE_SPEC_HANDLER, + ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_YIELD_SPEC_CONST_CONST_HANDLER, + ZEND_YIELD_SPEC_CONST_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_CONST_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER, + ZEND_YIELD_SPEC_CONST_CV_HANDLER, + ZEND_YIELD_SPEC_TMP_CONST_HANDLER, + ZEND_YIELD_SPEC_TMP_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_TMP_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER, + ZEND_YIELD_SPEC_TMP_CV_HANDLER, + ZEND_YIELD_SPEC_VAR_CONST_HANDLER, + ZEND_YIELD_SPEC_VAR_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_VAR_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER, + ZEND_YIELD_SPEC_VAR_CV_HANDLER, + ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER, + ZEND_YIELD_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_UNUSED_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_YIELD_SPEC_UNUSED_CV_HANDLER, + ZEND_YIELD_SPEC_CV_CONST_HANDLER, + ZEND_YIELD_SPEC_CV_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_CV_TMPVAR_HANDLER, + ZEND_YIELD_SPEC_CV_UNUSED_HANDLER, + ZEND_YIELD_SPEC_CV_CV_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_CONST_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_TMP_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_VAR_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_CV_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_UNUSED_HANDLER, + ZEND_SEND_UNPACK_SPEC_HANDLER, + ZEND_YIELD_FROM_SPEC_CONST_HANDLER, + ZEND_YIELD_FROM_SPEC_TMPVAR_HANDLER, + ZEND_YIELD_FROM_SPEC_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_YIELD_FROM_SPEC_CV_HANDLER, + ZEND_COPY_TMP_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_BIND_GLOBAL_SPEC_CV_CONST_HANDLER, + ZEND_COALESCE_SPEC_CONST_HANDLER, + ZEND_COALESCE_SPEC_TMP_HANDLER, + ZEND_COALESCE_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_COALESCE_SPEC_CV_HANDLER, + ZEND_SPACESHIP_SPEC_CONST_CONST_HANDLER, + ZEND_SPACESHIP_SPEC_CONST_TMPVAR_HANDLER, + ZEND_SPACESHIP_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SPACESHIP_SPEC_CONST_CV_HANDLER, + ZEND_SPACESHIP_SPEC_TMPVAR_CONST_HANDLER, + ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SPACESHIP_SPEC_TMPVAR_CV_HANDLER, + ZEND_SPACESHIP_SPEC_TMPVAR_CONST_HANDLER, + ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SPACESHIP_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SPACESHIP_SPEC_CV_CONST_HANDLER, + ZEND_SPACESHIP_SPEC_CV_TMPVAR_HANDLER, + ZEND_SPACESHIP_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SPACESHIP_SPEC_CV_CV_HANDLER, + ZEND_FUNC_NUM_ARGS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_STATIC_PROP_R_SPEC_HANDLER, + ZEND_FETCH_STATIC_PROP_W_SPEC_HANDLER, + ZEND_FETCH_STATIC_PROP_RW_SPEC_HANDLER, + ZEND_FETCH_STATIC_PROP_IS_SPEC_HANDLER, + ZEND_FETCH_STATIC_PROP_FUNC_ARG_SPEC_HANDLER, + ZEND_FETCH_STATIC_PROP_UNSET_SPEC_HANDLER, + ZEND_UNSET_STATIC_PROP_SPEC_HANDLER, + ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_CONST_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_CONST_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_BIND_LEXICAL_SPEC_TMP_CV_HANDLER, + ZEND_BIND_STATIC_SPEC_CV_HANDLER, + ZEND_FETCH_THIS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_SEND_FUNC_ARG_SPEC_VAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ISSET_ISEMPTY_THIS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_SWITCH_LONG_SPEC_CONST_CONST_HANDLER, + ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SWITCH_STRING_SPEC_CONST_CONST_HANDLER, + ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IN_ARRAY_SPEC_CONST_CONST_HANDLER, + ZEND_IN_ARRAY_SPEC_TMP_CONST_HANDLER, + ZEND_IN_ARRAY_SPEC_VAR_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IN_ARRAY_SPEC_CV_CONST_HANDLER, + ZEND_COUNT_SPEC_CONST_UNUSED_HANDLER, + ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_COUNT_SPEC_CV_UNUSED_HANDLER, + ZEND_GET_CLASS_SPEC_CONST_UNUSED_HANDLER, + ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_GET_CLASS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_GET_CLASS_SPEC_CV_UNUSED_HANDLER, + ZEND_GET_CALLED_CLASS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_GET_TYPE_SPEC_CONST_UNUSED_HANDLER, + ZEND_GET_TYPE_SPEC_TMP_UNUSED_HANDLER, + ZEND_GET_TYPE_SPEC_VAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_GET_TYPE_SPEC_CV_UNUSED_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CONST_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CV_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CONST_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CV_HANDLER, + ZEND_MATCH_SPEC_CONST_CONST_HANDLER, + ZEND_MATCH_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MATCH_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MATCH_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CASE_STRICT_SPEC_TMP_CONST_HANDLER, + ZEND_CASE_STRICT_SPEC_TMP_TMP_HANDLER, + ZEND_CASE_STRICT_SPEC_TMP_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CASE_STRICT_SPEC_TMP_CV_HANDLER, + ZEND_CASE_STRICT_SPEC_VAR_CONST_HANDLER, + ZEND_CASE_STRICT_SPEC_VAR_TMP_HANDLER, + ZEND_CASE_STRICT_SPEC_VAR_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CASE_STRICT_SPEC_VAR_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MATCH_ERROR_SPEC_CONST_UNUSED_HANDLER, + ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED_HANDLER, + ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED_HANDLER, + ZEND_JMP_NULL_SPEC_CONST_HANDLER, + ZEND_JMP_NULL_SPEC_TMP_HANDLER, + ZEND_JMP_NULL_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_JMP_NULL_SPEC_CV_HANDLER, + ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_FETCH_GLOBALS_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_VERIFY_NEVER_TYPE_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV_HANDLER, + ZEND_RECV_NOTYPE_SPEC_HANDLER, + ZEND_NULL_HANDLER, + ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_COUNT_ARRAY_SPEC_CV_UNUSED_HANDLER, + ZEND_JMP_FORWARD_SPEC_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SUB_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV_HANDLER, + ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER, + ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER, + ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED_HANDLER, + ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED_HANDLER, + ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED_HANDLER, + ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED_HANDLER, + ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED_HANDLER, + ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED_HANDLER, + ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED_HANDLER, + ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED_HANDLER, + ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV_HANDLER, + ZEND_POST_INC_LONG_SPEC_CV_HANDLER, + ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV_HANDLER, + ZEND_POST_DEC_LONG_SPEC_CV_HANDLER, + ZEND_QM_ASSIGN_LONG_SPEC_CONST_HANDLER, + ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_HANDLER, + ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV_HANDLER, + ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST_HANDLER, + ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV_HANDLER, + ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV_HANDLER, + ZEND_QM_ASSIGN_NOREF_SPEC_CONST_HANDLER, + ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV_HANDLER, + ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_SIMPLE_SPEC_VAR_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_SIMPLE_SPEC_CV_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED_HANDLER, + ZEND_SEND_VAL_SIMPLE_SPEC_CONST_HANDLER, + ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST_HANDLER, + ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED_HANDLER, + ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED_HANDLER, + ZEND_NULL_HANDLER + }; + static const uint32_t specs[] = { + 0, + 1 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 26 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 51 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE, + 76 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 101 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 126 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 151 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 176 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 201 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE, + 226 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE, + 251 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE, + 276 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 301 | SPEC_RULE_OP1, + 306 | SPEC_RULE_OP1, + 311 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE, + 336 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE, + 361 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE, + 386 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE, + 461 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE, + 536 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH, + 611 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH, + 686 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_RETVAL, + 736 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_OP_DATA, + 861 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_OP_DATA, + 986 | SPEC_RULE_OP_DATA, + 991 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1016 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1041 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1066, + 1067 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1092 | SPEC_RULE_OP1, + 1097 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_OP_DATA, + 1222, + 1223 | SPEC_RULE_OP1 | SPEC_RULE_RETVAL, + 1233 | SPEC_RULE_OP1 | SPEC_RULE_RETVAL, + 1243 | SPEC_RULE_OP1, + 1248 | SPEC_RULE_OP1, + 1253, + 1253, + 1254, + 1254, + 1255, + 1256 | SPEC_RULE_OP1, + 1261 | SPEC_RULE_OP1, + 3476, + 1266 | SPEC_RULE_OP1, + 1271 | SPEC_RULE_OP1, + 1276 | SPEC_RULE_OP2, + 1281, + 1282 | SPEC_RULE_OP2 | SPEC_RULE_QUICK_ARG, + 1292 | SPEC_RULE_OP1, + 1297 | SPEC_RULE_OP1, + 1302 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1327 | SPEC_RULE_OP2, + 1332 | SPEC_RULE_OP2, + 1337 | SPEC_RULE_OP2, + 1342, + 1343, + 1344, + 1345 | SPEC_RULE_RETVAL | SPEC_RULE_OBSERVER, + 1349, + 1350 | SPEC_RULE_OP1 | SPEC_RULE_OBSERVER, + 1360, + 1361, + 1362 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1387 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_QUICK_ARG, + 1437 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1462 | SPEC_RULE_OP1, + 1467, + 1468, + 1469 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1494 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1519 | SPEC_RULE_OP1 | SPEC_RULE_OBSERVER, + 1529 | SPEC_RULE_OP1, + 1534 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1559 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1584 | SPEC_RULE_OP1, + 1589, + 1590, + 1591 | SPEC_RULE_OP1, + 1596 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1621 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1646 | SPEC_RULE_OP1, + 1651 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1676 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1701 | SPEC_RULE_OP1, + 1706 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1731 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1756 | SPEC_RULE_OP1, + 1761 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1786 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1811 | SPEC_RULE_OP1, + 1816 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1841 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1866 | SPEC_RULE_OP1, + 1871 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1896 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1921 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 1946, + 1947 | SPEC_RULE_OP2 | SPEC_RULE_QUICK_ARG, + 1957, + 1958, + 1959, + 1960, + 1961, + 1962 | SPEC_RULE_OP2, + 1967, + 1968 | SPEC_RULE_OP1, + 1973 | SPEC_RULE_OP2, + 1978 | SPEC_RULE_OP1, + 1983 | SPEC_RULE_OP1 | SPEC_RULE_OBSERVER, + 1993 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2018 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2043 | SPEC_RULE_OP1, + 2048 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2073 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_QUICK_ARG, + 2123 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2148 | SPEC_RULE_OP2, + 2153, + 2154 | SPEC_RULE_OP1, + 2159 | SPEC_RULE_OP1, + 2164, + 2165 | SPEC_RULE_OP1, + 2170 | SPEC_RULE_OP1, + 2175 | SPEC_RULE_OP1, + 2180, + 2181, + 2182 | SPEC_RULE_OP2, + 2187 | SPEC_RULE_RETVAL | SPEC_RULE_OBSERVER, + 2191 | SPEC_RULE_RETVAL | SPEC_RULE_OBSERVER, + 2195 | SPEC_RULE_RETVAL | SPEC_RULE_OBSERVER, + 2199 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2199 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2224 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2224 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2249 | SPEC_RULE_OP1, + 2254, + 2255 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2280, + 2281 | SPEC_RULE_OP1, + 2286, + 2287, + 2288, + 2289, + 2290, + 2291, + 2292, + 2293 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2318, + 2319, + 2320, + 2321 | SPEC_RULE_OP1, + 2326, + 2327 | SPEC_RULE_ISSET, + 2329 | SPEC_RULE_OP2, + 2334, + 2335 | SPEC_RULE_OP1, + 2340 | SPEC_RULE_OBSERVER, + 2342, + 2343 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2368 | SPEC_RULE_OP1 | SPEC_RULE_OBSERVER, + 2378, + 2379, + 2380, + 2381, + 2382 | SPEC_RULE_OP1, + 2387, + 2388, + 2389 | SPEC_RULE_OP1, + 2394 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2419, + 2420 | SPEC_RULE_OP1, + 2425, + 2426, + 2427, + 2428, + 2429, + 2430, + 2431, + 2432, + 2433 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2458, + 2459, + 2460, + 2461 | SPEC_RULE_OP2, + 2466, + 2467 | SPEC_RULE_OP1, + 2472 | SPEC_RULE_OP1, + 2477 | SPEC_RULE_OP1, + 2482 | SPEC_RULE_OP1, + 2487 | SPEC_RULE_OP1, + 2492, + 2493 | SPEC_RULE_OP1, + 2498 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2523 | SPEC_RULE_OP1, + 2528 | SPEC_RULE_OP1 | SPEC_RULE_OP2, + 2553 | SPEC_RULE_OP1, + 2558 | SPEC_RULE_OP1, + 2563, + 2564, + 2565, + 2566, + 2567, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + 3476, + }; +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) + zend_opcode_handler_funcs = labels; + zend_spec_handlers = specs; + execute_ex(NULL); +#else + zend_opcode_handlers = labels; + zend_handlers_count = sizeof(labels) / sizeof(void*); + zend_spec_handlers = specs; +#endif + VM_TRACE_START(); +} + +static HashTable *zend_handlers_table = NULL; + +void zend_vm_dtor(void) +{ + VM_TRACE_END(); + if (zend_handlers_table) { + zend_hash_destroy(zend_handlers_table); + free(zend_handlers_table); + zend_handlers_table = NULL; + } +} + +static void init_opcode_serialiser(void) +{ + int i; + zval tmp; + + zend_handlers_table = malloc(sizeof(HashTable)); + zend_hash_init(zend_handlers_table, zend_handlers_count, NULL, NULL, 1); + zend_hash_real_init(zend_handlers_table, 0); + Z_TYPE_INFO(tmp) = IS_LONG; + for (i = 0; i < zend_handlers_count; i++) { + Z_LVAL(tmp) = i; + zend_hash_index_add(zend_handlers_table, (zend_long)(uintptr_t)zend_opcode_handlers[i], &tmp); + } +} + +ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op) +{ + zval *zv; + + if (!zend_handlers_table) { + init_opcode_serialiser(); + } + zv = zend_hash_index_find(zend_handlers_table, (zend_long)(uintptr_t)op->handler); + ZEND_ASSERT(zv != NULL); + op->handler = (const void *)(uintptr_t)Z_LVAL_P(zv); +} + +ZEND_API void ZEND_FASTCALL zend_deserialize_opcode_handler(zend_op *op) +{ + op->handler = zend_opcode_handlers[(uintptr_t)op->handler]; +} + +ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *op) +{ +#if ZEND_VM_KIND == ZEND_VM_KIND_CALL + return op->handler; +#elif ZEND_VM_KIND == ZEND_VM_KIND_HYBRID + zval *zv; + + if (!zend_handlers_table) { + init_opcode_serialiser(); + } + zv = zend_hash_index_find(zend_handlers_table, (zend_long)(uintptr_t)op->handler); + ZEND_ASSERT(zv != NULL); + return zend_opcode_handler_funcs[Z_LVAL_P(zv)]; +#else + return NULL; +#endif +} + +ZEND_API const zend_op *zend_get_halt_op(void) +{ +#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID + return &hybrid_halt_op; +#else + return NULL; +#endif +} + +ZEND_API int zend_vm_kind(void) +{ + return ZEND_VM_KIND; +} + +static uint32_t ZEND_FASTCALL zend_vm_get_opcode_handler_idx(uint32_t spec, const zend_op* op) +{ + static const int zend_vm_decode[] = { + _UNUSED_CODE, /* 0 = IS_UNUSED */ + _CONST_CODE, /* 1 = IS_CONST */ + _TMP_CODE, /* 2 = IS_TMP_VAR */ + _UNUSED_CODE, /* 3 */ + _VAR_CODE, /* 4 = IS_VAR */ + _UNUSED_CODE, /* 5 */ + _UNUSED_CODE, /* 6 */ + _UNUSED_CODE, /* 7 */ + _CV_CODE /* 8 = IS_CV */ + }; + uint32_t offset = 0; + if (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type]; + if (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type]; + if (spec & SPEC_EXTRA_MASK) { + if (spec & SPEC_RULE_RETVAL) { + offset = offset * 2 + (op->result_type != IS_UNUSED); + if ((spec & SPEC_RULE_OBSERVER) && ZEND_OBSERVER_ENABLED) { + offset += 2; + } + } else if (spec & SPEC_RULE_QUICK_ARG) { + offset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM); + } else if (spec & SPEC_RULE_OP_DATA) { + offset = offset * 5 + zend_vm_decode[(op + 1)->op1_type]; + } else if (spec & SPEC_RULE_ISSET) { + offset = offset * 2 + (op->extended_value & ZEND_ISEMPTY); + } else if (spec & SPEC_RULE_SMART_BRANCH) { + offset = offset * 3; + if (op->result_type == (IS_SMART_BRANCH_JMPZ|IS_TMP_VAR)) { + offset += 1; + } else if (op->result_type == (IS_SMART_BRANCH_JMPNZ|IS_TMP_VAR)) { + offset += 2; + } + } else if (spec & SPEC_RULE_OBSERVER) { + offset = offset * 2; + if (ZEND_OBSERVER_ENABLED) { + offset += 1; + } + } + } + return (spec & SPEC_START_MASK) + offset; +} + +#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC +static const void *zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op) +{ + return zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], op)]; +} +#endif + +#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID +static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op* op) +{ + uint32_t spec = zend_spec_handlers[opcode]; + return zend_opcode_handler_funcs[zend_vm_get_opcode_handler_idx(spec, op)]; +} + +#endif + +ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op) +{ + uint8_t opcode = zend_user_opcodes[op->opcode]; + + if (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) { + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + } + op->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], op)]; +} + +ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_info, uint32_t res_info) +{ + uint8_t opcode = zend_user_opcodes[op->opcode]; + uint32_t spec = zend_spec_handlers[opcode]; + switch (opcode) { + case ZEND_ADD: + if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2575 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + } else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2600 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2625 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + } + break; + case ZEND_SUB: + if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2650 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + } else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2675 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2700 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + } + break; + case ZEND_MUL: + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2725 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + } else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2750 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2775 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + } + break; + case ZEND_IS_IDENTICAL: + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2800 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2875 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + } else if (op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF))) { + spec = 3100 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + } + break; + case ZEND_IS_NOT_IDENTICAL: + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2950 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 3025 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + } else if (op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF))) { + spec = 3105 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + } + break; + case ZEND_IS_EQUAL: + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2800 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2875 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + } + break; + case ZEND_IS_NOT_EQUAL: + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 2950 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 3025 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + } + break; + case ZEND_IS_SMALLER: + if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 3110 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 3185 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + } + break; + case ZEND_IS_SMALLER_OR_EQUAL: + if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 3260 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 3335 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + } + break; + case ZEND_QM_ASSIGN: + if (op1_info == MAY_BE_LONG) { + spec = 3422 | SPEC_RULE_OP1; + } else if (op1_info == MAY_BE_DOUBLE) { + spec = 3427 | SPEC_RULE_OP1; + } else if ((op->op1_type == IS_CONST) ? !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1)) : (!(op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE))))) { + spec = 3432 | SPEC_RULE_OP1; + } + break; + case ZEND_PRE_INC: + if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { + spec = 3410 | SPEC_RULE_RETVAL; + } else if (op1_info == MAY_BE_LONG) { + spec = 3412 | SPEC_RULE_RETVAL; + } + break; + case ZEND_PRE_DEC: + if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { + spec = 3414 | SPEC_RULE_RETVAL; + } else if (op1_info == MAY_BE_LONG) { + spec = 3416 | SPEC_RULE_RETVAL; + } + break; + case ZEND_POST_INC: + if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { + spec = 3418; + } else if (op1_info == MAY_BE_LONG) { + spec = 3419; + } + break; + case ZEND_POST_DEC: + if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { + spec = 3420; + } else if (op1_info == MAY_BE_LONG) { + spec = 3421; + } + break; + case ZEND_JMP: + if (OP_JMP_ADDR(op, op->op1) > op) { + spec = 2574; + } + break; + case ZEND_RECV: + if (op->op2.num == MAY_BE_ANY) { + spec = 2568; + } + break; + case ZEND_SEND_VAL: + if (op->op1_type == IS_CONST && op->op2_type == IS_UNUSED && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1))) { + spec = 3472; + } + break; + case ZEND_SEND_VAR_EX: + if (op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) { + spec = 3467 | SPEC_RULE_OP1; + } + break; + case ZEND_FE_FETCH_R: + if (op->op2_type == IS_CV && (op1_info & (MAY_BE_ANY|MAY_BE_REF)) == MAY_BE_ARRAY) { + spec = 3474 | SPEC_RULE_RETVAL; + } + break; + case ZEND_FETCH_DIM_R: + if (!(op2_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))) { + if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { + break; + } + spec = 3437 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + } + break; + case ZEND_SEND_VAL_EX: + if (op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && op->op1_type == IS_CONST && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1))) { + spec = 3473; + } + break; + case ZEND_SEND_VAR: + if (op->op2_type == IS_UNUSED && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) { + spec = 3462 | SPEC_RULE_OP1; + } + break; + case ZEND_COUNT: + if ((op1_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == MAY_BE_ARRAY) { + spec = 2569 | SPEC_RULE_OP1; + } + break; + case ZEND_BW_OR: + case ZEND_BW_AND: + case ZEND_BW_XOR: + case ZEND_BOOL_XOR: + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + break; + case ZEND_USER_OPCODE: + if (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) { + if (op->op1_type < op->op2_type) { + zend_swap_operands(op); + } + } + break; + default: + break; + } + op->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(spec, op)]; +} + +ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex) +{ +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) + opcode_handler_t handler; +#endif + int ret; +#ifdef ZEND_VM_IP_GLOBAL_REG + const zend_op *orig_opline = opline; +#endif +#ifdef ZEND_VM_FP_GLOBAL_REG + zend_execute_data *orig_execute_data = execute_data; + execute_data = ex; +#else + zend_execute_data *execute_data = ex; +#endif + + LOAD_OPLINE(); +#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG) +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) + handler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->opcode], opline); + handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + if (EXPECTED(opline != &hybrid_halt_op)) { +#else + ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + if (EXPECTED(opline)) { +#endif + ret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0; + SAVE_OPLINE(); + } else { + ret = -1; + } +#else + ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + SAVE_OPLINE(); +#endif +#ifdef ZEND_VM_FP_GLOBAL_REG + execute_data = orig_execute_data; +#endif +#ifdef ZEND_VM_IP_GLOBAL_REG + opline = orig_opline; +#endif + return ret; +} + diff --git a/include/php/Zend/zend_vm_handlers.h b/include/php/Zend/zend_vm_handlers.h new file mode 100644 index 0000000..400b5c6 --- /dev/null +++ b/include/php/Zend/zend_vm_handlers.h @@ -0,0 +1,1863 @@ +#define VM_HANDLERS(_) \ + _(0, ZEND_NOP_SPEC) \ + _(1, ZEND_ADD_SPEC_CONST_CONST) \ + _(2, ZEND_ADD_SPEC_CONST_TMPVARCV) \ + _(3, ZEND_ADD_SPEC_CONST_TMPVARCV) \ + _(5, ZEND_ADD_SPEC_CONST_TMPVARCV) \ + _(6, ZEND_ADD_SPEC_TMPVARCV_CONST) \ + _(7, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(8, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(10, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(11, ZEND_ADD_SPEC_TMPVARCV_CONST) \ + _(12, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(13, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(15, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(21, ZEND_ADD_SPEC_TMPVARCV_CONST) \ + _(22, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(23, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(25, ZEND_ADD_SPEC_TMPVARCV_TMPVARCV) \ + _(26, ZEND_SUB_SPEC_CONST_CONST) \ + _(27, ZEND_SUB_SPEC_CONST_TMPVARCV) \ + _(28, ZEND_SUB_SPEC_CONST_TMPVARCV) \ + _(30, ZEND_SUB_SPEC_CONST_TMPVARCV) \ + _(31, ZEND_SUB_SPEC_TMPVARCV_CONST) \ + _(32, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(33, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(35, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(36, ZEND_SUB_SPEC_TMPVARCV_CONST) \ + _(37, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(38, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(40, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(46, ZEND_SUB_SPEC_TMPVARCV_CONST) \ + _(47, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(48, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(50, ZEND_SUB_SPEC_TMPVARCV_TMPVARCV) \ + _(51, ZEND_MUL_SPEC_CONST_CONST) \ + _(56, ZEND_MUL_SPEC_TMPVARCV_CONST) \ + _(57, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(58, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(60, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(61, ZEND_MUL_SPEC_TMPVARCV_CONST) \ + _(62, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(63, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(65, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(71, ZEND_MUL_SPEC_TMPVARCV_CONST) \ + _(72, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(73, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(75, ZEND_MUL_SPEC_TMPVARCV_TMPVARCV) \ + _(76, ZEND_DIV_SPEC_CONST_CONST) \ + _(77, ZEND_DIV_SPEC_CONST_TMPVAR) \ + _(78, ZEND_DIV_SPEC_CONST_TMPVAR) \ + _(80, ZEND_DIV_SPEC_CONST_CV) \ + _(81, ZEND_DIV_SPEC_TMPVAR_CONST) \ + _(82, ZEND_DIV_SPEC_TMPVAR_TMPVAR) \ + _(83, ZEND_DIV_SPEC_TMPVAR_TMPVAR) \ + _(85, ZEND_DIV_SPEC_TMPVAR_CV) \ + _(86, ZEND_DIV_SPEC_TMPVAR_CONST) \ + _(87, ZEND_DIV_SPEC_TMPVAR_TMPVAR) \ + _(88, ZEND_DIV_SPEC_TMPVAR_TMPVAR) \ + _(90, ZEND_DIV_SPEC_TMPVAR_CV) \ + _(96, ZEND_DIV_SPEC_CV_CONST) \ + _(97, ZEND_DIV_SPEC_CV_TMPVAR) \ + _(98, ZEND_DIV_SPEC_CV_TMPVAR) \ + _(100, ZEND_DIV_SPEC_CV_CV) \ + _(101, ZEND_MOD_SPEC_CONST_CONST) \ + _(102, ZEND_MOD_SPEC_CONST_TMPVARCV) \ + _(103, ZEND_MOD_SPEC_CONST_TMPVARCV) \ + _(105, ZEND_MOD_SPEC_CONST_TMPVARCV) \ + _(106, ZEND_MOD_SPEC_TMPVARCV_CONST) \ + _(107, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(108, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(110, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(111, ZEND_MOD_SPEC_TMPVARCV_CONST) \ + _(112, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(113, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(115, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(121, ZEND_MOD_SPEC_TMPVARCV_CONST) \ + _(122, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(123, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(125, ZEND_MOD_SPEC_TMPVARCV_TMPVARCV) \ + _(126, ZEND_SL_SPEC_CONST_CONST) \ + _(127, ZEND_SL_SPEC_CONST_TMPVARCV) \ + _(128, ZEND_SL_SPEC_CONST_TMPVARCV) \ + _(130, ZEND_SL_SPEC_CONST_TMPVARCV) \ + _(131, ZEND_SL_SPEC_TMPVARCV_CONST) \ + _(132, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(133, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(135, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(136, ZEND_SL_SPEC_TMPVARCV_CONST) \ + _(137, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(138, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(140, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(146, ZEND_SL_SPEC_TMPVARCV_CONST) \ + _(147, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(148, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(150, ZEND_SL_SPEC_TMPVARCV_TMPVARCV) \ + _(151, ZEND_SR_SPEC_CONST_CONST) \ + _(152, ZEND_SR_SPEC_CONST_TMPVARCV) \ + _(153, ZEND_SR_SPEC_CONST_TMPVARCV) \ + _(155, ZEND_SR_SPEC_CONST_TMPVARCV) \ + _(156, ZEND_SR_SPEC_TMPVARCV_CONST) \ + _(157, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(158, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(160, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(161, ZEND_SR_SPEC_TMPVARCV_CONST) \ + _(162, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(163, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(165, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(171, ZEND_SR_SPEC_TMPVARCV_CONST) \ + _(172, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(173, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(175, ZEND_SR_SPEC_TMPVARCV_TMPVARCV) \ + _(177, ZEND_CONCAT_SPEC_CONST_TMPVAR) \ + _(178, ZEND_CONCAT_SPEC_CONST_TMPVAR) \ + _(180, ZEND_CONCAT_SPEC_CONST_CV) \ + _(181, ZEND_CONCAT_SPEC_TMPVAR_CONST) \ + _(182, ZEND_CONCAT_SPEC_TMPVAR_TMPVAR) \ + _(183, ZEND_CONCAT_SPEC_TMPVAR_TMPVAR) \ + _(185, ZEND_CONCAT_SPEC_TMPVAR_CV) \ + _(186, ZEND_CONCAT_SPEC_TMPVAR_CONST) \ + _(187, ZEND_CONCAT_SPEC_TMPVAR_TMPVAR) \ + _(188, ZEND_CONCAT_SPEC_TMPVAR_TMPVAR) \ + _(190, ZEND_CONCAT_SPEC_TMPVAR_CV) \ + _(196, ZEND_CONCAT_SPEC_CV_CONST) \ + _(197, ZEND_CONCAT_SPEC_CV_TMPVAR) \ + _(198, ZEND_CONCAT_SPEC_CV_TMPVAR) \ + _(200, ZEND_CONCAT_SPEC_CV_CV) \ + _(201, ZEND_BW_OR_SPEC_CONST_CONST) \ + _(206, ZEND_BW_OR_SPEC_TMPVARCV_CONST) \ + _(207, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(208, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(210, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(211, ZEND_BW_OR_SPEC_TMPVARCV_CONST) \ + _(212, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(213, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(215, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(221, ZEND_BW_OR_SPEC_TMPVARCV_CONST) \ + _(222, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(223, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(225, ZEND_BW_OR_SPEC_TMPVARCV_TMPVARCV) \ + _(226, ZEND_BW_AND_SPEC_CONST_CONST) \ + _(231, ZEND_BW_AND_SPEC_TMPVARCV_CONST) \ + _(232, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(233, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(235, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(236, ZEND_BW_AND_SPEC_TMPVARCV_CONST) \ + _(237, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(238, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(240, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(246, ZEND_BW_AND_SPEC_TMPVARCV_CONST) \ + _(247, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(248, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(250, ZEND_BW_AND_SPEC_TMPVARCV_TMPVARCV) \ + _(251, ZEND_BW_XOR_SPEC_CONST_CONST) \ + _(256, ZEND_BW_XOR_SPEC_TMPVARCV_CONST) \ + _(257, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(258, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(260, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(261, ZEND_BW_XOR_SPEC_TMPVARCV_CONST) \ + _(262, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(263, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(265, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(271, ZEND_BW_XOR_SPEC_TMPVARCV_CONST) \ + _(272, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(273, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(275, ZEND_BW_XOR_SPEC_TMPVARCV_TMPVARCV) \ + _(276, ZEND_POW_SPEC_CONST_CONST) \ + _(277, ZEND_POW_SPEC_CONST_TMPVAR) \ + _(278, ZEND_POW_SPEC_CONST_TMPVAR) \ + _(280, ZEND_POW_SPEC_CONST_CV) \ + _(281, ZEND_POW_SPEC_TMPVAR_CONST) \ + _(282, ZEND_POW_SPEC_TMPVAR_TMPVAR) \ + _(283, ZEND_POW_SPEC_TMPVAR_TMPVAR) \ + _(285, ZEND_POW_SPEC_TMPVAR_CV) \ + _(286, ZEND_POW_SPEC_TMPVAR_CONST) \ + _(287, ZEND_POW_SPEC_TMPVAR_TMPVAR) \ + _(288, ZEND_POW_SPEC_TMPVAR_TMPVAR) \ + _(290, ZEND_POW_SPEC_TMPVAR_CV) \ + _(296, ZEND_POW_SPEC_CV_CONST) \ + _(297, ZEND_POW_SPEC_CV_TMPVAR) \ + _(298, ZEND_POW_SPEC_CV_TMPVAR) \ + _(300, ZEND_POW_SPEC_CV_CV) \ + _(301, ZEND_BW_NOT_SPEC_CONST) \ + _(302, ZEND_BW_NOT_SPEC_TMPVARCV) \ + _(303, ZEND_BW_NOT_SPEC_TMPVARCV) \ + _(305, ZEND_BW_NOT_SPEC_TMPVARCV) \ + _(306, ZEND_BOOL_NOT_SPEC_CONST) \ + _(307, ZEND_BOOL_NOT_SPEC_TMPVAR) \ + _(308, ZEND_BOOL_NOT_SPEC_TMPVAR) \ + _(310, ZEND_BOOL_NOT_SPEC_CV) \ + _(311, ZEND_BOOL_XOR_SPEC_CONST_CONST) \ + _(316, ZEND_BOOL_XOR_SPEC_TMPVAR_CONST) \ + _(317, ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR) \ + _(318, ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR) \ + _(321, ZEND_BOOL_XOR_SPEC_TMPVAR_CONST) \ + _(322, ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR) \ + _(323, ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR) \ + _(331, ZEND_BOOL_XOR_SPEC_CV_CONST) \ + _(332, ZEND_BOOL_XOR_SPEC_CV_TMPVAR) \ + _(333, ZEND_BOOL_XOR_SPEC_CV_TMPVAR) \ + _(335, ZEND_BOOL_XOR_SPEC_CV_CV) \ + _(336, ZEND_IS_IDENTICAL_SPEC_CONST_CONST) \ + _(341, ZEND_IS_IDENTICAL_SPEC_TMP_CONST) \ + _(342, ZEND_IS_IDENTICAL_SPEC_TMP_TMP) \ + _(346, ZEND_IS_IDENTICAL_SPEC_VAR_CONST) \ + _(347, ZEND_IS_IDENTICAL_SPEC_VAR_TMP) \ + _(348, ZEND_IS_IDENTICAL_SPEC_VAR_VAR) \ + _(356, ZEND_IS_IDENTICAL_SPEC_CV_CONST) \ + _(357, ZEND_IS_IDENTICAL_SPEC_CV_TMP) \ + _(358, ZEND_IS_IDENTICAL_SPEC_CV_VAR) \ + _(360, ZEND_IS_IDENTICAL_SPEC_CV_CV) \ + _(361, ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST) \ + _(366, ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST) \ + _(367, ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP) \ + _(371, ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST) \ + _(372, ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP) \ + _(373, ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR) \ + _(381, ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST) \ + _(382, ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP) \ + _(383, ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR) \ + _(385, ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV) \ + _(386, ZEND_IS_EQUAL_SPEC_CONST_CONST) \ + _(387, ZEND_IS_EQUAL_SPEC_CONST_CONST) \ + _(388, ZEND_IS_EQUAL_SPEC_CONST_CONST) \ + _(401, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST) \ + _(402, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ) \ + _(403, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ) \ + _(404, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR) \ + _(405, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) \ + _(406, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) \ + _(407, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR) \ + _(408, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) \ + _(409, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) \ + _(416, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST) \ + _(417, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ) \ + _(418, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ) \ + _(419, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR) \ + _(420, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) \ + _(421, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) \ + _(422, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR) \ + _(423, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) \ + _(424, ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) \ + _(446, ZEND_IS_EQUAL_SPEC_CV_CONST) \ + _(447, ZEND_IS_EQUAL_SPEC_CV_CONST_JMPZ) \ + _(448, ZEND_IS_EQUAL_SPEC_CV_CONST_JMPNZ) \ + _(449, ZEND_IS_EQUAL_SPEC_CV_TMPVAR) \ + _(450, ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ) \ + _(451, ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ) \ + _(452, ZEND_IS_EQUAL_SPEC_CV_TMPVAR) \ + _(453, ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPZ) \ + _(454, ZEND_IS_EQUAL_SPEC_CV_TMPVAR_JMPNZ) \ + _(458, ZEND_IS_EQUAL_SPEC_CV_CV) \ + _(459, ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ) \ + _(460, ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ) \ + _(461, ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST) \ + _(462, ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST) \ + _(463, ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST) \ + _(476, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST) \ + _(477, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ) \ + _(478, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ) \ + _(479, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR) \ + _(480, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) \ + _(481, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) \ + _(482, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR) \ + _(483, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) \ + _(484, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) \ + _(491, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST) \ + _(492, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ) \ + _(493, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ) \ + _(494, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR) \ + _(495, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) \ + _(496, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) \ + _(497, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR) \ + _(498, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPZ) \ + _(499, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_JMPNZ) \ + _(521, ZEND_IS_NOT_EQUAL_SPEC_CV_CONST) \ + _(522, ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPZ) \ + _(523, ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_JMPNZ) \ + _(524, ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR) \ + _(525, ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ) \ + _(526, ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ) \ + _(527, ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR) \ + _(528, ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPZ) \ + _(529, ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_JMPNZ) \ + _(533, ZEND_IS_NOT_EQUAL_SPEC_CV_CV) \ + _(534, ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ) \ + _(535, ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ) \ + _(536, ZEND_IS_SMALLER_SPEC_CONST_CONST) \ + _(537, ZEND_IS_SMALLER_SPEC_CONST_CONST) \ + _(538, ZEND_IS_SMALLER_SPEC_CONST_CONST) \ + _(539, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV) \ + _(540, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ) \ + _(541, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(542, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV) \ + _(543, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ) \ + _(544, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(548, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV) \ + _(549, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ) \ + _(550, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(551, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST) \ + _(552, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ) \ + _(553, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(554, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(555, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(556, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(557, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(558, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(559, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(563, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(564, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(565, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(566, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST) \ + _(567, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ) \ + _(568, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(569, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(570, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(571, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(572, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(573, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(574, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(578, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(579, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(580, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(596, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST) \ + _(597, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPZ) \ + _(598, ZEND_IS_SMALLER_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(599, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(600, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(601, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(602, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(603, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(604, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(608, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV) \ + _(609, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(610, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(611, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST) \ + _(612, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST) \ + _(613, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST) \ + _(614, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV) \ + _(615, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ) \ + _(616, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(617, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV) \ + _(618, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ) \ + _(619, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(623, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV) \ + _(624, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ) \ + _(625, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(626, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST) \ + _(627, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ) \ + _(628, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(629, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(630, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(631, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(632, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(633, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(634, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(638, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(639, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(640, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(641, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST) \ + _(642, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ) \ + _(643, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(644, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(645, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(646, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(647, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(648, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(649, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(653, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(654, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(655, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(671, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST) \ + _(672, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPZ) \ + _(673, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(674, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(675, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(676, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(677, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(678, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(679, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(683, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV) \ + _(684, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(685, ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(706, ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_UNUSED) \ + _(707, ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_USED) \ + _(708, ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_UNUSED) \ + _(709, ZEND_ASSIGN_SPEC_VAR_TMP_RETVAL_USED) \ + _(710, ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_UNUSED) \ + _(711, ZEND_ASSIGN_SPEC_VAR_VAR_RETVAL_USED) \ + _(714, ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_UNUSED) \ + _(715, ZEND_ASSIGN_SPEC_VAR_CV_RETVAL_USED) \ + _(726, ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED) \ + _(727, ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_USED) \ + _(728, ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_UNUSED) \ + _(729, ZEND_ASSIGN_SPEC_CV_TMP_RETVAL_USED) \ + _(730, ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_UNUSED) \ + _(731, ZEND_ASSIGN_SPEC_CV_VAR_RETVAL_USED) \ + _(734, ZEND_ASSIGN_SPEC_CV_CV_RETVAL_UNUSED) \ + _(735, ZEND_ASSIGN_SPEC_CV_CV_RETVAL_USED) \ + _(786, ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CONST) \ + _(787, ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_TMP) \ + _(788, ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_VAR) \ + _(790, ZEND_ASSIGN_DIM_SPEC_VAR_CONST_OP_DATA_CV) \ + _(791, ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST) \ + _(792, ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP) \ + _(793, ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR) \ + _(795, ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV) \ + _(796, ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CONST) \ + _(797, ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_TMP) \ + _(798, ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_VAR) \ + _(800, ZEND_ASSIGN_DIM_SPEC_VAR_TMPVAR_OP_DATA_CV) \ + _(801, ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CONST) \ + _(802, ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_TMP) \ + _(803, ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_VAR) \ + _(805, ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_OP_DATA_CV) \ + _(806, ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CONST) \ + _(807, ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_TMP) \ + _(808, ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_VAR) \ + _(810, ZEND_ASSIGN_DIM_SPEC_VAR_CV_OP_DATA_CV) \ + _(836, ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST) \ + _(837, ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_TMP) \ + _(838, ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_VAR) \ + _(840, ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CV) \ + _(841, ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST) \ + _(842, ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP) \ + _(843, ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR) \ + _(845, ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV) \ + _(846, ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CONST) \ + _(847, ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_TMP) \ + _(848, ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_VAR) \ + _(850, ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_OP_DATA_CV) \ + _(851, ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST) \ + _(852, ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_TMP) \ + _(853, ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_VAR) \ + _(855, ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CV) \ + _(856, ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CONST) \ + _(857, ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_TMP) \ + _(858, ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_VAR) \ + _(860, ZEND_ASSIGN_DIM_SPEC_CV_CV_OP_DATA_CV) \ + _(911, ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CONST) \ + _(912, ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_TMP) \ + _(913, ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_VAR) \ + _(915, ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_DATA_CV) \ + _(916, ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST) \ + _(917, ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP) \ + _(918, ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR) \ + _(920, ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV) \ + _(921, ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CONST) \ + _(922, ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_TMP) \ + _(923, ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_VAR) \ + _(925, ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_DATA_CV) \ + _(931, ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CONST) \ + _(932, ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_TMP) \ + _(933, ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_VAR) \ + _(935, ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA_CV) \ + _(936, ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CONST) \ + _(937, ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_TMP) \ + _(938, ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_VAR) \ + _(940, ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CV) \ + _(941, ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST) \ + _(942, ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP) \ + _(943, ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR) \ + _(945, ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV) \ + _(946, ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CONST) \ + _(947, ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_TMP) \ + _(948, ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_VAR) \ + _(950, ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_OP_DATA_CV) \ + _(956, ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CONST) \ + _(957, ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_TMP) \ + _(958, ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_VAR) \ + _(960, ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_DATA_CV) \ + _(961, ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CONST) \ + _(962, ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_TMP) \ + _(963, ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_VAR) \ + _(965, ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CV) \ + _(966, ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST) \ + _(967, ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP) \ + _(968, ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR) \ + _(970, ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV) \ + _(971, ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CONST) \ + _(972, ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_TMP) \ + _(973, ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_VAR) \ + _(975, ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_DATA_CV) \ + _(981, ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CONST) \ + _(982, ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_TMP) \ + _(983, ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_VAR) \ + _(985, ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_CV) \ + _(986, ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CONST) \ + _(987, ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_TMP) \ + _(988, ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_VAR) \ + _(990, ZEND_ASSIGN_STATIC_PROP_SPEC_OP_DATA_CV) \ + _(1001, ZEND_ASSIGN_OP_SPEC_VAR_CONST) \ + _(1002, ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR) \ + _(1003, ZEND_ASSIGN_OP_SPEC_VAR_TMPVAR) \ + _(1005, ZEND_ASSIGN_OP_SPEC_VAR_CV) \ + _(1011, ZEND_ASSIGN_OP_SPEC_CV_CONST) \ + _(1012, ZEND_ASSIGN_OP_SPEC_CV_TMPVAR) \ + _(1013, ZEND_ASSIGN_OP_SPEC_CV_TMPVAR) \ + _(1015, ZEND_ASSIGN_OP_SPEC_CV_CV) \ + _(1026, ZEND_ASSIGN_DIM_OP_SPEC_VAR_CONST) \ + _(1027, ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR) \ + _(1028, ZEND_ASSIGN_DIM_OP_SPEC_VAR_TMPVAR) \ + _(1029, ZEND_ASSIGN_DIM_OP_SPEC_VAR_UNUSED) \ + _(1030, ZEND_ASSIGN_DIM_OP_SPEC_VAR_CV) \ + _(1036, ZEND_ASSIGN_DIM_OP_SPEC_CV_CONST) \ + _(1037, ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR) \ + _(1038, ZEND_ASSIGN_DIM_OP_SPEC_CV_TMPVAR) \ + _(1039, ZEND_ASSIGN_DIM_OP_SPEC_CV_UNUSED) \ + _(1040, ZEND_ASSIGN_DIM_OP_SPEC_CV_CV) \ + _(1051, ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CONST) \ + _(1052, ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR) \ + _(1053, ZEND_ASSIGN_OBJ_OP_SPEC_VAR_TMPVAR) \ + _(1055, ZEND_ASSIGN_OBJ_OP_SPEC_VAR_CV) \ + _(1056, ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CONST) \ + _(1057, ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR) \ + _(1058, ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_TMPVAR) \ + _(1060, ZEND_ASSIGN_OBJ_OP_SPEC_UNUSED_CV) \ + _(1061, ZEND_ASSIGN_OBJ_OP_SPEC_CV_CONST) \ + _(1062, ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR) \ + _(1063, ZEND_ASSIGN_OBJ_OP_SPEC_CV_TMPVAR) \ + _(1065, ZEND_ASSIGN_OBJ_OP_SPEC_CV_CV) \ + _(1066, ZEND_ASSIGN_STATIC_PROP_OP_SPEC) \ + _(1079, ZEND_ASSIGN_REF_SPEC_VAR_VAR) \ + _(1081, ZEND_ASSIGN_REF_SPEC_VAR_CV) \ + _(1089, ZEND_ASSIGN_REF_SPEC_CV_VAR) \ + _(1091, ZEND_ASSIGN_REF_SPEC_CV_CV) \ + _(1092, ZEND_QM_ASSIGN_SPEC_CONST) \ + _(1093, ZEND_QM_ASSIGN_SPEC_TMP) \ + _(1094, ZEND_QM_ASSIGN_SPEC_VAR) \ + _(1096, ZEND_QM_ASSIGN_SPEC_CV) \ + _(1149, ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_VAR) \ + _(1151, ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CONST_OP_DATA_CV) \ + _(1154, ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR) \ + _(1156, ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV) \ + _(1159, ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_VAR) \ + _(1161, ZEND_ASSIGN_OBJ_REF_SPEC_VAR_TMPVAR_OP_DATA_CV) \ + _(1169, ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_VAR) \ + _(1171, ZEND_ASSIGN_OBJ_REF_SPEC_VAR_CV_OP_DATA_CV) \ + _(1174, ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_VAR) \ + _(1176, ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CONST_OP_DATA_CV) \ + _(1179, ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR) \ + _(1181, ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV) \ + _(1184, ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_VAR) \ + _(1186, ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_TMPVAR_OP_DATA_CV) \ + _(1194, ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_VAR) \ + _(1196, ZEND_ASSIGN_OBJ_REF_SPEC_UNUSED_CV_OP_DATA_CV) \ + _(1199, ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_VAR) \ + _(1201, ZEND_ASSIGN_OBJ_REF_SPEC_CV_CONST_OP_DATA_CV) \ + _(1204, ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR) \ + _(1206, ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV) \ + _(1209, ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_VAR) \ + _(1211, ZEND_ASSIGN_OBJ_REF_SPEC_CV_TMPVAR_OP_DATA_CV) \ + _(1219, ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_VAR) \ + _(1221, ZEND_ASSIGN_OBJ_REF_SPEC_CV_CV_OP_DATA_CV) \ + _(1222, ZEND_ASSIGN_STATIC_PROP_REF_SPEC) \ + _(1227, ZEND_PRE_INC_SPEC_VAR_RETVAL_UNUSED) \ + _(1228, ZEND_PRE_INC_SPEC_VAR_RETVAL_USED) \ + _(1231, ZEND_PRE_INC_SPEC_CV_RETVAL_UNUSED) \ + _(1232, ZEND_PRE_INC_SPEC_CV_RETVAL_USED) \ + _(1237, ZEND_PRE_DEC_SPEC_VAR_RETVAL_UNUSED) \ + _(1238, ZEND_PRE_DEC_SPEC_VAR_RETVAL_USED) \ + _(1241, ZEND_PRE_DEC_SPEC_CV_RETVAL_UNUSED) \ + _(1242, ZEND_PRE_DEC_SPEC_CV_RETVAL_USED) \ + _(1245, ZEND_POST_INC_SPEC_VAR) \ + _(1247, ZEND_POST_INC_SPEC_CV) \ + _(1250, ZEND_POST_DEC_SPEC_VAR) \ + _(1252, ZEND_POST_DEC_SPEC_CV) \ + _(1253, ZEND_PRE_INC_STATIC_PROP_SPEC) \ + _(1254, ZEND_POST_INC_STATIC_PROP_SPEC) \ + _(1255, ZEND_JMP_SPEC) \ + _(1256, ZEND_JMPZ_SPEC_CONST) \ + _(1257, ZEND_JMPZ_SPEC_TMPVAR) \ + _(1258, ZEND_JMPZ_SPEC_TMPVAR) \ + _(1260, ZEND_JMPZ_SPEC_CV) \ + _(1261, ZEND_JMPNZ_SPEC_CONST) \ + _(1262, ZEND_JMPNZ_SPEC_TMPVAR) \ + _(1263, ZEND_JMPNZ_SPEC_TMPVAR) \ + _(1265, ZEND_JMPNZ_SPEC_CV) \ + _(1266, ZEND_JMPZ_EX_SPEC_CONST) \ + _(1267, ZEND_JMPZ_EX_SPEC_TMPVAR) \ + _(1268, ZEND_JMPZ_EX_SPEC_TMPVAR) \ + _(1270, ZEND_JMPZ_EX_SPEC_CV) \ + _(1271, ZEND_JMPNZ_EX_SPEC_CONST) \ + _(1272, ZEND_JMPNZ_EX_SPEC_TMPVAR) \ + _(1273, ZEND_JMPNZ_EX_SPEC_TMPVAR) \ + _(1275, ZEND_JMPNZ_EX_SPEC_CV) \ + _(1276, ZEND_CASE_SPEC_TMPVAR_CONST) \ + _(1277, ZEND_CASE_SPEC_TMPVAR_TMPVAR) \ + _(1278, ZEND_CASE_SPEC_TMPVAR_TMPVAR) \ + _(1280, ZEND_CASE_SPEC_TMPVAR_CV) \ + _(1281, ZEND_CHECK_VAR_SPEC_CV_UNUSED) \ + _(1282, ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST) \ + _(1283, ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_CONST) \ + _(1288, ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED) \ + _(1289, ZEND_SEND_VAR_NO_REF_EX_SPEC_VAR_UNUSED_QUICK) \ + _(1292, ZEND_CAST_SPEC_CONST) \ + _(1293, ZEND_CAST_SPEC_TMP) \ + _(1294, ZEND_CAST_SPEC_VAR) \ + _(1296, ZEND_CAST_SPEC_CV) \ + _(1297, ZEND_BOOL_SPEC_CONST) \ + _(1298, ZEND_BOOL_SPEC_TMPVAR) \ + _(1299, ZEND_BOOL_SPEC_TMPVAR) \ + _(1301, ZEND_BOOL_SPEC_CV) \ + _(1302, ZEND_FAST_CONCAT_SPEC_CONST_CONST) \ + _(1303, ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR) \ + _(1304, ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR) \ + _(1306, ZEND_FAST_CONCAT_SPEC_CONST_CV) \ + _(1307, ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST) \ + _(1308, ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR) \ + _(1309, ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR) \ + _(1311, ZEND_FAST_CONCAT_SPEC_TMPVAR_CV) \ + _(1312, ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST) \ + _(1313, ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR) \ + _(1314, ZEND_FAST_CONCAT_SPEC_TMPVAR_TMPVAR) \ + _(1316, ZEND_FAST_CONCAT_SPEC_TMPVAR_CV) \ + _(1322, ZEND_FAST_CONCAT_SPEC_CV_CONST) \ + _(1323, ZEND_FAST_CONCAT_SPEC_CV_TMPVAR) \ + _(1324, ZEND_FAST_CONCAT_SPEC_CV_TMPVAR) \ + _(1326, ZEND_FAST_CONCAT_SPEC_CV_CV) \ + _(1327, ZEND_ROPE_INIT_SPEC_UNUSED_CONST) \ + _(1328, ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR) \ + _(1329, ZEND_ROPE_INIT_SPEC_UNUSED_TMPVAR) \ + _(1331, ZEND_ROPE_INIT_SPEC_UNUSED_CV) \ + _(1332, ZEND_ROPE_ADD_SPEC_TMP_CONST) \ + _(1333, ZEND_ROPE_ADD_SPEC_TMP_TMPVAR) \ + _(1334, ZEND_ROPE_ADD_SPEC_TMP_TMPVAR) \ + _(1336, ZEND_ROPE_ADD_SPEC_TMP_CV) \ + _(1337, ZEND_ROPE_END_SPEC_TMP_CONST) \ + _(1338, ZEND_ROPE_END_SPEC_TMP_TMPVAR) \ + _(1339, ZEND_ROPE_END_SPEC_TMP_TMPVAR) \ + _(1341, ZEND_ROPE_END_SPEC_TMP_CV) \ + _(1342, ZEND_BEGIN_SILENCE_SPEC) \ + _(1343, ZEND_END_SILENCE_SPEC_TMP) \ + _(1344, ZEND_INIT_FCALL_BY_NAME_SPEC_CONST) \ + _(1345, ZEND_DO_FCALL_SPEC_RETVAL_UNUSED) \ + _(1346, ZEND_DO_FCALL_SPEC_RETVAL_USED) \ + _(1347, ZEND_DO_FCALL_SPEC_OBSERVER) \ + _(1348, ZEND_DO_FCALL_SPEC_OBSERVER) \ + _(1349, ZEND_INIT_FCALL_SPEC_CONST) \ + _(1350, ZEND_RETURN_SPEC_CONST) \ + _(1351, ZEND_RETURN_SPEC_OBSERVER) \ + _(1352, ZEND_RETURN_SPEC_TMP) \ + _(1353, ZEND_RETURN_SPEC_OBSERVER) \ + _(1354, ZEND_RETURN_SPEC_VAR) \ + _(1355, ZEND_RETURN_SPEC_OBSERVER) \ + _(1358, ZEND_RETURN_SPEC_CV) \ + _(1359, ZEND_RETURN_SPEC_OBSERVER) \ + _(1360, ZEND_RECV_SPEC_UNUSED) \ + _(1361, ZEND_RECV_INIT_SPEC_CONST) \ + _(1362, ZEND_SEND_VAL_SPEC_CONST_CONST) \ + _(1365, ZEND_SEND_VAL_SPEC_CONST_UNUSED) \ + _(1367, ZEND_SEND_VAL_SPEC_TMPVAR_CONST) \ + _(1370, ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED) \ + _(1372, ZEND_SEND_VAL_SPEC_TMPVAR_CONST) \ + _(1375, ZEND_SEND_VAL_SPEC_TMPVAR_UNUSED) \ + _(1407, ZEND_SEND_VAR_EX_SPEC_VAR_CONST) \ + _(1408, ZEND_SEND_VAR_EX_SPEC_VAR_CONST) \ + _(1413, ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED) \ + _(1414, ZEND_SEND_VAR_EX_SPEC_VAR_UNUSED_QUICK) \ + _(1427, ZEND_SEND_VAR_EX_SPEC_CV_CONST) \ + _(1428, ZEND_SEND_VAR_EX_SPEC_CV_CONST) \ + _(1433, ZEND_SEND_VAR_EX_SPEC_CV_UNUSED) \ + _(1434, ZEND_SEND_VAR_EX_SPEC_CV_UNUSED_QUICK) \ + _(1447, ZEND_SEND_REF_SPEC_VAR_CONST) \ + _(1450, ZEND_SEND_REF_SPEC_VAR_UNUSED) \ + _(1457, ZEND_SEND_REF_SPEC_CV_CONST) \ + _(1460, ZEND_SEND_REF_SPEC_CV_UNUSED) \ + _(1462, ZEND_NEW_SPEC_CONST_UNUSED) \ + _(1464, ZEND_NEW_SPEC_VAR_UNUSED) \ + _(1465, ZEND_NEW_SPEC_UNUSED_UNUSED) \ + _(1467, ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST) \ + _(1468, ZEND_FREE_SPEC_TMPVAR) \ + _(1469, ZEND_INIT_ARRAY_SPEC_CONST_CONST) \ + _(1470, ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR) \ + _(1471, ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR) \ + _(1472, ZEND_INIT_ARRAY_SPEC_CONST_UNUSED) \ + _(1473, ZEND_INIT_ARRAY_SPEC_CONST_CV) \ + _(1474, ZEND_INIT_ARRAY_SPEC_TMP_CONST) \ + _(1475, ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR) \ + _(1476, ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR) \ + _(1477, ZEND_INIT_ARRAY_SPEC_TMP_UNUSED) \ + _(1478, ZEND_INIT_ARRAY_SPEC_TMP_CV) \ + _(1479, ZEND_INIT_ARRAY_SPEC_VAR_CONST) \ + _(1480, ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR) \ + _(1481, ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR) \ + _(1482, ZEND_INIT_ARRAY_SPEC_VAR_UNUSED) \ + _(1483, ZEND_INIT_ARRAY_SPEC_VAR_CV) \ + _(1484, ZEND_INIT_ARRAY_SPEC_UNUSED_CONST) \ + _(1485, ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR) \ + _(1486, ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR) \ + _(1487, ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED) \ + _(1488, ZEND_INIT_ARRAY_SPEC_UNUSED_CV) \ + _(1489, ZEND_INIT_ARRAY_SPEC_CV_CONST) \ + _(1490, ZEND_INIT_ARRAY_SPEC_CV_TMPVAR) \ + _(1491, ZEND_INIT_ARRAY_SPEC_CV_TMPVAR) \ + _(1492, ZEND_INIT_ARRAY_SPEC_CV_UNUSED) \ + _(1493, ZEND_INIT_ARRAY_SPEC_CV_CV) \ + _(1494, ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST) \ + _(1495, ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR) \ + _(1496, ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMPVAR) \ + _(1497, ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED) \ + _(1498, ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV) \ + _(1499, ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST) \ + _(1500, ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR) \ + _(1501, ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMPVAR) \ + _(1502, ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED) \ + _(1503, ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV) \ + _(1504, ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST) \ + _(1505, ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR) \ + _(1506, ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR) \ + _(1507, ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED) \ + _(1508, ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV) \ + _(1514, ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST) \ + _(1515, ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR) \ + _(1516, ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR) \ + _(1517, ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED) \ + _(1518, ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV) \ + _(1519, ZEND_INCLUDE_OR_EVAL_SPEC_CONST) \ + _(1520, ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) \ + _(1521, ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR) \ + _(1522, ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) \ + _(1523, ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR) \ + _(1524, ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) \ + _(1527, ZEND_INCLUDE_OR_EVAL_SPEC_CV) \ + _(1528, ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) \ + _(1529, ZEND_UNSET_VAR_SPEC_CONST_UNUSED) \ + _(1530, ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED) \ + _(1531, ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED) \ + _(1533, ZEND_UNSET_VAR_SPEC_CV_UNUSED) \ + _(1544, ZEND_UNSET_DIM_SPEC_VAR_CONST) \ + _(1545, ZEND_UNSET_DIM_SPEC_VAR_TMPVAR) \ + _(1546, ZEND_UNSET_DIM_SPEC_VAR_TMPVAR) \ + _(1548, ZEND_UNSET_DIM_SPEC_VAR_CV) \ + _(1554, ZEND_UNSET_DIM_SPEC_CV_CONST) \ + _(1555, ZEND_UNSET_DIM_SPEC_CV_TMPVAR) \ + _(1556, ZEND_UNSET_DIM_SPEC_CV_TMPVAR) \ + _(1558, ZEND_UNSET_DIM_SPEC_CV_CV) \ + _(1569, ZEND_UNSET_OBJ_SPEC_VAR_CONST) \ + _(1570, ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR) \ + _(1571, ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR) \ + _(1573, ZEND_UNSET_OBJ_SPEC_VAR_CV) \ + _(1574, ZEND_UNSET_OBJ_SPEC_UNUSED_CONST) \ + _(1575, ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR) \ + _(1576, ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR) \ + _(1578, ZEND_UNSET_OBJ_SPEC_UNUSED_CV) \ + _(1579, ZEND_UNSET_OBJ_SPEC_CV_CONST) \ + _(1580, ZEND_UNSET_OBJ_SPEC_CV_TMPVAR) \ + _(1581, ZEND_UNSET_OBJ_SPEC_CV_TMPVAR) \ + _(1583, ZEND_UNSET_OBJ_SPEC_CV_CV) \ + _(1584, ZEND_FE_RESET_R_SPEC_CONST) \ + _(1585, ZEND_FE_RESET_R_SPEC_TMP) \ + _(1586, ZEND_FE_RESET_R_SPEC_VAR) \ + _(1588, ZEND_FE_RESET_R_SPEC_CV) \ + _(1589, ZEND_FE_FETCH_R_SPEC_VAR) \ + _(1590, ZEND_EXIT_SPEC) \ + _(1591, ZEND_FETCH_R_SPEC_CONST_UNUSED) \ + _(1592, ZEND_FETCH_R_SPEC_TMPVAR_UNUSED) \ + _(1593, ZEND_FETCH_R_SPEC_TMPVAR_UNUSED) \ + _(1595, ZEND_FETCH_R_SPEC_CV_UNUSED) \ + _(1596, ZEND_FETCH_DIM_R_SPEC_CONST_CONST) \ + _(1597, ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR) \ + _(1598, ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR) \ + _(1600, ZEND_FETCH_DIM_R_SPEC_CONST_CV) \ + _(1601, ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST) \ + _(1602, ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR) \ + _(1603, ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR) \ + _(1605, ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV) \ + _(1606, ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST) \ + _(1607, ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR) \ + _(1608, ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR) \ + _(1610, ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV) \ + _(1616, ZEND_FETCH_DIM_R_SPEC_CV_CONST) \ + _(1617, ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR) \ + _(1618, ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR) \ + _(1620, ZEND_FETCH_DIM_R_SPEC_CV_CV) \ + _(1621, ZEND_FETCH_OBJ_R_SPEC_CONST_CONST) \ + _(1622, ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR) \ + _(1623, ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR) \ + _(1625, ZEND_FETCH_OBJ_R_SPEC_CONST_CV) \ + _(1626, ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST) \ + _(1627, ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR) \ + _(1628, ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR) \ + _(1630, ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV) \ + _(1631, ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST) \ + _(1632, ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR) \ + _(1633, ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR) \ + _(1635, ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV) \ + _(1636, ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST) \ + _(1637, ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR) \ + _(1638, ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR) \ + _(1640, ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV) \ + _(1641, ZEND_FETCH_OBJ_R_SPEC_CV_CONST) \ + _(1642, ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR) \ + _(1643, ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR) \ + _(1645, ZEND_FETCH_OBJ_R_SPEC_CV_CV) \ + _(1646, ZEND_FETCH_W_SPEC_CONST_UNUSED) \ + _(1647, ZEND_FETCH_W_SPEC_TMPVAR_UNUSED) \ + _(1648, ZEND_FETCH_W_SPEC_TMPVAR_UNUSED) \ + _(1650, ZEND_FETCH_W_SPEC_CV_UNUSED) \ + _(1661, ZEND_FETCH_DIM_W_SPEC_VAR_CONST) \ + _(1662, ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR) \ + _(1663, ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR) \ + _(1664, ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED) \ + _(1665, ZEND_FETCH_DIM_W_SPEC_VAR_CV) \ + _(1671, ZEND_FETCH_DIM_W_SPEC_CV_CONST) \ + _(1672, ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR) \ + _(1673, ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR) \ + _(1674, ZEND_FETCH_DIM_W_SPEC_CV_UNUSED) \ + _(1675, ZEND_FETCH_DIM_W_SPEC_CV_CV) \ + _(1686, ZEND_FETCH_OBJ_W_SPEC_VAR_CONST) \ + _(1687, ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR) \ + _(1688, ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR) \ + _(1690, ZEND_FETCH_OBJ_W_SPEC_VAR_CV) \ + _(1691, ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST) \ + _(1692, ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR) \ + _(1693, ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR) \ + _(1695, ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV) \ + _(1696, ZEND_FETCH_OBJ_W_SPEC_CV_CONST) \ + _(1697, ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR) \ + _(1698, ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR) \ + _(1700, ZEND_FETCH_OBJ_W_SPEC_CV_CV) \ + _(1701, ZEND_FETCH_RW_SPEC_CONST_UNUSED) \ + _(1702, ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED) \ + _(1703, ZEND_FETCH_RW_SPEC_TMPVAR_UNUSED) \ + _(1705, ZEND_FETCH_RW_SPEC_CV_UNUSED) \ + _(1716, ZEND_FETCH_DIM_RW_SPEC_VAR_CONST) \ + _(1717, ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR) \ + _(1718, ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR) \ + _(1719, ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED) \ + _(1720, ZEND_FETCH_DIM_RW_SPEC_VAR_CV) \ + _(1726, ZEND_FETCH_DIM_RW_SPEC_CV_CONST) \ + _(1727, ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR) \ + _(1728, ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR) \ + _(1729, ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED) \ + _(1730, ZEND_FETCH_DIM_RW_SPEC_CV_CV) \ + _(1741, ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST) \ + _(1742, ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR) \ + _(1743, ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR) \ + _(1745, ZEND_FETCH_OBJ_RW_SPEC_VAR_CV) \ + _(1746, ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST) \ + _(1747, ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR) \ + _(1748, ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR) \ + _(1750, ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV) \ + _(1751, ZEND_FETCH_OBJ_RW_SPEC_CV_CONST) \ + _(1752, ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR) \ + _(1753, ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR) \ + _(1755, ZEND_FETCH_OBJ_RW_SPEC_CV_CV) \ + _(1756, ZEND_FETCH_IS_SPEC_CONST_UNUSED) \ + _(1757, ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED) \ + _(1758, ZEND_FETCH_IS_SPEC_TMPVAR_UNUSED) \ + _(1760, ZEND_FETCH_IS_SPEC_CV_UNUSED) \ + _(1761, ZEND_FETCH_DIM_IS_SPEC_CONST_CONST) \ + _(1762, ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR) \ + _(1763, ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR) \ + _(1765, ZEND_FETCH_DIM_IS_SPEC_CONST_CV) \ + _(1766, ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST) \ + _(1767, ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR) \ + _(1768, ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR) \ + _(1770, ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV) \ + _(1771, ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST) \ + _(1772, ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR) \ + _(1773, ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR) \ + _(1775, ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV) \ + _(1781, ZEND_FETCH_DIM_IS_SPEC_CV_CONST) \ + _(1782, ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR) \ + _(1783, ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR) \ + _(1785, ZEND_FETCH_DIM_IS_SPEC_CV_CV) \ + _(1786, ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST) \ + _(1787, ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR) \ + _(1788, ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR) \ + _(1790, ZEND_FETCH_OBJ_IS_SPEC_CONST_CV) \ + _(1791, ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST) \ + _(1792, ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR) \ + _(1793, ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR) \ + _(1795, ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV) \ + _(1796, ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST) \ + _(1797, ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR) \ + _(1798, ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVAR) \ + _(1800, ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV) \ + _(1801, ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST) \ + _(1802, ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR) \ + _(1803, ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVAR) \ + _(1805, ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV) \ + _(1806, ZEND_FETCH_OBJ_IS_SPEC_CV_CONST) \ + _(1807, ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR) \ + _(1808, ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR) \ + _(1810, ZEND_FETCH_OBJ_IS_SPEC_CV_CV) \ + _(1811, ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED) \ + _(1812, ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED) \ + _(1813, ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED) \ + _(1815, ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED) \ + _(1816, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST) \ + _(1817, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR) \ + _(1818, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR) \ + _(1819, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED) \ + _(1820, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV) \ + _(1821, ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST) \ + _(1822, ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR) \ + _(1823, ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR) \ + _(1824, ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED) \ + _(1825, ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV) \ + _(1826, ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST) \ + _(1827, ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR) \ + _(1828, ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR) \ + _(1829, ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED) \ + _(1830, ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV) \ + _(1836, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST) \ + _(1837, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR) \ + _(1838, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR) \ + _(1839, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED) \ + _(1840, ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV) \ + _(1841, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST) \ + _(1842, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR) \ + _(1843, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR) \ + _(1845, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV) \ + _(1846, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST) \ + _(1847, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR) \ + _(1848, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR) \ + _(1850, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV) \ + _(1851, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST) \ + _(1852, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR) \ + _(1853, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR) \ + _(1855, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV) \ + _(1856, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST) \ + _(1857, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR) \ + _(1858, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR) \ + _(1860, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV) \ + _(1861, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST) \ + _(1862, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR) \ + _(1863, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR) \ + _(1865, ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV) \ + _(1866, ZEND_FETCH_UNSET_SPEC_CONST_UNUSED) \ + _(1867, ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED) \ + _(1868, ZEND_FETCH_UNSET_SPEC_TMPVAR_UNUSED) \ + _(1870, ZEND_FETCH_UNSET_SPEC_CV_UNUSED) \ + _(1881, ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST) \ + _(1882, ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR) \ + _(1883, ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR) \ + _(1885, ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV) \ + _(1891, ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST) \ + _(1892, ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR) \ + _(1893, ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR) \ + _(1895, ZEND_FETCH_DIM_UNSET_SPEC_CV_CV) \ + _(1906, ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST) \ + _(1907, ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR) \ + _(1908, ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR) \ + _(1910, ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV) \ + _(1911, ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST) \ + _(1912, ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR) \ + _(1913, ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR) \ + _(1915, ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV) \ + _(1916, ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST) \ + _(1917, ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR) \ + _(1918, ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR) \ + _(1920, ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV) \ + _(1921, ZEND_FETCH_LIST_R_SPEC_CONST_CONST) \ + _(1922, ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR) \ + _(1923, ZEND_FETCH_LIST_R_SPEC_CONST_TMPVAR) \ + _(1925, ZEND_FETCH_LIST_R_SPEC_CONST_CV) \ + _(1926, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST) \ + _(1927, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR) \ + _(1928, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR) \ + _(1930, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV) \ + _(1931, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST) \ + _(1932, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR) \ + _(1933, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR) \ + _(1935, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV) \ + _(1941, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CONST) \ + _(1942, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR) \ + _(1943, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_TMPVAR) \ + _(1945, ZEND_FETCH_LIST_R_SPEC_TMPVARCV_CV) \ + _(1946, ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST) \ + _(1947, ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST) \ + _(1948, ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST) \ + _(1953, ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED) \ + _(1954, ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_UNUSED_QUICK) \ + _(1957, ZEND_EXT_STMT_SPEC) \ + _(1958, ZEND_EXT_FCALL_BEGIN_SPEC) \ + _(1959, ZEND_EXT_FCALL_END_SPEC) \ + _(1960, ZEND_EXT_NOP_SPEC) \ + _(1961, ZEND_TICKS_SPEC) \ + _(1962, ZEND_SEND_VAR_NO_REF_SPEC_VAR_CONST) \ + _(1965, ZEND_SEND_VAR_NO_REF_SPEC_VAR_UNUSED) \ + _(1967, ZEND_CATCH_SPEC_CONST) \ + _(1968, ZEND_THROW_SPEC_CONST) \ + _(1969, ZEND_THROW_SPEC_TMPVAR) \ + _(1970, ZEND_THROW_SPEC_TMPVAR) \ + _(1972, ZEND_THROW_SPEC_CV) \ + _(1973, ZEND_FETCH_CLASS_SPEC_UNUSED_CONST) \ + _(1974, ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR) \ + _(1975, ZEND_FETCH_CLASS_SPEC_UNUSED_TMPVAR) \ + _(1976, ZEND_FETCH_CLASS_SPEC_UNUSED_UNUSED) \ + _(1977, ZEND_FETCH_CLASS_SPEC_UNUSED_CV) \ + _(1978, ZEND_CLONE_SPEC_CONST) \ + _(1979, ZEND_CLONE_SPEC_TMPVAR) \ + _(1980, ZEND_CLONE_SPEC_TMPVAR) \ + _(1981, ZEND_CLONE_SPEC_UNUSED) \ + _(1982, ZEND_CLONE_SPEC_CV) \ + _(1983, ZEND_RETURN_BY_REF_SPEC_CONST) \ + _(1984, ZEND_RETURN_BY_REF_SPEC_OBSERVER) \ + _(1985, ZEND_RETURN_BY_REF_SPEC_TMP) \ + _(1986, ZEND_RETURN_BY_REF_SPEC_OBSERVER) \ + _(1987, ZEND_RETURN_BY_REF_SPEC_VAR) \ + _(1988, ZEND_RETURN_BY_REF_SPEC_OBSERVER) \ + _(1991, ZEND_RETURN_BY_REF_SPEC_CV) \ + _(1992, ZEND_RETURN_BY_REF_SPEC_OBSERVER) \ + _(1993, ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST) \ + _(1994, ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR) \ + _(1995, ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR) \ + _(1997, ZEND_INIT_METHOD_CALL_SPEC_CONST_CV) \ + _(1998, ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST) \ + _(1999, ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR) \ + _(2000, ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR) \ + _(2002, ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV) \ + _(2003, ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST) \ + _(2004, ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR) \ + _(2005, ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR) \ + _(2007, ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV) \ + _(2008, ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST) \ + _(2009, ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR) \ + _(2010, ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR) \ + _(2012, ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV) \ + _(2013, ZEND_INIT_METHOD_CALL_SPEC_CV_CONST) \ + _(2014, ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR) \ + _(2015, ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR) \ + _(2017, ZEND_INIT_METHOD_CALL_SPEC_CV_CV) \ + _(2018, ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST) \ + _(2019, ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR) \ + _(2020, ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR) \ + _(2021, ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED) \ + _(2022, ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV) \ + _(2028, ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST) \ + _(2029, ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR) \ + _(2030, ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR) \ + _(2031, ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED) \ + _(2032, ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV) \ + _(2033, ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CONST) \ + _(2034, ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR) \ + _(2035, ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_TMPVAR) \ + _(2036, ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_UNUSED) \ + _(2037, ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_CV) \ + _(2043, ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED) \ + _(2044, ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED) \ + _(2045, ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED) \ + _(2047, ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED) \ + _(2048, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CONST) \ + _(2049, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR) \ + _(2050, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_TMPVAR) \ + _(2052, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CV) \ + _(2053, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST) \ + _(2054, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR) \ + _(2055, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR) \ + _(2057, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV) \ + _(2058, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CONST) \ + _(2059, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR) \ + _(2060, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_TMPVAR) \ + _(2062, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV) \ + _(2068, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST) \ + _(2069, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR) \ + _(2070, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR) \ + _(2072, ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV) \ + _(2073, ZEND_SEND_VAL_EX_SPEC_CONST_CONST) \ + _(2074, ZEND_SEND_VAL_EX_SPEC_CONST_CONST) \ + _(2079, ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED) \ + _(2080, ZEND_SEND_VAL_EX_SPEC_CONST_UNUSED_QUICK) \ + _(2083, ZEND_SEND_VAL_EX_SPEC_TMP_CONST) \ + _(2084, ZEND_SEND_VAL_EX_SPEC_TMP_CONST) \ + _(2089, ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED) \ + _(2090, ZEND_SEND_VAL_EX_SPEC_TMP_UNUSED_QUICK) \ + _(2133, ZEND_SEND_VAR_SPEC_VAR_CONST) \ + _(2136, ZEND_SEND_VAR_SPEC_VAR_UNUSED) \ + _(2143, ZEND_SEND_VAR_SPEC_CV_CONST) \ + _(2146, ZEND_SEND_VAR_SPEC_CV_UNUSED) \ + _(2148, ZEND_INIT_USER_CALL_SPEC_CONST_CONST) \ + _(2149, ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR) \ + _(2150, ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR) \ + _(2152, ZEND_INIT_USER_CALL_SPEC_CONST_CV) \ + _(2153, ZEND_SEND_ARRAY_SPEC) \ + _(2154, ZEND_SEND_USER_SPEC_CONST) \ + _(2155, ZEND_SEND_USER_SPEC_TMP) \ + _(2156, ZEND_SEND_USER_SPEC_VAR) \ + _(2158, ZEND_SEND_USER_SPEC_CV) \ + _(2159, ZEND_STRLEN_SPEC_CONST) \ + _(2160, ZEND_STRLEN_SPEC_TMPVAR) \ + _(2161, ZEND_STRLEN_SPEC_TMPVAR) \ + _(2163, ZEND_STRLEN_SPEC_CV) \ + _(2164, ZEND_DEFINED_SPEC_CONST) \ + _(2165, ZEND_TYPE_CHECK_SPEC_CONST) \ + _(2166, ZEND_TYPE_CHECK_SPEC_TMPVAR) \ + _(2167, ZEND_TYPE_CHECK_SPEC_TMPVAR) \ + _(2169, ZEND_TYPE_CHECK_SPEC_CV) \ + _(2170, ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED) \ + _(2171, ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UNUSED) \ + _(2172, ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED) \ + _(2173, ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED_UNUSED) \ + _(2174, ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNUSED) \ + _(2175, ZEND_FE_RESET_RW_SPEC_CONST) \ + _(2176, ZEND_FE_RESET_RW_SPEC_TMP) \ + _(2177, ZEND_FE_RESET_RW_SPEC_VAR) \ + _(2179, ZEND_FE_RESET_RW_SPEC_CV) \ + _(2180, ZEND_FE_FETCH_RW_SPEC_VAR) \ + _(2181, ZEND_FE_FREE_SPEC_TMPVAR) \ + _(2182, ZEND_INIT_DYNAMIC_CALL_SPEC_CONST) \ + _(2183, ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR) \ + _(2184, ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR) \ + _(2186, ZEND_INIT_DYNAMIC_CALL_SPEC_CV) \ + _(2187, ZEND_DO_ICALL_SPEC_RETVAL_UNUSED) \ + _(2188, ZEND_DO_ICALL_SPEC_RETVAL_USED) \ + _(2189, ZEND_DO_ICALL_SPEC_OBSERVER) \ + _(2190, ZEND_DO_ICALL_SPEC_OBSERVER) \ + _(2191, ZEND_DO_UCALL_SPEC_RETVAL_UNUSED) \ + _(2192, ZEND_DO_UCALL_SPEC_RETVAL_USED) \ + _(2193, ZEND_DO_UCALL_SPEC_OBSERVER) \ + _(2194, ZEND_DO_UCALL_SPEC_OBSERVER) \ + _(2195, ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED) \ + _(2196, ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED) \ + _(2197, ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER) \ + _(2198, ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER) \ + _(2209, ZEND_PRE_INC_OBJ_SPEC_VAR_CONST) \ + _(2210, ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR) \ + _(2211, ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR) \ + _(2213, ZEND_PRE_INC_OBJ_SPEC_VAR_CV) \ + _(2214, ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST) \ + _(2215, ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR) \ + _(2216, ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMPVAR) \ + _(2218, ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV) \ + _(2219, ZEND_PRE_INC_OBJ_SPEC_CV_CONST) \ + _(2220, ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR) \ + _(2221, ZEND_PRE_INC_OBJ_SPEC_CV_TMPVAR) \ + _(2223, ZEND_PRE_INC_OBJ_SPEC_CV_CV) \ + _(2234, ZEND_POST_INC_OBJ_SPEC_VAR_CONST) \ + _(2235, ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR) \ + _(2236, ZEND_POST_INC_OBJ_SPEC_VAR_TMPVAR) \ + _(2238, ZEND_POST_INC_OBJ_SPEC_VAR_CV) \ + _(2239, ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST) \ + _(2240, ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR) \ + _(2241, ZEND_POST_INC_OBJ_SPEC_UNUSED_TMPVAR) \ + _(2243, ZEND_POST_INC_OBJ_SPEC_UNUSED_CV) \ + _(2244, ZEND_POST_INC_OBJ_SPEC_CV_CONST) \ + _(2245, ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR) \ + _(2246, ZEND_POST_INC_OBJ_SPEC_CV_TMPVAR) \ + _(2248, ZEND_POST_INC_OBJ_SPEC_CV_CV) \ + _(2249, ZEND_ECHO_SPEC_CONST) \ + _(2250, ZEND_ECHO_SPEC_TMPVAR) \ + _(2251, ZEND_ECHO_SPEC_TMPVAR) \ + _(2253, ZEND_ECHO_SPEC_CV) \ + _(2260, ZEND_INSTANCEOF_SPEC_TMPVAR_CONST) \ + _(2262, ZEND_INSTANCEOF_SPEC_TMPVAR_VAR) \ + _(2263, ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED) \ + _(2265, ZEND_INSTANCEOF_SPEC_TMPVAR_CONST) \ + _(2267, ZEND_INSTANCEOF_SPEC_TMPVAR_VAR) \ + _(2268, ZEND_INSTANCEOF_SPEC_TMPVAR_UNUSED) \ + _(2275, ZEND_INSTANCEOF_SPEC_CV_CONST) \ + _(2277, ZEND_INSTANCEOF_SPEC_CV_VAR) \ + _(2278, ZEND_INSTANCEOF_SPEC_CV_UNUSED) \ + _(2280, ZEND_GENERATOR_CREATE_SPEC) \ + _(2283, ZEND_MAKE_REF_SPEC_VAR_UNUSED) \ + _(2285, ZEND_MAKE_REF_SPEC_CV_UNUSED) \ + _(2286, ZEND_DECLARE_FUNCTION_SPEC) \ + _(2287, ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST) \ + _(2288, ZEND_DECLARE_CONST_SPEC_CONST_CONST) \ + _(2289, ZEND_DECLARE_CLASS_SPEC_CONST) \ + _(2290, ZEND_DECLARE_CLASS_DELAYED_SPEC_CONST_CONST) \ + _(2291, ZEND_DECLARE_ANON_CLASS_SPEC) \ + _(2292, ZEND_ADD_ARRAY_UNPACK_SPEC) \ + _(2293, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST) \ + _(2294, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR) \ + _(2295, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR) \ + _(2297, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV) \ + _(2298, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST) \ + _(2299, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR) \ + _(2300, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR) \ + _(2302, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV) \ + _(2303, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST) \ + _(2304, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR) \ + _(2305, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR) \ + _(2307, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV) \ + _(2308, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST) \ + _(2309, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR) \ + _(2310, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR) \ + _(2312, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV) \ + _(2313, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST) \ + _(2314, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR) \ + _(2315, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR) \ + _(2317, ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV) \ + _(2318, ZEND_HANDLE_EXCEPTION_SPEC) \ + _(2319, ZEND_USER_OPCODE_SPEC) \ + _(2320, ZEND_ASSERT_CHECK_SPEC) \ + _(2321, ZEND_JMP_SET_SPEC_CONST) \ + _(2322, ZEND_JMP_SET_SPEC_TMP) \ + _(2323, ZEND_JMP_SET_SPEC_VAR) \ + _(2325, ZEND_JMP_SET_SPEC_CV) \ + _(2326, ZEND_UNSET_CV_SPEC_CV_UNUSED) \ + _(2327, ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_SET) \ + _(2328, ZEND_ISSET_ISEMPTY_CV_SPEC_CV_UNUSED_EMPTY) \ + _(2329, ZEND_FETCH_LIST_W_SPEC_VAR_CONST) \ + _(2330, ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR) \ + _(2331, ZEND_FETCH_LIST_W_SPEC_VAR_TMPVAR) \ + _(2333, ZEND_FETCH_LIST_W_SPEC_VAR_CV) \ + _(2334, ZEND_SEPARATE_SPEC_VAR_UNUSED) \ + _(2336, ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR) \ + _(2337, ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR) \ + _(2338, ZEND_FETCH_CLASS_NAME_SPEC_UNUSED) \ + _(2339, ZEND_FETCH_CLASS_NAME_SPEC_CV) \ + _(2340, ZEND_CALL_TRAMPOLINE_SPEC) \ + _(2341, ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER) \ + _(2342, ZEND_DISCARD_EXCEPTION_SPEC) \ + _(2343, ZEND_YIELD_SPEC_CONST_CONST) \ + _(2344, ZEND_YIELD_SPEC_CONST_TMPVAR) \ + _(2345, ZEND_YIELD_SPEC_CONST_TMPVAR) \ + _(2346, ZEND_YIELD_SPEC_CONST_UNUSED) \ + _(2347, ZEND_YIELD_SPEC_CONST_CV) \ + _(2348, ZEND_YIELD_SPEC_TMP_CONST) \ + _(2349, ZEND_YIELD_SPEC_TMP_TMPVAR) \ + _(2350, ZEND_YIELD_SPEC_TMP_TMPVAR) \ + _(2351, ZEND_YIELD_SPEC_TMP_UNUSED) \ + _(2352, ZEND_YIELD_SPEC_TMP_CV) \ + _(2353, ZEND_YIELD_SPEC_VAR_CONST) \ + _(2354, ZEND_YIELD_SPEC_VAR_TMPVAR) \ + _(2355, ZEND_YIELD_SPEC_VAR_TMPVAR) \ + _(2356, ZEND_YIELD_SPEC_VAR_UNUSED) \ + _(2357, ZEND_YIELD_SPEC_VAR_CV) \ + _(2358, ZEND_YIELD_SPEC_UNUSED_CONST) \ + _(2359, ZEND_YIELD_SPEC_UNUSED_TMPVAR) \ + _(2360, ZEND_YIELD_SPEC_UNUSED_TMPVAR) \ + _(2361, ZEND_YIELD_SPEC_UNUSED_UNUSED) \ + _(2362, ZEND_YIELD_SPEC_UNUSED_CV) \ + _(2363, ZEND_YIELD_SPEC_CV_CONST) \ + _(2364, ZEND_YIELD_SPEC_CV_TMPVAR) \ + _(2365, ZEND_YIELD_SPEC_CV_TMPVAR) \ + _(2366, ZEND_YIELD_SPEC_CV_UNUSED) \ + _(2367, ZEND_YIELD_SPEC_CV_CV) \ + _(2368, ZEND_GENERATOR_RETURN_SPEC_CONST) \ + _(2369, ZEND_GENERATOR_RETURN_SPEC_OBSERVER) \ + _(2370, ZEND_GENERATOR_RETURN_SPEC_TMP) \ + _(2371, ZEND_GENERATOR_RETURN_SPEC_OBSERVER) \ + _(2372, ZEND_GENERATOR_RETURN_SPEC_VAR) \ + _(2373, ZEND_GENERATOR_RETURN_SPEC_OBSERVER) \ + _(2376, ZEND_GENERATOR_RETURN_SPEC_CV) \ + _(2377, ZEND_GENERATOR_RETURN_SPEC_OBSERVER) \ + _(2378, ZEND_FAST_CALL_SPEC) \ + _(2379, ZEND_FAST_RET_SPEC) \ + _(2380, ZEND_RECV_VARIADIC_SPEC_UNUSED) \ + _(2381, ZEND_SEND_UNPACK_SPEC) \ + _(2382, ZEND_YIELD_FROM_SPEC_CONST) \ + _(2383, ZEND_YIELD_FROM_SPEC_TMPVAR) \ + _(2384, ZEND_YIELD_FROM_SPEC_TMPVAR) \ + _(2386, ZEND_YIELD_FROM_SPEC_CV) \ + _(2387, ZEND_COPY_TMP_SPEC_TMPVAR_UNUSED) \ + _(2388, ZEND_BIND_GLOBAL_SPEC_CV_CONST) \ + _(2389, ZEND_COALESCE_SPEC_CONST) \ + _(2390, ZEND_COALESCE_SPEC_TMP) \ + _(2391, ZEND_COALESCE_SPEC_VAR) \ + _(2393, ZEND_COALESCE_SPEC_CV) \ + _(2394, ZEND_SPACESHIP_SPEC_CONST_CONST) \ + _(2395, ZEND_SPACESHIP_SPEC_CONST_TMPVAR) \ + _(2396, ZEND_SPACESHIP_SPEC_CONST_TMPVAR) \ + _(2398, ZEND_SPACESHIP_SPEC_CONST_CV) \ + _(2399, ZEND_SPACESHIP_SPEC_TMPVAR_CONST) \ + _(2400, ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR) \ + _(2401, ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR) \ + _(2403, ZEND_SPACESHIP_SPEC_TMPVAR_CV) \ + _(2404, ZEND_SPACESHIP_SPEC_TMPVAR_CONST) \ + _(2405, ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR) \ + _(2406, ZEND_SPACESHIP_SPEC_TMPVAR_TMPVAR) \ + _(2408, ZEND_SPACESHIP_SPEC_TMPVAR_CV) \ + _(2414, ZEND_SPACESHIP_SPEC_CV_CONST) \ + _(2415, ZEND_SPACESHIP_SPEC_CV_TMPVAR) \ + _(2416, ZEND_SPACESHIP_SPEC_CV_TMPVAR) \ + _(2418, ZEND_SPACESHIP_SPEC_CV_CV) \ + _(2419, ZEND_FUNC_NUM_ARGS_SPEC_UNUSED_UNUSED) \ + _(2420, ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSED) \ + _(2423, ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUSED) \ + _(2425, ZEND_FETCH_STATIC_PROP_R_SPEC) \ + _(2426, ZEND_FETCH_STATIC_PROP_W_SPEC) \ + _(2427, ZEND_FETCH_STATIC_PROP_RW_SPEC) \ + _(2428, ZEND_FETCH_STATIC_PROP_IS_SPEC) \ + _(2429, ZEND_FETCH_STATIC_PROP_FUNC_ARG_SPEC) \ + _(2430, ZEND_FETCH_STATIC_PROP_UNSET_SPEC) \ + _(2431, ZEND_UNSET_STATIC_PROP_SPEC) \ + _(2432, ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC) \ + _(2433, ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST) \ + _(2434, ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV) \ + _(2435, ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV) \ + _(2437, ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_TMPVARCV) \ + _(2443, ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_CONST) \ + _(2444, ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV) \ + _(2445, ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV) \ + _(2447, ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_TMPVARCV) \ + _(2448, ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_CONST) \ + _(2449, ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV) \ + _(2450, ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV) \ + _(2452, ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_TMPVARCV) \ + _(2458, ZEND_BIND_LEXICAL_SPEC_TMP_CV) \ + _(2459, ZEND_BIND_STATIC_SPEC_CV) \ + _(2460, ZEND_FETCH_THIS_SPEC_UNUSED_UNUSED) \ + _(2461, ZEND_SEND_FUNC_ARG_SPEC_VAR_CONST) \ + _(2464, ZEND_SEND_FUNC_ARG_SPEC_VAR_UNUSED) \ + _(2466, ZEND_ISSET_ISEMPTY_THIS_SPEC_UNUSED_UNUSED) \ + _(2467, ZEND_SWITCH_LONG_SPEC_CONST_CONST) \ + _(2468, ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST) \ + _(2469, ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST) \ + _(2471, ZEND_SWITCH_LONG_SPEC_TMPVARCV_CONST) \ + _(2472, ZEND_SWITCH_STRING_SPEC_CONST_CONST) \ + _(2473, ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST) \ + _(2474, ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST) \ + _(2476, ZEND_SWITCH_STRING_SPEC_TMPVARCV_CONST) \ + _(2477, ZEND_IN_ARRAY_SPEC_CONST_CONST) \ + _(2478, ZEND_IN_ARRAY_SPEC_TMP_CONST) \ + _(2479, ZEND_IN_ARRAY_SPEC_VAR_CONST) \ + _(2481, ZEND_IN_ARRAY_SPEC_CV_CONST) \ + _(2482, ZEND_COUNT_SPEC_CONST_UNUSED) \ + _(2483, ZEND_COUNT_SPEC_TMPVAR_UNUSED) \ + _(2484, ZEND_COUNT_SPEC_TMPVAR_UNUSED) \ + _(2486, ZEND_COUNT_SPEC_CV_UNUSED) \ + _(2487, ZEND_GET_CLASS_SPEC_CONST_UNUSED) \ + _(2488, ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED) \ + _(2489, ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED) \ + _(2490, ZEND_GET_CLASS_SPEC_UNUSED_UNUSED) \ + _(2491, ZEND_GET_CLASS_SPEC_CV_UNUSED) \ + _(2492, ZEND_GET_CALLED_CLASS_SPEC_UNUSED_UNUSED) \ + _(2493, ZEND_GET_TYPE_SPEC_CONST_UNUSED) \ + _(2494, ZEND_GET_TYPE_SPEC_TMP_UNUSED) \ + _(2495, ZEND_GET_TYPE_SPEC_VAR_UNUSED) \ + _(2497, ZEND_GET_TYPE_SPEC_CV_UNUSED) \ + _(2498, ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CONST) \ + _(2499, ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR) \ + _(2500, ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_TMPVAR) \ + _(2502, ZEND_ARRAY_KEY_EXISTS_SPEC_CONST_CV) \ + _(2503, ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST) \ + _(2504, ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR) \ + _(2505, ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR) \ + _(2507, ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV) \ + _(2508, ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CONST) \ + _(2509, ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR) \ + _(2510, ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_TMPVAR) \ + _(2512, ZEND_ARRAY_KEY_EXISTS_SPEC_TMPVAR_CV) \ + _(2518, ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CONST) \ + _(2519, ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR) \ + _(2520, ZEND_ARRAY_KEY_EXISTS_SPEC_CV_TMPVAR) \ + _(2522, ZEND_ARRAY_KEY_EXISTS_SPEC_CV_CV) \ + _(2523, ZEND_MATCH_SPEC_CONST_CONST) \ + _(2524, ZEND_MATCH_SPEC_TMPVARCV_CONST) \ + _(2525, ZEND_MATCH_SPEC_TMPVARCV_CONST) \ + _(2527, ZEND_MATCH_SPEC_TMPVARCV_CONST) \ + _(2533, ZEND_CASE_STRICT_SPEC_TMP_CONST) \ + _(2534, ZEND_CASE_STRICT_SPEC_TMP_TMP) \ + _(2535, ZEND_CASE_STRICT_SPEC_TMP_VAR) \ + _(2537, ZEND_CASE_STRICT_SPEC_TMP_CV) \ + _(2538, ZEND_CASE_STRICT_SPEC_VAR_CONST) \ + _(2539, ZEND_CASE_STRICT_SPEC_VAR_TMP) \ + _(2540, ZEND_CASE_STRICT_SPEC_VAR_VAR) \ + _(2542, ZEND_CASE_STRICT_SPEC_VAR_CV) \ + _(2553, ZEND_MATCH_ERROR_SPEC_CONST_UNUSED) \ + _(2554, ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED) \ + _(2555, ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED) \ + _(2557, ZEND_MATCH_ERROR_SPEC_TMPVARCV_UNUSED) \ + _(2558, ZEND_JMP_NULL_SPEC_CONST) \ + _(2559, ZEND_JMP_NULL_SPEC_TMP) \ + _(2560, ZEND_JMP_NULL_SPEC_VAR) \ + _(2562, ZEND_JMP_NULL_SPEC_CV) \ + _(2563, ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED) \ + _(2564, ZEND_FETCH_GLOBALS_SPEC_UNUSED_UNUSED) \ + _(2565, ZEND_VERIFY_NEVER_TYPE_SPEC_UNUSED_UNUSED) \ + _(2566, ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED) \ + _(2567, ZEND_BIND_INIT_STATIC_OR_JMP_SPEC_CV) \ + _(2568, ZEND_RECV_NOTYPE_SPEC) \ + _(2570, ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) \ + _(2571, ZEND_COUNT_ARRAY_SPEC_TMPVAR_UNUSED) \ + _(2573, ZEND_COUNT_ARRAY_SPEC_CV_UNUSED) \ + _(2574, ZEND_JMP_FORWARD_SPEC) \ + _(2580, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2581, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2582, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2584, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2585, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2586, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2587, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2589, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2595, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2596, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2597, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2599, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2605, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ + _(2606, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2607, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2609, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2610, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ + _(2611, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2612, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2614, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2620, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ + _(2621, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2622, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2624, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2630, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2631, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2632, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2634, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2635, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2636, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2637, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2639, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2645, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2646, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2647, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2649, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2651, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ + _(2652, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ + _(2654, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ + _(2655, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2656, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2657, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2659, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2660, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2661, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2662, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2664, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2670, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2671, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2672, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2674, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2676, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ + _(2677, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ + _(2679, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ + _(2680, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ + _(2681, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2682, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2684, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2685, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ + _(2686, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2687, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2689, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2695, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ + _(2696, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2697, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2699, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2701, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(2702, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(2704, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(2705, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2706, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2707, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2709, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2710, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2711, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2712, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2714, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2720, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2721, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2722, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2724, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2730, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2731, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2732, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2734, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2735, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2736, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2737, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2739, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2745, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2746, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2747, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2749, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2755, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ + _(2756, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2757, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2759, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2760, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ + _(2761, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2762, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2764, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2770, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ + _(2771, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2772, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2774, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2780, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2781, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2782, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2784, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2785, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2786, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2787, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2789, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2795, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2796, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2797, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2799, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2815, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2816, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2817, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2818, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2819, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2820, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2821, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2822, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2823, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2827, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2828, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2829, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2830, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2831, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2832, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2833, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2834, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2835, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2836, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2837, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2838, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2842, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2843, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2844, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2860, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2861, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2862, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2863, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2864, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2865, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2866, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2867, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2868, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2872, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2873, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2874, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2890, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2891, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2892, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2893, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2894, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2895, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2896, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2897, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2898, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2902, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2903, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2904, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2905, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2906, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2907, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2908, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2909, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2910, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2911, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2912, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2913, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2917, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2918, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2919, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2935, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2936, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2937, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2938, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2939, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2940, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2941, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2942, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2943, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2947, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2948, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2949, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2965, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2966, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2967, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2968, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2969, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2970, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2971, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2972, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2973, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2977, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2978, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2979, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2980, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2981, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2982, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2983, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2984, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2985, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2986, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2987, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2988, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2992, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2993, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2994, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3010, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3011, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3012, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3013, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3014, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3015, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3016, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3017, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3018, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3022, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3023, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3024, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3040, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3041, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3042, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3043, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3044, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3045, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3046, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3047, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3048, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3052, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3053, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3054, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3055, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3056, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3057, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3058, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3059, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3060, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3061, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3062, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3063, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3067, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3068, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3069, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3085, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3086, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3087, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3088, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3089, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3090, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3091, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3092, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3093, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3097, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3098, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3099, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3100, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ + _(3104, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV) \ + _(3105, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ + _(3109, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV) \ + _(3113, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3114, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3115, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3116, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3117, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3118, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3122, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3123, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3124, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3125, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3126, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3127, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3128, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3129, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3130, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3131, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3132, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3133, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3137, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3138, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3139, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3140, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3141, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3142, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3143, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3144, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3145, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3146, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3147, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3148, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3152, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3153, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3154, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3170, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3171, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3172, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3173, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3174, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3175, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3176, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3177, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3178, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3182, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3183, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3184, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3188, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3189, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3190, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3191, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3192, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3193, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3197, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3198, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3199, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3200, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3201, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3202, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3203, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3204, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3205, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3206, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3207, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3208, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3212, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3213, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3214, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3215, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3216, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3217, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3218, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3219, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3220, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3221, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3222, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3223, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3227, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3228, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3229, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3245, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3246, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3247, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3248, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3249, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3250, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3251, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3252, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3253, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3257, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3258, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3259, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3263, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3264, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3265, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3266, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3267, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3268, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3272, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3273, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3274, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3275, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3276, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3277, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3278, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3279, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3280, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3281, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3282, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3283, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3287, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3288, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3289, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3290, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3291, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3292, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3293, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3294, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3295, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3296, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3297, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3298, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3302, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3303, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3304, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3320, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3321, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3322, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3323, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3324, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3325, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3326, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3327, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3328, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3332, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3333, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3334, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3338, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3339, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3340, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3341, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3342, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3343, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3347, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3348, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3349, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3350, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3351, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3352, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3353, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3354, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3355, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3356, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3357, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3358, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3362, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3363, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3364, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3365, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3366, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3367, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3368, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3369, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3370, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3371, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3372, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3373, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3377, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3378, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3379, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3395, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3396, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3397, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3398, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3399, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3400, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3401, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3402, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3403, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3407, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3408, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3409, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3410, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ + _(3411, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ + _(3412, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED) \ + _(3413, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED) \ + _(3414, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ + _(3415, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ + _(3416, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED) \ + _(3417, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED) \ + _(3418, ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV) \ + _(3419, ZEND_POST_INC_LONG_SPEC_CV) \ + _(3420, ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV) \ + _(3421, ZEND_POST_DEC_LONG_SPEC_CV) \ + _(3422, ZEND_QM_ASSIGN_LONG_SPEC_CONST) \ + _(3423, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3424, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3426, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3427, ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST) \ + _(3428, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3429, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3431, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3432, ZEND_QM_ASSIGN_NOREF_SPEC_CONST) \ + _(3433, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3434, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3436, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3438, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ + _(3439, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ + _(3441, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ + _(3442, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ + _(3443, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3444, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3446, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3447, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ + _(3448, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3449, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3451, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3457, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST) \ + _(3458, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3459, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3461, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3464, ZEND_SEND_VAR_SIMPLE_SPEC_VAR) \ + _(3466, ZEND_SEND_VAR_SIMPLE_SPEC_CV) \ + _(3469, ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED) \ + _(3471, ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED) \ + _(3472, ZEND_SEND_VAL_SIMPLE_SPEC_CONST) \ + _(3473, ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST) \ + _(3474, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED) \ + _(3475, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED) \ + _(3475+1, ZEND_NULL) diff --git a/include/php/Zend/zend_vm_opcodes.h b/include/php/Zend/zend_vm_opcodes.h new file mode 100644 index 0000000..5531acc --- /dev/null +++ b/include/php/Zend/zend_vm_opcodes.h @@ -0,0 +1,292 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_VM_OPCODES_H +#define ZEND_VM_OPCODES_H + +#define ZEND_VM_SPEC 1 +#define ZEND_VM_LINES 0 +#define ZEND_VM_KIND_CALL 1 +#define ZEND_VM_KIND_SWITCH 2 +#define ZEND_VM_KIND_GOTO 3 +#define ZEND_VM_KIND_HYBRID 4 +/* HYBRID requires support for computed GOTO and global register variables*/ +#if (defined(__GNUC__) && defined(HAVE_GCC_GLOBAL_REGS)) +# define ZEND_VM_KIND ZEND_VM_KIND_HYBRID +#else +# define ZEND_VM_KIND ZEND_VM_KIND_CALL +#endif + +#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) && !defined(__SANITIZE_ADDRESS__) +# if ((defined(i386) && !defined(__PIC__)) || defined(__x86_64__) || defined(_M_X64)) +# define ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE 16 +# endif +#endif + +#define ZEND_VM_OP_SPEC 0x00000001 +#define ZEND_VM_OP_CONST 0x00000002 +#define ZEND_VM_OP_TMPVAR 0x00000004 +#define ZEND_VM_OP_TMPVARCV 0x00000008 +#define ZEND_VM_OP_MASK 0x000000f0 +#define ZEND_VM_OP_NUM 0x00000010 +#define ZEND_VM_OP_JMP_ADDR 0x00000020 +#define ZEND_VM_OP_TRY_CATCH 0x00000030 +#define ZEND_VM_OP_THIS 0x00000050 +#define ZEND_VM_OP_NEXT 0x00000060 +#define ZEND_VM_OP_CLASS_FETCH 0x00000070 +#define ZEND_VM_OP_CONSTRUCTOR 0x00000080 +#define ZEND_VM_OP_CONST_FETCH 0x00000090 +#define ZEND_VM_OP_CACHE_SLOT 0x000000a0 +#define ZEND_VM_EXT_VAR_FETCH 0x00010000 +#define ZEND_VM_EXT_ISSET 0x00020000 +#define ZEND_VM_EXT_CACHE_SLOT 0x00040000 +#define ZEND_VM_EXT_ARRAY_INIT 0x00080000 +#define ZEND_VM_EXT_REF 0x00100000 +#define ZEND_VM_EXT_FETCH_REF 0x00200000 +#define ZEND_VM_EXT_DIM_WRITE 0x00400000 +#define ZEND_VM_EXT_MASK 0x0f000000 +#define ZEND_VM_EXT_NUM 0x01000000 +#define ZEND_VM_EXT_LAST_CATCH 0x02000000 +#define ZEND_VM_EXT_JMP_ADDR 0x03000000 +#define ZEND_VM_EXT_OP 0x04000000 +#define ZEND_VM_EXT_TYPE 0x07000000 +#define ZEND_VM_EXT_EVAL 0x08000000 +#define ZEND_VM_EXT_TYPE_MASK 0x09000000 +#define ZEND_VM_EXT_SRC 0x0b000000 +#define ZEND_VM_NO_CONST_CONST 0x40000000 +#define ZEND_VM_COMMUTATIVE 0x80000000 +#define ZEND_VM_OP1_FLAGS(flags) (flags & 0xff) +#define ZEND_VM_OP2_FLAGS(flags) ((flags >> 8) & 0xff) + +BEGIN_EXTERN_C() + +ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(uint8_t opcode); +ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(uint8_t opcode); +ZEND_API uint8_t zend_get_opcode_id(const char *name, size_t length); + +END_EXTERN_C() + +#define ZEND_NOP 0 +#define ZEND_ADD 1 +#define ZEND_SUB 2 +#define ZEND_MUL 3 +#define ZEND_DIV 4 +#define ZEND_MOD 5 +#define ZEND_SL 6 +#define ZEND_SR 7 +#define ZEND_CONCAT 8 +#define ZEND_BW_OR 9 +#define ZEND_BW_AND 10 +#define ZEND_BW_XOR 11 +#define ZEND_POW 12 +#define ZEND_BW_NOT 13 +#define ZEND_BOOL_NOT 14 +#define ZEND_BOOL_XOR 15 +#define ZEND_IS_IDENTICAL 16 +#define ZEND_IS_NOT_IDENTICAL 17 +#define ZEND_IS_EQUAL 18 +#define ZEND_IS_NOT_EQUAL 19 +#define ZEND_IS_SMALLER 20 +#define ZEND_IS_SMALLER_OR_EQUAL 21 +#define ZEND_ASSIGN 22 +#define ZEND_ASSIGN_DIM 23 +#define ZEND_ASSIGN_OBJ 24 +#define ZEND_ASSIGN_STATIC_PROP 25 +#define ZEND_ASSIGN_OP 26 +#define ZEND_ASSIGN_DIM_OP 27 +#define ZEND_ASSIGN_OBJ_OP 28 +#define ZEND_ASSIGN_STATIC_PROP_OP 29 +#define ZEND_ASSIGN_REF 30 +#define ZEND_QM_ASSIGN 31 +#define ZEND_ASSIGN_OBJ_REF 32 +#define ZEND_ASSIGN_STATIC_PROP_REF 33 +#define ZEND_PRE_INC 34 +#define ZEND_PRE_DEC 35 +#define ZEND_POST_INC 36 +#define ZEND_POST_DEC 37 +#define ZEND_PRE_INC_STATIC_PROP 38 +#define ZEND_PRE_DEC_STATIC_PROP 39 +#define ZEND_POST_INC_STATIC_PROP 40 +#define ZEND_POST_DEC_STATIC_PROP 41 +#define ZEND_JMP 42 +#define ZEND_JMPZ 43 +#define ZEND_JMPNZ 44 +#define ZEND_JMPZ_EX 46 +#define ZEND_JMPNZ_EX 47 +#define ZEND_CASE 48 +#define ZEND_CHECK_VAR 49 +#define ZEND_SEND_VAR_NO_REF_EX 50 +#define ZEND_CAST 51 +#define ZEND_BOOL 52 +#define ZEND_FAST_CONCAT 53 +#define ZEND_ROPE_INIT 54 +#define ZEND_ROPE_ADD 55 +#define ZEND_ROPE_END 56 +#define ZEND_BEGIN_SILENCE 57 +#define ZEND_END_SILENCE 58 +#define ZEND_INIT_FCALL_BY_NAME 59 +#define ZEND_DO_FCALL 60 +#define ZEND_INIT_FCALL 61 +#define ZEND_RETURN 62 +#define ZEND_RECV 63 +#define ZEND_RECV_INIT 64 +#define ZEND_SEND_VAL 65 +#define ZEND_SEND_VAR_EX 66 +#define ZEND_SEND_REF 67 +#define ZEND_NEW 68 +#define ZEND_INIT_NS_FCALL_BY_NAME 69 +#define ZEND_FREE 70 +#define ZEND_INIT_ARRAY 71 +#define ZEND_ADD_ARRAY_ELEMENT 72 +#define ZEND_INCLUDE_OR_EVAL 73 +#define ZEND_UNSET_VAR 74 +#define ZEND_UNSET_DIM 75 +#define ZEND_UNSET_OBJ 76 +#define ZEND_FE_RESET_R 77 +#define ZEND_FE_FETCH_R 78 +#define ZEND_EXIT 79 +#define ZEND_FETCH_R 80 +#define ZEND_FETCH_DIM_R 81 +#define ZEND_FETCH_OBJ_R 82 +#define ZEND_FETCH_W 83 +#define ZEND_FETCH_DIM_W 84 +#define ZEND_FETCH_OBJ_W 85 +#define ZEND_FETCH_RW 86 +#define ZEND_FETCH_DIM_RW 87 +#define ZEND_FETCH_OBJ_RW 88 +#define ZEND_FETCH_IS 89 +#define ZEND_FETCH_DIM_IS 90 +#define ZEND_FETCH_OBJ_IS 91 +#define ZEND_FETCH_FUNC_ARG 92 +#define ZEND_FETCH_DIM_FUNC_ARG 93 +#define ZEND_FETCH_OBJ_FUNC_ARG 94 +#define ZEND_FETCH_UNSET 95 +#define ZEND_FETCH_DIM_UNSET 96 +#define ZEND_FETCH_OBJ_UNSET 97 +#define ZEND_FETCH_LIST_R 98 +#define ZEND_FETCH_CONSTANT 99 +#define ZEND_CHECK_FUNC_ARG 100 +#define ZEND_EXT_STMT 101 +#define ZEND_EXT_FCALL_BEGIN 102 +#define ZEND_EXT_FCALL_END 103 +#define ZEND_EXT_NOP 104 +#define ZEND_TICKS 105 +#define ZEND_SEND_VAR_NO_REF 106 +#define ZEND_CATCH 107 +#define ZEND_THROW 108 +#define ZEND_FETCH_CLASS 109 +#define ZEND_CLONE 110 +#define ZEND_RETURN_BY_REF 111 +#define ZEND_INIT_METHOD_CALL 112 +#define ZEND_INIT_STATIC_METHOD_CALL 113 +#define ZEND_ISSET_ISEMPTY_VAR 114 +#define ZEND_ISSET_ISEMPTY_DIM_OBJ 115 +#define ZEND_SEND_VAL_EX 116 +#define ZEND_SEND_VAR 117 +#define ZEND_INIT_USER_CALL 118 +#define ZEND_SEND_ARRAY 119 +#define ZEND_SEND_USER 120 +#define ZEND_STRLEN 121 +#define ZEND_DEFINED 122 +#define ZEND_TYPE_CHECK 123 +#define ZEND_VERIFY_RETURN_TYPE 124 +#define ZEND_FE_RESET_RW 125 +#define ZEND_FE_FETCH_RW 126 +#define ZEND_FE_FREE 127 +#define ZEND_INIT_DYNAMIC_CALL 128 +#define ZEND_DO_ICALL 129 +#define ZEND_DO_UCALL 130 +#define ZEND_DO_FCALL_BY_NAME 131 +#define ZEND_PRE_INC_OBJ 132 +#define ZEND_PRE_DEC_OBJ 133 +#define ZEND_POST_INC_OBJ 134 +#define ZEND_POST_DEC_OBJ 135 +#define ZEND_ECHO 136 +#define ZEND_OP_DATA 137 +#define ZEND_INSTANCEOF 138 +#define ZEND_GENERATOR_CREATE 139 +#define ZEND_MAKE_REF 140 +#define ZEND_DECLARE_FUNCTION 141 +#define ZEND_DECLARE_LAMBDA_FUNCTION 142 +#define ZEND_DECLARE_CONST 143 +#define ZEND_DECLARE_CLASS 144 +#define ZEND_DECLARE_CLASS_DELAYED 145 +#define ZEND_DECLARE_ANON_CLASS 146 +#define ZEND_ADD_ARRAY_UNPACK 147 +#define ZEND_ISSET_ISEMPTY_PROP_OBJ 148 +#define ZEND_HANDLE_EXCEPTION 149 +#define ZEND_USER_OPCODE 150 +#define ZEND_ASSERT_CHECK 151 +#define ZEND_JMP_SET 152 +#define ZEND_UNSET_CV 153 +#define ZEND_ISSET_ISEMPTY_CV 154 +#define ZEND_FETCH_LIST_W 155 +#define ZEND_SEPARATE 156 +#define ZEND_FETCH_CLASS_NAME 157 +#define ZEND_CALL_TRAMPOLINE 158 +#define ZEND_DISCARD_EXCEPTION 159 +#define ZEND_YIELD 160 +#define ZEND_GENERATOR_RETURN 161 +#define ZEND_FAST_CALL 162 +#define ZEND_FAST_RET 163 +#define ZEND_RECV_VARIADIC 164 +#define ZEND_SEND_UNPACK 165 +#define ZEND_YIELD_FROM 166 +#define ZEND_COPY_TMP 167 +#define ZEND_BIND_GLOBAL 168 +#define ZEND_COALESCE 169 +#define ZEND_SPACESHIP 170 +#define ZEND_FUNC_NUM_ARGS 171 +#define ZEND_FUNC_GET_ARGS 172 +#define ZEND_FETCH_STATIC_PROP_R 173 +#define ZEND_FETCH_STATIC_PROP_W 174 +#define ZEND_FETCH_STATIC_PROP_RW 175 +#define ZEND_FETCH_STATIC_PROP_IS 176 +#define ZEND_FETCH_STATIC_PROP_FUNC_ARG 177 +#define ZEND_FETCH_STATIC_PROP_UNSET 178 +#define ZEND_UNSET_STATIC_PROP 179 +#define ZEND_ISSET_ISEMPTY_STATIC_PROP 180 +#define ZEND_FETCH_CLASS_CONSTANT 181 +#define ZEND_BIND_LEXICAL 182 +#define ZEND_BIND_STATIC 183 +#define ZEND_FETCH_THIS 184 +#define ZEND_SEND_FUNC_ARG 185 +#define ZEND_ISSET_ISEMPTY_THIS 186 +#define ZEND_SWITCH_LONG 187 +#define ZEND_SWITCH_STRING 188 +#define ZEND_IN_ARRAY 189 +#define ZEND_COUNT 190 +#define ZEND_GET_CLASS 191 +#define ZEND_GET_CALLED_CLASS 192 +#define ZEND_GET_TYPE 193 +#define ZEND_ARRAY_KEY_EXISTS 194 +#define ZEND_MATCH 195 +#define ZEND_CASE_STRICT 196 +#define ZEND_MATCH_ERROR 197 +#define ZEND_JMP_NULL 198 +#define ZEND_CHECK_UNDEF_ARGS 199 +#define ZEND_FETCH_GLOBALS 200 +#define ZEND_VERIFY_NEVER_TYPE 201 +#define ZEND_CALLABLE_CONVERT 202 +#define ZEND_BIND_INIT_STATIC_OR_JMP 203 + +#define ZEND_VM_LAST_OPCODE 203 + +#endif diff --git a/include/php/Zend/zend_vm_trace_handlers.h b/include/php/Zend/zend_vm_trace_handlers.h new file mode 100644 index 0000000..eaf97e0 --- /dev/null +++ b/include/php/Zend/zend_vm_trace_handlers.h @@ -0,0 +1,112 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#include "zend_sort.h" + +#define VM_TRACE(op) zend_vm_trace(#op, sizeof(#op)-1); +#define VM_TRACE_START() zend_vm_trace_init(); +#define VM_TRACE_END() zend_vm_trace_finish(); + +static HashTable vm_trace_ht; + +static void zend_vm_trace(const char *op, size_t op_len) +{ + static const char *last = NULL; + static size_t last_len = 0; + char buf[256]; + size_t len; + zval tmp, *zv; + + if (EXPECTED(last)) { + len = last_len + 1 + op_len; + memcpy(buf, last, last_len); + buf[last_len] = ' '; + memcpy(buf + last_len + 1, op, op_len + 1); + zv = zend_hash_str_find(&vm_trace_ht, buf, len); + if (EXPECTED(zv)) { + if (EXPECTED(Z_LVAL_P(zv) < ZEND_LONG_MAX)) { + Z_LVAL_P(zv)++; + } + } else { + ZVAL_LONG(&tmp, 1); + zend_hash_str_add_new(&vm_trace_ht, buf, len, &tmp); + } + } + last = op; + last_len = op_len; +} + +static int zend_vm_trace_compare(const Bucket *p1, const Bucket *p2) +{ + if (Z_LVAL(p1->val) < Z_LVAL(p2->val)) { + return 1; + } else if (Z_LVAL(p1->val) > Z_LVAL(p2->val)) { + return -1; + } else { + return 0; + } +} + +static void zend_vm_trace_finish(void) +{ + zend_string *key; + zval *val; + FILE *f; + + f = fopen("zend_vm_trace.log", "w+"); + if (f) { + zend_hash_sort(&vm_trace_ht, (compare_func_t)zend_vm_trace_compare, 0); + ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(&vm_trace_ht, key, val) { + fprintf(f, "%s "ZEND_LONG_FMT"\n", ZSTR_VAL(key), Z_LVAL_P(val)); + } ZEND_HASH_FOREACH_END(); + fclose(f); + } + zend_hash_destroy(&vm_trace_ht); +} + +static void zend_vm_trace_init(void) +{ + FILE *f; + + zend_hash_init(&vm_trace_ht, 0, NULL, NULL, 1); + f = fopen("zend_vm_trace.log", "r"); + if (f) { + char buf[256]; + size_t len; + zval tmp; + + while (!feof(f)) { + if (fgets(buf, sizeof(buf)-1, f)) { + len = strlen(buf); + while (len > 0 && buf[len-1] <= ' ') { + len--; + buf[len] = 0; + } + while (len > 0 && buf[len-1] >= '0' && buf[len-1] <= '9') { + len--; + } + if (len > 1) { + buf[len-1] = 0; + ZVAL_LONG(&tmp, ZEND_STRTOL(buf + len, NULL, 10)); + zend_hash_str_add(&vm_trace_ht, buf, len - 1, &tmp); + } + } + } + fclose(f); + } +} diff --git a/include/php/Zend/zend_vm_trace_lines.h b/include/php/Zend/zend_vm_trace_lines.h new file mode 100644 index 0000000..740e187 --- /dev/null +++ b/include/php/Zend/zend_vm_trace_lines.h @@ -0,0 +1,42 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#include "zend_sort.h" + +#define VM_TRACE(op) zend_vm_trace(execute_data, opline); +#define VM_TRACE_START() zend_vm_trace_init(); +#define VM_TRACE_END() zend_vm_trace_finish(); + +static FILE *vm_trace_file; + +static void zend_vm_trace(const zend_execute_data *execute_data, const zend_op *opline) +{ + if (EX(func) && EX(func)->op_array.filename) { + fprintf(vm_trace_file, "%s:%d\n", ZSTR_VAL(EX(func)->op_array.filename), opline->lineno); + } +} + +static void zend_vm_trace_finish(void) +{ + fclose(vm_trace_file); +} + +static void zend_vm_trace_init(void) +{ + vm_trace_file = fopen("zend_vm_trace.log", "w+"); +} diff --git a/include/php/Zend/zend_vm_trace_map.h b/include/php/Zend/zend_vm_trace_map.h new file mode 100644 index 0000000..d84aa04 --- /dev/null +++ b/include/php/Zend/zend_vm_trace_map.h @@ -0,0 +1,81 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#include "zend_vm_handlers.h" +#include "zend_sort.h" + +#define GEN_MAP(n, name) do { \ + ZVAL_LONG(&tmp, (zend_long)(uintptr_t)zend_opcode_handlers[n]); \ + zend_hash_str_add(&vm_trace_ht, #name, sizeof(#name) - 1, &tmp); \ + } while (0); + +#define VM_TRACE_START() do { \ + zval tmp; \ + zend_hash_init(&vm_trace_ht, 0, NULL, NULL, 1); \ + VM_HANDLERS(GEN_MAP) \ + zend_vm_trace_init(); \ + } while (0) + +#ifdef _WIN64 +# define ADDR_FMT "%016I64x" +#elif SIZEOF_SIZE_T == 4 +# define ADDR_FMT "%08zx" +#elif SIZEOF_SIZE_T == 8 +# define ADDR_FMT "%016zx" +#else +# error "Unknown SIZEOF_SIZE_T" +#endif + +static HashTable vm_trace_ht; + +static int zend_vm_trace_compare(const Bucket *p1, const Bucket *p2) +{ + if (Z_LVAL(p1->val) > Z_LVAL(p2->val)) { + return 1; + } else if (Z_LVAL(p1->val) < Z_LVAL(p2->val)) { + return -1; + } else { + return 0; + } +} + +static void zend_vm_trace_init(void) +{ + FILE *f; + zend_string *key, *prev_key; + zval *val; + zend_long prev_addr; + + f = fopen("zend_vm.map", "w+"); + if (f) { + zend_hash_sort(&vm_trace_ht, (bucket_compare_func_t)zend_vm_trace_compare, 0); + prev_key = NULL; + ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(&vm_trace_ht, key, val) { + if (prev_key) { + fprintf(f, ADDR_FMT" "ADDR_FMT" t %s\n", prev_addr, Z_LVAL_P(val) - prev_addr, ZSTR_VAL(prev_key)); + } + prev_key = key; + prev_addr = Z_LVAL_P(val); + } ZEND_HASH_FOREACH_END(); + if (prev_key) { + fprintf(f, ADDR_FMT" "ADDR_FMT" t %s\n", prev_addr, 0, ZSTR_VAL(prev_key)); + } + fclose(f); + } + zend_hash_destroy(&vm_trace_ht); +} diff --git a/include/php/Zend/zend_weakrefs.h b/include/php/Zend/zend_weakrefs.h new file mode 100644 index 0000000..5b1c8ea --- /dev/null +++ b/include/php/Zend/zend_weakrefs.h @@ -0,0 +1,74 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | 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. | + +----------------------------------------------------------------------+ + | Authors: krakjoe@php.net | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_WEAKREFS_H +#define ZEND_WEAKREFS_H + +#include "zend_alloc.h" + +BEGIN_EXTERN_C() + +extern ZEND_API zend_class_entry *zend_ce_weakref; + +void zend_register_weakref_ce(void); + +void zend_weakrefs_init(void); +void zend_weakrefs_shutdown(void); + +ZEND_API void zend_weakrefs_notify(zend_object *object); + +ZEND_API zval *zend_weakrefs_hash_add(HashTable *ht, zend_object *key, zval *pData); +ZEND_API zend_result zend_weakrefs_hash_del(HashTable *ht, zend_object *key); +static zend_always_inline void *zend_weakrefs_hash_add_ptr(HashTable *ht, zend_object *key, void *ptr) { + zval tmp, *zv; + ZVAL_PTR(&tmp, ptr); + if ((zv = zend_weakrefs_hash_add(ht, key, &tmp))) { + return Z_PTR_P(zv); + } else { + return NULL; + } +} + +/* Because php uses the raw numbers as a hash function, raw pointers will lead to hash collisions. + * We have a guarantee that the lowest ZEND_MM_ALIGNED_OFFSET_LOG2 bits of a pointer are zero. + * + * E.g. On most 64-bit platforms, pointers are aligned to 8 bytes, so the least significant 3 bits are always 0 and can be discarded. + * + * NOTE: This function is only used for EG(weakrefs) and zend_weakmap->ht. + * It is not used for the HashTable instances associated with ZEND_WEAKREF_TAG_HT tags (created in zend_weakref_register, which uses ZEND_WEAKREF_ENCODE instead). + * The ZEND_WEAKREF_TAG_HT instances are used to disambiguate between multiple weak references to the same zend_object. + */ +static zend_always_inline zend_ulong zend_object_to_weakref_key(const zend_object *object) +{ + ZEND_ASSERT(((uintptr_t)object) % ZEND_MM_ALIGNMENT == 0); + return ((uintptr_t) object) >> ZEND_MM_ALIGNMENT_LOG2; +} + +static zend_always_inline zend_object *zend_weakref_key_to_object(zend_ulong key) +{ + return (zend_object *) (((uintptr_t) key) << ZEND_MM_ALIGNMENT_LOG2); +} + +HashTable *zend_weakmap_get_gc(zend_object *object, zval **table, int *n); +HashTable *zend_weakmap_get_key_entry_gc(zend_object *object, zval **table, int *n); +HashTable *zend_weakmap_get_entry_gc(zend_object *object, zval **table, int *n); +HashTable *zend_weakmap_get_object_key_entry_gc(zend_object *object, zval **table, int *n); +HashTable *zend_weakmap_get_object_entry_gc(zend_object *object, zval **table, int *n); + +END_EXTERN_C() + +#endif + diff --git a/include/php/Zend/zend_weakrefs_arginfo.h b/include/php/Zend/zend_weakrefs_arginfo.h new file mode 100644 index 0000000..6bf859e --- /dev/null +++ b/include/php/Zend/zend_weakrefs_arginfo.h @@ -0,0 +1,88 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: d91889851d9732d41e43fffddb6235d033c67534 */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_WeakReference___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_WeakReference_create, 0, 1, WeakReference, 0) + ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakReference_get, 0, 0, IS_OBJECT, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_offsetGet, 0, 1, IS_MIXED, 0) + ZEND_ARG_INFO(0, object) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_offsetSet, 0, 2, IS_VOID, 0) + ZEND_ARG_INFO(0, object) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_offsetExists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, object) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_offsetUnset, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, object) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_WeakMap_getIterator, 0, 0, Iterator, 0) +ZEND_END_ARG_INFO() + + +ZEND_METHOD(WeakReference, __construct); +ZEND_METHOD(WeakReference, create); +ZEND_METHOD(WeakReference, get); +ZEND_METHOD(WeakMap, offsetGet); +ZEND_METHOD(WeakMap, offsetSet); +ZEND_METHOD(WeakMap, offsetExists); +ZEND_METHOD(WeakMap, offsetUnset); +ZEND_METHOD(WeakMap, count); +ZEND_METHOD(WeakMap, getIterator); + + +static const zend_function_entry class_WeakReference_methods[] = { + ZEND_ME(WeakReference, __construct, arginfo_class_WeakReference___construct, ZEND_ACC_PUBLIC) + ZEND_ME(WeakReference, create, arginfo_class_WeakReference_create, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(WeakReference, get, arginfo_class_WeakReference_get, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_WeakMap_methods[] = { + ZEND_ME(WeakMap, offsetGet, arginfo_class_WeakMap_offsetGet, ZEND_ACC_PUBLIC) + ZEND_ME(WeakMap, offsetSet, arginfo_class_WeakMap_offsetSet, ZEND_ACC_PUBLIC) + ZEND_ME(WeakMap, offsetExists, arginfo_class_WeakMap_offsetExists, ZEND_ACC_PUBLIC) + ZEND_ME(WeakMap, offsetUnset, arginfo_class_WeakMap_offsetUnset, ZEND_ACC_PUBLIC) + ZEND_ME(WeakMap, count, arginfo_class_WeakMap_count, ZEND_ACC_PUBLIC) + ZEND_ME(WeakMap, getIterator, arginfo_class_WeakMap_getIterator, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static zend_class_entry *register_class_WeakReference(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "WeakReference", class_WeakReference_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; + + return class_entry; +} + +static zend_class_entry *register_class_WeakMap(zend_class_entry *class_entry_ArrayAccess, zend_class_entry *class_entry_Countable, zend_class_entry *class_entry_IteratorAggregate) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "WeakMap", class_WeakMap_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; + zend_class_implements(class_entry, 3, class_entry_ArrayAccess, class_entry_Countable, class_entry_IteratorAggregate); + + return class_entry; +} diff --git a/include/php/ext/date/lib/timelib.h b/include/php/ext/date/lib/timelib.h new file mode 100644 index 0000000..4582fcf --- /dev/null +++ b/include/php/ext/date/lib/timelib.h @@ -0,0 +1,1104 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2015-2023 Derick Rethans + * Copyright (c) 2018,2021 MongoDB, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef __TIMELIB_H__ +#define __TIMELIB_H__ + +#ifdef HAVE_TIMELIB_CONFIG_H +# include "timelib_config.h" +#endif + +#define TIMELIB_VERSION 202210 +#define TIMELIB_EXTENDED_VERSION 20221001 +#define TIMELIB_ASCII_VERSION "2022.10" + +#include +#include +#include +#include + +# ifndef HAVE_INT32_T +# if SIZEOF_INT == 4 +typedef int int32_t; +# elif SIZEOF_LONG == 4 +typedef long int int32_t; +# endif +# endif + +# ifndef HAVE_UINT32_T +# if SIZEOF_INT == 4 +typedef unsigned int uint32_t; +# elif SIZEOF_LONG == 4 +typedef unsigned long int uint32_t; +# endif +# endif + +#ifdef _WIN32 +# if _MSC_VER >= 1600 +# include +# endif +# ifndef SIZEOF_INT +# define SIZEOF_INT 4 +# endif +# ifndef SIZEOF_LONG +# define SIZEOF_LONG 4 +# endif +# ifndef int32_t +typedef __int32 int32_t; +# endif +# ifndef uint32_t +typedef unsigned __int32 uint32_t; +# endif +# ifndef int64_t +typedef __int64 int64_t; +# endif +# ifndef uint64_t +typedef unsigned __int64 uint64_t; +# endif +# ifndef PRId32 +# define PRId32 "I32d" +# endif +# ifndef PRIu32 +# define PRIu32 "I32u" +# endif +# ifndef PRId64 +# define PRId64 "I64d" +# endif +# ifndef PRIu64 +# define PRIu64 "I64u" +# endif +# ifndef INT32_MAX +#define INT32_MAX _I32_MAX +# endif +# ifndef INT32_MIN +#define INT32_MIN ((int32_t)_I32_MIN) +# endif +# ifndef UINT32_MAX +#define UINT32_MAX _UI32_MAX +# endif +# ifndef INT64_MIN +#define INT64_MIN ((int64_t)_I64_MIN) +# endif +# ifndef INT64_MAX +#define INT64_MAX _I64_MAX +# endif +# ifndef UINT64_MAX +#define UINT64_MAX _UI64_MAX +# endif +#endif + +#if (defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)) && !defined(TIMELIB_FORCE_LONG32) +typedef int64_t timelib_long; +typedef uint64_t timelib_ulong; +# define TIMELIB_LONG_MAX INT64_MAX +# define TIMELIB_LONG_MIN INT64_MIN +# define TIMELIB_ULONG_MAX UINT64_MAX +# define TIMELIB_LONG_FMT "%" PRId64 +# define TIMELIB_ULONG_FMT "%" PRIu64 +#else +typedef int32_t timelib_long; +typedef uint32_t timelib_ulong; +# define TIMELIB_LONG_MAX INT32_MAX +# define TIMELIB_LONG_MIN INT32_MIN +# define TIMELIB_ULONG_MAX UINT32_MAX +# define TIMELIB_LONG_FMT "%" PRId32 +# define TIMELIB_ULONG_FMT "%" PRIu32 +#endif + +#if defined(_MSC_VER) +typedef uint64_t timelib_ull; +typedef int64_t timelib_sll; +# define TIMELIB_LL_CONST(n) n ## i64 +#else +typedef unsigned long long timelib_ull; +typedef signed long long timelib_sll; +# define TIMELIB_LL_CONST(n) n ## ll +#endif + +typedef struct _ttinfo ttinfo; +typedef struct _tlinfo tlinfo; + +typedef struct _tlocinfo +{ + char country_code[3]; + double latitude; + double longitude; + char *comments; +} tlocinfo; + +#define TIMELIB_POSIX_TRANS_TYPE_JULIAN_NO_FEB29 1 +#define TIMELIB_POSIX_TRANS_TYPE_JULIAN_FEB29 2 +#define TIMELIB_POSIX_TRANS_TYPE_MWD 3 + +typedef struct _timelib_posix_trans_info +{ + int type; // 1=Jn, 2=n, 3=Mm.w.d + union { + int days; + struct { + int month; + int week; + int dow; + } mwd; + }; + int hour; +} timelib_posix_trans_info; + +typedef struct _timelib_posix_str +{ + char *std; + timelib_sll std_offset; + char *dst; + timelib_sll dst_offset; + + timelib_posix_trans_info *dst_begin; + timelib_posix_trans_info *dst_end; + + int type_index_std_type; // index into tz->type + int type_index_dst_type; // index into tz->type +} timelib_posix_str; + +typedef struct _timelib_posix_transitions { + size_t count; + timelib_sll times[6]; + timelib_sll types[6]; +} timelib_posix_transitions; + +typedef struct _timelib_tzinfo +{ + char *name; + struct { + uint32_t ttisgmtcnt; + uint32_t ttisstdcnt; + uint32_t leapcnt; + uint32_t timecnt; + uint32_t typecnt; + uint32_t charcnt; + } _bit32; + struct { + uint64_t ttisgmtcnt; + uint64_t ttisstdcnt; + uint64_t leapcnt; + uint64_t timecnt; + uint64_t typecnt; + uint64_t charcnt; + } bit64; + + int64_t *trans; + unsigned char *trans_idx; + + ttinfo *type; + char *timezone_abbr; + + tlinfo *leap_times; + unsigned char bc; + tlocinfo location; + + char *posix_string; + timelib_posix_str *posix_info; +} timelib_tzinfo; + +typedef struct _timelib_rel_time { + timelib_sll y, m, d; /* Years, Months and Days */ + timelib_sll h, i, s; /* Hours, mInutes and Seconds */ + timelib_sll us; /* Microseconds */ + + int weekday; /* Stores the day in 'next monday' */ + int weekday_behavior; /* 0: the current day should *not* be counted when advancing forwards; 1: the current day *should* be counted */ + + int first_last_day_of; + int invert; /* Whether the difference should be inverted */ + timelib_sll days; /* Contains the number of *days*, instead of Y-M-D differences */ + + struct { + unsigned int type; + timelib_sll amount; + } special; + + unsigned int have_weekday_relative, have_special_relative; +} timelib_rel_time; + +typedef struct _timelib_time_offset { + int32_t offset; + unsigned int leap_secs; + unsigned int is_dst; + char *abbr; + timelib_sll transition_time; +} timelib_time_offset; + +typedef struct _timelib_time { + timelib_sll y, m, d; /* Year, Month, Day */ + timelib_sll h, i, s; /* Hour, mInute, Second */ + timelib_sll us; /* Microseconds */ + int z; /* UTC offset in seconds */ + char *tz_abbr; /* Timezone abbreviation (display only) */ + timelib_tzinfo *tz_info; /* Timezone structure */ + signed int dst; /* Flag if we were parsing a DST zone */ + timelib_rel_time relative; + + timelib_sll sse; /* Seconds since epoch */ + + unsigned int have_time, have_date, have_zone, have_relative, have_weeknr_day; + + unsigned int sse_uptodate; /* !0 if the sse member is up to date with the date/time members */ + unsigned int tim_uptodate; /* !0 if the date/time members are up to date with the sse member */ + unsigned int is_localtime; /* 1 if the current struct represents localtime, 0 if it is in GMT */ + unsigned int zone_type; /* 1 time offset, + * 3 TimeZone identifier, + * 2 TimeZone abbreviation */ +} timelib_time; + +typedef struct _timelib_abbr_info { + timelib_sll utc_offset; + char *abbr; + int dst; +} timelib_abbr_info; + +#define TIMELIB_WARN_MASK 0x1ff +#define TIMELIB_ERR_MASK 0x2ff + +#define TIMELIB_WARN_DOUBLE_TZ 0x101 +#define TIMELIB_WARN_INVALID_TIME 0x102 +#define TIMELIB_WARN_INVALID_DATE 0x103 +#define TIMELIB_WARN_TRAILING_DATA 0x11a + +#define TIMELIB_ERR_DOUBLE_TZ 0x201 +#define TIMELIB_ERR_TZID_NOT_FOUND 0x202 +#define TIMELIB_ERR_DOUBLE_TIME 0x203 +#define TIMELIB_ERR_DOUBLE_DATE 0x204 +#define TIMELIB_ERR_UNEXPECTED_CHARACTER 0x205 +#define TIMELIB_ERR_EMPTY_STRING 0x206 +#define TIMELIB_ERR_UNEXPECTED_DATA 0x207 +#define TIMELIB_ERR_NO_TEXTUAL_DAY 0x208 +#define TIMELIB_ERR_NO_TWO_DIGIT_DAY 0x209 +#define TIMELIB_ERR_NO_THREE_DIGIT_DAY_OF_YEAR 0x20a +#define TIMELIB_ERR_NO_TWO_DIGIT_MONTH 0x20b +#define TIMELIB_ERR_NO_TEXTUAL_MONTH 0x20c +#define TIMELIB_ERR_NO_TWO_DIGIT_YEAR 0x20d +#define TIMELIB_ERR_NO_FOUR_DIGIT_YEAR 0x20e +#define TIMELIB_ERR_NO_TWO_DIGIT_HOUR 0x20f +#define TIMELIB_ERR_HOUR_LARGER_THAN_12 0x210 +#define TIMELIB_ERR_MERIDIAN_BEFORE_HOUR 0x211 +#define TIMELIB_ERR_NO_MERIDIAN 0x212 +#define TIMELIB_ERR_NO_TWO_DIGIT_MINUTE 0x213 +#define TIMELIB_ERR_NO_TWO_DIGIT_SECOND 0x214 +#define TIMELIB_ERR_NO_SIX_DIGIT_MICROSECOND 0x215 +#define TIMELIB_ERR_NO_SEP_SYMBOL 0x216 +#define TIMELIB_ERR_EXPECTED_ESCAPE_CHAR 0x217 +#define TIMELIB_ERR_NO_ESCAPED_CHAR 0x218 +#define TIMELIB_ERR_WRONG_FORMAT_SEP 0x219 +#define TIMELIB_ERR_TRAILING_DATA 0x21a +#define TIMELIB_ERR_DATA_MISSING 0x21b +#define TIMELIB_ERR_NO_THREE_DIGIT_MILLISECOND 0x21c +#define TIMELIB_ERR_NO_FOUR_DIGIT_YEAR_ISO 0x21d +#define TIMELIB_ERR_NO_TWO_DIGIT_WEEK 0x21e +#define TIMELIB_ERR_INVALID_WEEK 0x21f +#define TIMELIB_ERR_NO_DAY_OF_WEEK 0x220 +#define TIMELIB_ERR_INVALID_DAY_OF_WEEK 0x221 +#define TIMELIB_ERR_INVALID_SPECIFIER 0x222 +#define TIMELIB_ERR_INVALID_TZ_OFFSET 0x223 +#define TIMELIB_ERR_FORMAT_LITERAL_MISMATCH 0x224 +#define TIMELIB_ERR_MIX_ISO_WITH_NATURAL 0x225 +#define TIMELIB_ERR_NUMBER_OUT_OF_RANGE 0x226 + +#define TIMELIB_ZONETYPE_NONE 0 +#define TIMELIB_ZONETYPE_OFFSET 1 +#define TIMELIB_ZONETYPE_ABBR 2 +#define TIMELIB_ZONETYPE_ID 3 + +typedef struct _timelib_error_message { + int error_code; + int position; + char character; + char *message; +} timelib_error_message; + +typedef struct _timelib_error_container { + timelib_error_message *error_messages; + timelib_error_message *warning_messages; + int error_count; + int warning_count; +} timelib_error_container; + +typedef struct _timelib_tz_lookup_table { + const char *name; + int type; + float gmtoffset; + const char *full_tz_name; +} timelib_tz_lookup_table; + +typedef struct _timelib_tzdb_index_entry { + char *id; + unsigned int pos; +} timelib_tzdb_index_entry; + +typedef struct _timelib_tzdb { + const char *version; + int index_size; + const timelib_tzdb_index_entry *index; + const unsigned char *data; +} timelib_tzdb; + +#ifndef timelib_malloc +# define timelib_malloc malloc +# define timelib_realloc realloc +# define timelib_calloc calloc +# define timelib_strdup strdup +# define timelib_free free +# if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) +# define TIMELIB_USE_BUILTIN_STRNDUP 1 +# else +# define TIMELIB_USE_BUILTIN_STRNDUP 0 +# define timelib_strndup strndup +# endif +#endif + +#define TIMELIB_NONE 0x00 +#define TIMELIB_OVERRIDE_TIME 0x01 +#define TIMELIB_NO_CLONE 0x02 + +#define TIMELIB_UNSET -9999999 + +/* An entry for each of these error codes is also in the + * timelib_error_messages array in timelib.c. + * Codes 0x00, 0x07, and 0x09 are warnings only. */ +#define TIMELIB_ERROR_NO_ERROR 0x00 +#define TIMELIB_ERROR_CANNOT_ALLOCATE 0x01 +#define TIMELIB_ERROR_CORRUPT_TRANSITIONS_DONT_INCREASE 0x02 +#define TIMELIB_ERROR_CORRUPT_NO_64BIT_PREAMBLE 0x03 +#define TIMELIB_ERROR_CORRUPT_NO_ABBREVIATION 0x04 +#define TIMELIB_ERROR_UNSUPPORTED_VERSION 0x05 +#define TIMELIB_ERROR_NO_SUCH_TIMEZONE 0x06 +#define TIMELIB_ERROR_SLIM_FILE 0x07 /* Warns if the file is SLIM, but we can't read it */ +#define TIMELIB_ERROR_CORRUPT_POSIX_STRING 0x08 +#define TIMELIB_ERROR_EMPTY_POSIX_STRING 0x09 /* Warns if the POSIX string is empty, but still produces results */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _timelib_format_specifier_code { + TIMELIB_FORMAT_ALLOW_EXTRA_CHARACTERS = 0, + TIMELIB_FORMAT_ANY_SEPARATOR, + TIMELIB_FORMAT_DAY_TWO_DIGIT, + TIMELIB_FORMAT_DAY_TWO_DIGIT_PADDED, + TIMELIB_FORMAT_DAY_OF_WEEK_ISO, + TIMELIB_FORMAT_DAY_OF_WEEK, + TIMELIB_FORMAT_DAY_OF_YEAR, + TIMELIB_FORMAT_DAY_SUFFIX, + TIMELIB_FORMAT_END, + TIMELIB_FORMAT_EPOCH_SECONDS, + TIMELIB_FORMAT_ESCAPE, + TIMELIB_FORMAT_HOUR_TWO_DIGIT_12_MAX, + TIMELIB_FORMAT_HOUR_TWO_DIGIT_12_MAX_PADDED, + TIMELIB_FORMAT_HOUR_TWO_DIGIT_24_MAX, + TIMELIB_FORMAT_HOUR_TWO_DIGIT_24_MAX_PADDED, + TIMELIB_FORMAT_LITERAL, + TIMELIB_FORMAT_MERIDIAN, + TIMELIB_FORMAT_MICROSECOND_SIX_DIGIT, + TIMELIB_FORMAT_MILLISECOND_THREE_DIGIT, + TIMELIB_FORMAT_MINUTE_TWO_DIGIT, + TIMELIB_FORMAT_MONTH_TWO_DIGIT, + TIMELIB_FORMAT_MONTH_TWO_DIGIT_PADDED, + TIMELIB_FORMAT_RANDOM_CHAR, + TIMELIB_FORMAT_RESET_ALL, + TIMELIB_FORMAT_RESET_ALL_WHEN_NOT_SET, + TIMELIB_FORMAT_SECOND_TWO_DIGIT, + TIMELIB_FORMAT_SEPARATOR, + TIMELIB_FORMAT_SKIP_TO_SEPARATOR, + TIMELIB_FORMAT_TEXTUAL_DAY_3_LETTER, + TIMELIB_FORMAT_TEXTUAL_DAY_FULL, + TIMELIB_FORMAT_TEXTUAL_MONTH_3_LETTER, + TIMELIB_FORMAT_TEXTUAL_MONTH_FULL, + TIMELIB_FORMAT_TIMEZONE_OFFSET, + TIMELIB_FORMAT_TIMEZONE_OFFSET_MINUTES, + TIMELIB_FORMAT_WEEK_OF_YEAR_ISO, + TIMELIB_FORMAT_WEEK_OF_YEAR, + TIMELIB_FORMAT_WHITESPACE, + TIMELIB_FORMAT_YEAR_TWO_DIGIT, + TIMELIB_FORMAT_YEAR_FOUR_DIGIT, + TIMELIB_FORMAT_YEAR_EXPANDED, + TIMELIB_FORMAT_YEAR_ISO +} timelib_format_specifier_code; + +typedef struct _timelib_format_specifier { + char specifier; + timelib_format_specifier_code code; +} timelib_format_specifier; + +typedef struct _timelib_format_config { + const timelib_format_specifier *format_map; + /* Format speciifiers must be preceded by 'prefix_char' if not '\0'. */ + char prefix_char; +} timelib_format_config; + +/* Function pointers */ +typedef timelib_tzinfo* (*timelib_tz_get_wrapper)(const char *tzname, const timelib_tzdb *tzdb, int *error_code); + +/* From dow.c */ +/* Calculates the day of the week from y, m, and d. 0=Sunday..6=Saturday */ +timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d); + +/* Calculates the day of the ISO week from y, m, and d. 1=Monday, 7=Sunday */ +timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d); + +/* Calculates the day of the year according to y-m-d. 0=Jan 1st..364/365=Dec + * 31st */ +timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d); + +/* Calculates the day of the year according to y-w-dow. 0..364/365 */ +timelib_sll timelib_daynr_from_weeknr(timelib_sll iy, timelib_sll iw, timelib_sll id); + +/* Calculates the number of days in month m for year y. 28..31 */ +timelib_sll timelib_days_in_month(timelib_sll y, timelib_sll m); + +/* Calculates the ISO year and week from y, m, and d, into iw and iy */ +void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, timelib_sll *iw, timelib_sll *iy); + +/* Calculates the ISO year, week, and day of week from y, m, and d, into iy, + * iw, and id */ +void timelib_isodate_from_date(timelib_sll y, timelib_sll m, timelib_sll d, timelib_sll *iy, timelib_sll *iw, timelib_sll *id); + +/* Calculates the year, month, and day from iy, iw, and iw, into y, m, and d */ +void timelib_date_from_isodate(timelib_sll iy, timelib_sll iw, timelib_sll id, timelib_sll *y, timelib_sll *m, timelib_sll *d); + +/* Returns true if h, i and s fit in the range 00:00:00..23:59:59, false + * otherwise */ +int timelib_valid_time(timelib_sll h, timelib_sll i, timelib_sll s); + +/* Returns true if m fits in the range 1..12, and d fits in the range + * 1.. for year y */ +int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d); + +/* From parse_date.re */ + +/* Parses the date/time string in 's' with length 'len' into the constituent + * parts of timelib_time*. + * + * Depending on the contents of the string 's', not all elements might be + * filled. You can check whether a specific element has been parsed by + * comparing with the TIMELIB_UNSET define. + * + * If errors occur, this function keeps already parsed elements in the + * returned timelib_time* value. + * + * If the **errors points to a timelib_error_container variable, warnings + * and errors will be recorded. You are responsible for freeing the stored + * information with timelib_error_container_dtor(). To see whether errors have + * occurred, inspect errors->errors_count. To see whether warnings have occurred, + * inspect errors->warnings_count. + * + * The returned timelib_time* value is dynamically allocated and should be + * freed with timelib_time_dtor(). + */ +timelib_time *timelib_strtotime(const char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper); + +/* Parses the date/time string in 's' with length 'len' into the constituent + * parts of timelib_time* according to the format in 'format'. + * + * Depending on the contents of the string 's', not all elements might be + * filled. You can check whether a specific element has been parsed by + * comparing with the TIMELIB_UNSET define. + * + * If errors occur, this function keeps already parsed elements in the + * returned timelib_time* value. + * + * If the **errors points to a timelib_error_container variable, warnings + * and errors will be recorded. You are responsible for freeing the stored + * information with timelib_error_container_dtor(). To see whether errors have + * occurred, inspect errors->errors_count. To see whether warnings have occurred, + * inspect errors->warnings_count. + * + * The returned timelib_time* value is dynamically allocated and should be + * freed with timelib_time_dtor(). + */ +timelib_time *timelib_parse_from_format(const char *format, const char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper); + +/* Parses the date/time string in 's' with length 'len' into the constituent + * parts of timelib_time* according to the format in 'format' with format + * specifier configuration 'format_config'. + * + * 'format_map' is an array of pairs, with the first element being the format + * specifier as a character and the second element corresponds to the + * representation of the specifier from the enum list + * 'timelib_format_specifier_code'. + * + * Note: 'format_map' must be terminated with specifier '\0' to indicate to the + * parser that there are no more format specifiers in the list. + */ +timelib_time *timelib_parse_from_format_with_map(const char *format, const char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper, const timelib_format_config* format_config); + +/* Fills the gaps in the parsed timelib_time with information from the reference date/time in 'now' + * + * If any of the 'parsed' y, m, d, h, i or s parameters is unset (TIMELIB_UNSET): + * - if microtime (us) is unset, then the us of the parsed time is set to 0. + * - else if microtime (us) is unset and 'now'->'us' is set, use it, otherwise use 0. + * + * For either of the 'parsed' y, m, d, h, i, s, z (utc offset in seconds) or + * dst is unset, set it to the corresponding value in 'now' if set, otherwise + * set it to 0. + * + * It duplicates tz_abbr if unset in 'parsed' but set in 'now'. + * + * It duplicates tz_info if unset in 'parsed', but set in 'now' unless + * TIMELIB_NO_CLONE is passed, in which case only the pointer in 'parsed' is + * set to 'now'. + * + * If the option TIMELIB_OVERRIDE_TIME is passed and the parsed date/time has + * no time portion, the function will ignore the time aspect in 'now' and + * instead fill it with zeros. + */ +void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options); + +/* Tries to convert a time zone abbreviation, gmtoffset and/or isdst flag + * combination to a time zone identifier. + * + * If 'abbr' is either 'utc' or 'gmt' (case insensitve) then "UTC" is + * returned. + * + * It first uses the data in the timezonemap.h file to find a matching + * abbreviation/GMT offset combination. If not found, it uses the data in + * fallbackmap.h to match only the GMT offset/isdst flag to try to find a + * match. If nothing is found, NULL is returned. + * + * The returned char* is not duplicated, and should not be freed. + */ +const char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst); + +/* Returns an array of known time zone abbreviations + * + * This file is generated from the time zone database through the + * gettzmapping.php scripts, which requires that an up-to-date time zone + * database is used with the PHP binary that runs the script. + * + * Each item in the returned list contains the abbreviation, a flag whether + * it's an abbreviation used with DST, the UTC offset in seconds, and the name + * of the time zone identifier that this abbreviation belongs to. + * + * The order for each specific abbreviation is controlled through the + * preference list in the gettzmapping.php script. Time zones that match the + * pattern ±\d{2,4} are excluded + */ +const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void); + +/** + * DEPRECATED, but still used by PHP. + */ +timelib_long timelib_parse_zone(const char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper); + +/* From parse_iso_intervals.re */ + +/** + * Parses a subset of an ISO 8601 intervals specification string into its + * constituent parts. + * + * If the **errors points to a timelib_error_container variable, warnings + * and errors will be recorded. You are responsible for freeing the stored + * information with timelib_error_container_dtor(). To see whether errors have + * occurred, inspect errors->errors_count. To see whether warnings have occurred, + * inspect errors->warnings_count. + */ +void timelib_strtointerval(const char *s, size_t len, + timelib_time **begin, timelib_time **end, + timelib_rel_time **period, int *recurrences, + timelib_error_container **errors); + + +/* From tm2unixtime.c */ + +/** + * Uses the y/m/d/h/i/s fields to calculate and store the equivalent timestamp + * in the sse field. + * + * It uses the time zone information associated with 'time' to account for the + * right UTC offset and/or DST rules. You can associate time zone information + * with the timelib_set_timezone_* functions (see below). + * + * If the type is 'TIMELIB_ZONETYPE_ID' and there is no associated tzinfo, it + * will use the second argument 'tzi' to provide the rules necessary to + * calculate the right timestamp. + */ +void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi); + +/** + * Returns the number of days from the y/m/d fields of 'time' since the Unix + * Epoch. + */ +timelib_sll timelib_epoch_days_from_time(timelib_time *time); + +/** + * Takes the information from the y/m/d/h/i/s fields and makes sure their + * values are in the right range. + * + * If a value under- or overflows it will adjust the larger measure up (or + * down). It also takes into account leap days. + */ +void timelib_do_normalize(timelib_time *base); + +/** + * Takes the information from the y/m/d/h/i/s fields of 'rt' and makes sure + * their values are in the right range. + * + * If a value under- or overflows it will adjust the larger measure up (or + * down). As this function operates on a *relative date/time*, it also takes + * into account leap days and correctly accounts for the difference depending + * on the base date/time in 'base'. + */ +void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt); + +/* From unixtime2tm.c */ + +/** + * Takes the unix timestamp in seconds from 'ts', and calculates y, m, and d, + * in the proleptic Gregorian calendar. + * + * It uses the algorithm from howardhinnant.github.io/date_algorithms.html + */ +void timelib_unixtime2date(timelib_sll ts, timelib_sll *y, timelib_sll *m, timelib_sll *d); + +/** + * Takes the unix timestamp in seconds from 'ts' and populates the y/m/d/h/i/s + * fields of 'tm' without taking time zones into account + */ +void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts); + +/** + * Takes the Unix timestamp from 'ts', and calculates the y/m/d/h/i/s fields + * according to the time zone information attached to 'tm'. + */ +void timelib_unixtime2local(timelib_time *tm, timelib_sll ts); + +/** + * Takes the Unix timestamp stored in 'tm', and calculates the y/m/d/h/i/s + * fields according to the time zone information attached to 'tm'. + */ +void timelib_update_from_sse(timelib_time *tm); + +/** + * Attaches the UTC offset as time zone information to 't'. + * + * 'utc_offset' is in seconds East of UTC. + */ +void timelib_set_timezone_from_offset(timelib_time *t, timelib_sll utc_offset); + +/** + * Attaches the information from 'abbr_info' as time zone information to 't'. + * + * The timelib_abbr_info struct contains an abbreviation ('abbr') which string + * value is duplicated, as well as a 'utc_offset' and 'dst' flag. It only + * supports a 'dst' change over of 1 hour. + */ +void timelib_set_timezone_from_abbr(timelib_time *t, timelib_abbr_info abbr_info); + +/** + * Attaches the time zone information in 'tz' to to 't'. + * + * It fetches the right UTC offset that is currently stored in the time + * stamp field in 't' ('sse'), and assigns that to the 'z' field and 'dst' + * field (whether DST is in effect at the time). It also sets the current + * abbreviation to the 'tz_addr' field, making sure that if a value was already + * set it was freed. + * + * The time zone information in 'tz' is *not* duplicated into the 't' field so + * it should not be freed until all timelib_time* variables have been freed as + * well. + */ +void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz); + +/* From parse_tz.c */ + +/** + * Returns whether the time zone ID 'timezone' is available in the time zone + * database as pointed to be 'tzdb'. + */ +int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb); + +/** + * Converts the binary stored time zone information from 'tzdb' for the time + * zone 'timezone' into a structure the library can use for calculations. + * + * The function can be used on both timelib_builtin_db as well as a time zone + * db as opened by timelib_zoneinfo. + * + * 'error_code' must not be a null pointer, and will always be written to. If + * the value is TIMELIB_ERROR_NO_ERROR then the file was parsed without + * problems. + * + * The function will return null upon failure, and also set an error code + * through 'error_code'. + * + * The error code is one of the TIMELIB_ERROR_* constants as listed above. + * These error constants can be converted into a string by + * timelib_get_error_message. + * + * If the function returns not-null, the 'error_code' might have a non-null + * value that can be used to detect incompatibilities. The only one that is + * currently detected is whether the file is a 'slim' file, in which case + * 'error_code' will be set to TIMELIB_ERROR_SLIM_FILE. + * + * This function allocates memory for the new time zone structure, which must + * be freed after use. Although it is recommended that a cache of each used + * time zone is kept. + */ +timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code); + +/** + * Frees up the resources allocated by 'timelib_parse_tzfile'. + */ +void timelib_tzinfo_dtor(timelib_tzinfo *tz); + +/** + * Deep-clones a timelib_tzinfo structure. + * + * This allocates resources that need to be freed with 'timelib_tzinfo_dtor' + */ +timelib_tzinfo* timelib_tzinfo_clone(timelib_tzinfo *tz); + +/** + * Returns whether DST is active with time zone 'tz' for the time stamp 'ts'. + * + * Returns 0 if DST is not active, 1 if DST is active, or -1 if no transitions + * were available through 'tz'. + */ +int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz); + +/** + * Returns offset information with time zone 'tz' for the time stamp 'ts'. + * + * The returned information contains: the offset in seconds East of UTC (in + * 'offset'), whether DST is active ('is_dst'), what the current time zone + * abbreviation is ('abbr') and the transition time that got to this state (in + * 'transition_time'); + */ +timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *tz); + +/** + * Returns offset information with time zone 'tz' for the time stamp 'ts'. + * + * The returned information contains: the offset in seconds East of UTC (in + * the output parameter 'offset'), whether DST is active (in the output + * parameter 'is_dst'), and the transition time that got to this state (in + * the output parameter 'transition_time'); if NULL is passed, the value is + * not retrieved + * + * Returns 1 if successful, 0 for failure. + */ +int timelib_get_time_zone_offset_info(timelib_sll ts, timelib_tzinfo *tz, int32_t* offset, timelib_sll* transition_time, unsigned int* is_dst); + +/** + * Returns the UTC offset currently applicable for the information stored in 't'. + * + * The value returned is the UTC offset in seconds East. + */ +timelib_sll timelib_get_current_offset(timelib_time *t); + +/** + * Returns whether the timezone information in *one and *two are the same + * + * A timezone is considered the same if: + * - the ->zone_type values are the same for *one and *two + * - for TYPE_ABBR and TYPE_OFFSET, ->z + (->dst * 3600), is the same + * - for TYPE_ID, the zone's names are the same + */ +int timelib_same_timezone(timelib_time *one, timelib_time *two); + +/** + * Displays debugging information about the time zone information in 'tz'. + */ +void timelib_dump_tzinfo(timelib_tzinfo *tz); + +/** + * Returns a pointer to the built-in time zone database. + * + * You must *not* free the returned pointer as it is part of the text segment. + */ +const timelib_tzdb *timelib_builtin_db(void); + +/** + * Returns a pointer to the start of an array containing a list of timezone identifiers. + * + * The amount of entries in the array is returned through the 'count' OUT parameter. + * + * Each entry contains the time zone ID ('id' field), and the position within the time zone + * information ('pos' field). The pos field should not be used. + */ +const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count); + +/* From parse_zoneinfo.c */ + +/** + * Scans the directory and subdirectories of 'directory' for valid time zone files and builds + * a time zone database out of these files. + * + * Typically, the directory should point to '/usr/share/zoneinfo'. + * + * Unlike 'timelib_builtin_db', the return value of this function must be freed + * with the 'timelib_zoneinfo_dtor' function. + */ +timelib_tzdb *timelib_zoneinfo(const char *directory); + +/** + * Frees up the resources as created through 'timelib_zoneinfo'. + * + * This function must be used to free up all the resources that have been + * allocated while calling 'timelib_zoneinfo'. + */ +void timelib_zoneinfo_dtor(timelib_tzdb *tzdb); + +/* From timelib.c */ + +/** + * Returns a static string containing an error message belonging to a specific + * error code. + */ +const char *timelib_get_error_message(int error_code); + +/** + * Allocates resources for the relative time structure. + * + * Must be freed with 'timelib_rel_time_dtor'. + */ +timelib_rel_time* timelib_rel_time_ctor(void); + +/** + * Frees up the resources as allocated through 'timelib_rel_time_ctor'. + */ +void timelib_rel_time_dtor(timelib_rel_time* t); + +/** + * Creates a new timelib_rel_time resource and copies over the information + * from 'tz'. + * + * Must be freed with 'timelib_rel_time_dtor'. + */ +timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *tz); + +/** + * Allocates resources for the time structure. + * + * Must be freed with 'timelib_time_dtor'. + */ +timelib_time* timelib_time_ctor(void); + +/** + * Frees up the resources as allocated through 'timelib_time_ctor'. + */ +void timelib_time_dtor(timelib_time* t); + +/** + * Creates a new timelib_time resource and copies over the information + * from 'orig'. + * + * Must be freed with 'timelib_time_dtor'. + */ +timelib_time* timelib_time_clone(timelib_time* orig); + +/** + * Compares two timelib_time structures and returns which one is earlier in + * time. + * + * To decide which comes earlier it uses the 'sse' (Seconds Since Epoch) and + * 'us' (microseconds) fields. + * + * Returns -1 if t1 < t2, 0 if t1 == t2, and -1 if t1 > t2. + */ +int timelib_time_compare(timelib_time *t1, timelib_time *t2); + +/** + * Allocates resources for the time offset structure. + * + * Must be freed with 'timelib_time_offset_dtor'. + */ +timelib_time_offset* timelib_time_offset_ctor(void); + +/** + * Frees up the resources as allocated through 'timelib_time_offset_ctor'. + */ +void timelib_time_offset_dtor(timelib_time_offset* t); + +/** + * Frees up the resources allocated while converting strings to timelib_time + * structures with the timelib_strtotime and timelib_strtointerval functions. + */ +void timelib_error_container_dtor(timelib_error_container *errors); + +/** + * Converts the 'sse' value of 'd' to a timelib_long type. + * + * If the value fits in the TIMELIB_LONG_MIN and TIMELIB_LONG_MAX range, the + * value is cast to (timelib_long) and returned. If *error is not a NULL + * pointer, it will be set to 0. + * + * If the value does *not* fit in the range, the function returns 0 and if + * *error is not a NULL pointer, it will be set to 1. + * + * timelib_long is a 32 bit signed long integer on 32 bit platforms, and a 64 + * bit signed long long integer on 64 bit platforms. In other words, it makes + * sure that the value in 'sse' (which is always a signed long long 64 bit + * integer) can be used safely outside of the library. + */ +timelib_long timelib_date_to_int(timelib_time *d, int *error); + +/** + * Displays debugging information about the date/time information stored in 'd'. + * + * 'options' is a bit field, where: + * - 1 controls whether the relative time portion is shown. + * - 2 controls whether the zone type is shown. + */ +void timelib_dump_date(timelib_time *d, int options); + +/** + * Displays debugging information about the relative time information stored + * in 'd'. + */ +void timelib_dump_rel_time(timelib_rel_time *d); + +/** + * Converts a decimal hour into hour/min/sec components + */ +void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec); + +/** + * Converts hour/min/sec values into a decimal hour + */ +void timelib_hms_to_decimal_hour(int hour, int min, int sec, double *h); + +/** + * Converts hour/min/sec/micro sec values into a decimal hour + */ +void timelib_hmsf_to_decimal_hour(int hour, int min, int sec, int us, double *h); + +/** + * Converts hour/min/sec values into seconds + */ +timelib_sll timelib_hms_to_seconds(timelib_sll h, timelib_sll m, timelib_sll s); + + +/* from astro.c */ + +/** + * Converts the Unix Epoch time stamp 'ts' to a Julian Day + * + * The value returned is the number of whole days since -4714-11-24T12:00:00 UTC + * (in the proleptic Gregorian calendar): + * https://en.wikipedia.org/wiki/Julian_day + */ +double timelib_ts_to_julianday(timelib_sll ts); + +/** + * Converts the Unix Epoch time stamp 'ts' to the J2000 epoch + * + * The value returned is the number of whole days since 2000-01-01T12:00:00 + * UTC: https://en.wikipedia.org/wiki/Epoch_(astronomy)#Julian_years_and_J2000 + */ +double timelib_ts_to_j2000(timelib_sll ts); + +/** + * Calculates when the Sun is above a certain latitude. + * + * Parameters: + * - time: A timelib_time time describing that needs to specific midnight for a + * specific day. + * - lon: The longitude of the observer (East positive, West negative). + * - lat: The latitude of the observer (North positive, South negative). + * - altit: The altitude. Set to -35/60 for rise/set, -6 for civil twilight, + * -12 for nautical, and -18 for astronomical twilight. + * - upper_limb: set to non-zero for rise/set calculations, and 0 for twilight + * calculations. + * + * Out Parameters: + * - h_rise: The decimal hour when the Sun rises + * - h_set: The decimal hour when the Sun sets + * - ts_rise: The Unix timestamp of the Sun rising + * - ts_set: The Unix timestamp of the Sun setting + * - ts_transit: The Unix timestmap of the Sun transitting through South + * + * Return Values: + * - 0: The Sun rises and sets. + * - +1: The Sun is always above the horizon. (ts_rise is set to ts_transit - + * (12 * 3600); ts_set is set to ts_transit + (12 * 3600). + * - -1: The Sun is awlays below the horizon. (ts_rise and ts_set are set + * to ts_transit) + */ +int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll *ts_rise, timelib_sll *ts_set, timelib_sll *ts_transit); + +/* from interval.c */ + +/** + * Calculates the difference between two times + * + * The result is a timelib_rel_time structure that describes how you can + * convert from 'one' to 'two' with 'timelib_add'. This does *not* necessarily + * mean that you can go from 'two' to 'one' by using 'timelib_sub' due to the + * way months and days are calculated. + */ +timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two); + +/** + * Calculates the difference in full days between two times + * + * The result is the number of full days between 'one' and 'two'. It does take + * into account 23 and 25 hour (and variants) days when the zone_type + * is TIMELIB_ZONETYPE_ID and have the same TZID for 'one' and 'two'. + */ +int timelib_diff_days(timelib_time *one, timelib_time *two); + +/** + * Adds the relative time information 'interval' to the base time 't'. + * + * This can be a relative time as created by 'timelib_diff', but also by more + * complex statements such as "next workday". + */ +timelib_time *timelib_add(timelib_time *t, timelib_rel_time *interval); +timelib_time *timelib_add_wall(timelib_time *t, timelib_rel_time *interval); + +/** + * Subtracts the relative time information 'interval' to the base time 't'. + * + * This can be a relative time as created by 'timelib_diff'. Unlike with + * 'timelib_add', this does not support more complex statements such as "next + * workday". + */ +timelib_time *timelib_sub(timelib_time *t, timelib_rel_time *interval); +timelib_time *timelib_sub_wall(timelib_time *t, timelib_rel_time *interval); + +/* from parse_posix.c */ + +void timelib_posix_str_dtor(timelib_posix_str *ps); + +timelib_posix_str* timelib_parse_posix_str(const char *posix); + +/** + * Calculate the two yearly to/from DST + */ +void timelib_get_transitions_for_year(timelib_tzinfo *tz, timelib_sll year, timelib_posix_transitions *transitions); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/include/php/ext/date/lib/timelib_config.h b/include/php/ext/date/lib/timelib_config.h new file mode 100644 index 0000000..4137b19 --- /dev/null +++ b/include/php/ext/date/lib/timelib_config.h @@ -0,0 +1,16 @@ +#ifdef PHP_WIN32 +# include "config.w32.h" +#else +# include +#endif +#include +#include + +#include "zend.h" + +#define timelib_malloc emalloc +#define timelib_realloc erealloc +#define timelib_calloc ecalloc +#define timelib_strdup estrdup +#define timelib_strndup estrndup +#define timelib_free efree diff --git a/include/php/ext/date/php_date.h b/include/php/ext/date/php_date.h new file mode 100644 index 0000000..a4729ff --- /dev/null +++ b/include/php/ext/date/php_date.h @@ -0,0 +1,147 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Derick Rethans | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_DATE_H +#define PHP_DATE_H + +#include "lib/timelib.h" +#include "Zend/zend_hash.h" + +#include "php_version.h" +#define PHP_DATE_VERSION PHP_VERSION + +extern zend_module_entry date_module_entry; +#define phpext_date_ptr &date_module_entry + +PHP_RINIT_FUNCTION(date); +PHP_RSHUTDOWN_FUNCTION(date); +PHP_MINIT_FUNCTION(date); +PHP_MSHUTDOWN_FUNCTION(date); +PHP_MINFO_FUNCTION(date); +ZEND_MODULE_POST_ZEND_DEACTIVATE_D(date); + +typedef struct _php_date_obj php_date_obj; +typedef struct _php_timezone_obj php_timezone_obj; +typedef struct _php_interval_obj php_interval_obj; +typedef struct _php_period_obj php_period_obj; + +struct _php_date_obj { + timelib_time *time; + zend_object std; +}; + +static inline php_date_obj *php_date_obj_from_obj(zend_object *obj) { + return (php_date_obj*)((char*)(obj) - XtOffsetOf(php_date_obj, std)); +} + +#define Z_PHPDATE_P(zv) php_date_obj_from_obj(Z_OBJ_P((zv))) + +struct _php_timezone_obj { + bool initialized; + int type; + union { + timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID */ + timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */ + timelib_abbr_info z; /* TIMELIB_ZONETYPE_ABBR */ + } tzi; + zend_object std; +}; + +static inline php_timezone_obj *php_timezone_obj_from_obj(zend_object *obj) { + return (php_timezone_obj*)((char*)(obj) - XtOffsetOf(php_timezone_obj, std)); +} + +#define Z_PHPTIMEZONE_P(zv) php_timezone_obj_from_obj(Z_OBJ_P((zv))) + +#define PHP_DATE_CIVIL 1 +#define PHP_DATE_WALL 2 + +struct _php_interval_obj { + timelib_rel_time *diff; + int civil_or_wall; + bool from_string; + zend_string *date_string; + bool initialized; + zend_object std; +}; + +static inline php_interval_obj *php_interval_obj_from_obj(zend_object *obj) { + return (php_interval_obj*)((char*)(obj) - XtOffsetOf(php_interval_obj, std)); +} + +#define Z_PHPINTERVAL_P(zv) php_interval_obj_from_obj(Z_OBJ_P((zv))) + +struct _php_period_obj { + timelib_time *start; + zend_class_entry *start_ce; + timelib_time *current; + timelib_time *end; + timelib_rel_time *interval; + int recurrences; + bool initialized; + bool include_start_date; + bool include_end_date; + zend_object std; +}; + +static inline php_period_obj *php_period_obj_from_obj(zend_object *obj) { + return (php_period_obj*)((char*)(obj) - XtOffsetOf(php_period_obj, std)); +} + +#define Z_PHPPERIOD_P(zv) php_period_obj_from_obj(Z_OBJ_P((zv))) + +ZEND_BEGIN_MODULE_GLOBALS(date) + char *default_timezone; + char *timezone; + HashTable *tzcache; + timelib_error_container *last_errors; +ZEND_END_MODULE_GLOBALS(date) + +#define DATEG(v) ZEND_MODULE_GLOBALS_ACCESSOR(date, v) + +PHPAPI time_t php_time(void); + +/* Backwards compatibility wrapper */ +PHPAPI zend_long php_parse_date(const char *string, zend_long *now); +PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, bool gmt); +PHPAPI int php_idate(char format, time_t ts, bool localtime); + +#define _php_strftime php_strftime + +PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, bool gm); +PHPAPI zend_string *php_format_date(const char *format, size_t format_len, time_t ts, bool localtime); + +/* Mechanism to set new TZ database */ +PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb); +PHPAPI timelib_tzinfo *get_timezone_info(void); + +/* Grabbing CE's so that other exts can use the date objects too */ +PHPAPI zend_class_entry *php_date_get_date_ce(void); +PHPAPI zend_class_entry *php_date_get_immutable_ce(void); +PHPAPI zend_class_entry *php_date_get_interface_ce(void); +PHPAPI zend_class_entry *php_date_get_timezone_ce(void); +PHPAPI zend_class_entry *php_date_get_interval_ce(void); +PHPAPI zend_class_entry *php_date_get_period_ce(void); + +/* Functions for creating DateTime objects, and initializing them from a string */ +#define PHP_DATE_INIT_CTOR 0x01 +#define PHP_DATE_INIT_FORMAT 0x02 + +PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object); +PHPAPI bool php_date_initialize(php_date_obj *dateobj, const char *time_str, size_t time_str_len, const char *format, zval *timezone_object, int flags); + + +#endif /* PHP_DATE_H */ diff --git a/include/php/ext/dom/xml_common.h b/include/php/ext/dom/xml_common.h new file mode 100644 index 0000000..6dfacad --- /dev/null +++ b/include/php/ext/dom/xml_common.h @@ -0,0 +1,86 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Christian Stocker | + | Rob Richards | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_XML_COMMON_H +#define PHP_XML_COMMON_H + +#include "ext/libxml/php_libxml.h" + +typedef libxml_doc_props *dom_doc_propsptr; + +typedef struct _dom_object { + void *ptr; + php_libxml_ref_obj *document; + HashTable *prop_handler; + zend_object std; +} dom_object; + +static inline dom_object *php_dom_obj_from_obj(zend_object *obj) { + return (dom_object*)((char*)(obj) - XtOffsetOf(dom_object, std)); +} + +#define Z_DOMOBJ_P(zv) php_dom_obj_from_obj(Z_OBJ_P((zv))) + +#ifdef PHP_WIN32 +# ifdef DOM_EXPORTS +# define PHP_DOM_EXPORT __declspec(dllexport) +# elif !defined(DOM_LOCAL_DEFINES) /* Allow to counteract LNK4049 warning. */ +# define PHP_DOM_EXPORT __declspec(dllimport) +# else +# define PHP_DOM_EXPORT +# endif /* DOM_EXPORTS */ +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_DOM_EXPORT __attribute__ ((visibility("default"))) +#elif defined(PHPAPI) +# define PHP_DOM_EXPORT PHPAPI +#else +# define PHP_DOM_EXPORT +#endif + +PHP_DOM_EXPORT extern zend_class_entry *dom_node_class_entry; +PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj); +PHP_DOM_EXPORT bool php_dom_create_object(xmlNodePtr obj, zval* return_value, dom_object *domobj); +PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj); + +#define DOM_XMLNS_NAMESPACE \ + (const xmlChar *) "http://www.w3.org/2000/xmlns/" + +#define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \ + __intern = Z_LIBXML_NODE_P(__id); \ + if (UNEXPECTED(__intern->node == NULL)) { \ + php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", \ + ZSTR_VAL(__intern->std.ce->name));\ + RETURN_NULL();\ + } \ + __ptr = (__prtype)__intern->node->node; \ +} + +#define DOC_GET_OBJ(__ptr, __id, __prtype, __intern) { \ + __intern = Z_LIBXML_NODE_P(__id); \ + if (EXPECTED(__intern->document != NULL)) { \ + __ptr = (__prtype)__intern->document->ptr); \ + } \ +} + +#define DOM_RET_OBJ(obj, ret, domobject) \ + *ret = php_dom_create_object(obj, return_value, domobject) + +#define DOM_GET_THIS_OBJ(__ptr, __id, __prtype, __intern) \ + __id = ZEND_THIS; \ + DOM_GET_OBJ(__ptr, __id, __prtype, __intern); + +#endif diff --git a/include/php/ext/filter/php_filter.h b/include/php/ext/filter/php_filter.h new file mode 100644 index 0000000..aae9fd3 --- /dev/null +++ b/include/php/ext/filter/php_filter.h @@ -0,0 +1,88 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rasmus Lerdorf | + | Derick Rethans | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_FILTER_H +#define PHP_FILTER_H + +#include "SAPI.h" +#include "zend_API.h" +#include "php.h" +#include "php_ini.h" +#include "ext/standard/info.h" +#include "ext/standard/php_string.h" +#include "ext/standard/html.h" +#include "php_variables.h" + +extern zend_module_entry filter_module_entry; +#define phpext_filter_ptr &filter_module_entry + +#ifdef ZTS +#include "TSRM.h" +#endif + +#define PHP_FILTER_VERSION PHP_VERSION + +PHP_MINIT_FUNCTION(filter); +PHP_MSHUTDOWN_FUNCTION(filter); +PHP_RINIT_FUNCTION(filter); +PHP_RSHUTDOWN_FUNCTION(filter); +PHP_MINFO_FUNCTION(filter); + +ZEND_BEGIN_MODULE_GLOBALS(filter) + zval post_array; + zval get_array; + zval cookie_array; + zval env_array; + zval server_array; +#if 0 + zval session_array; +#endif + zend_long default_filter; + zend_long default_filter_flags; +ZEND_END_MODULE_GLOBALS(filter) + +#if defined(COMPILE_DL_FILTER) && defined(ZTS) +ZEND_TSRMLS_CACHE_EXTERN() +#endif + +#define IF_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(filter, v) + +#define PHP_INPUT_FILTER_PARAM_DECL zval *value, zend_long flags, zval *option_array, char *charset +void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_validate_domain(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL); + +void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_full_special_chars(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_url(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL); +void php_filter_add_slashes(PHP_INPUT_FILTER_PARAM_DECL); + +void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL); + +#endif /* FILTER_H */ diff --git a/include/php/ext/hash/php_hash.h b/include/php/ext/hash/php_hash.h new file mode 100644 index 0000000..0fd2f5d --- /dev/null +++ b/include/php/ext/hash/php_hash.h @@ -0,0 +1,172 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sara Golemon | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_H +#define PHP_HASH_H + +#include "php.h" + +#define PHP_HASH_EXTNAME "hash" +#define PHP_HASH_VERSION PHP_VERSION +#define PHP_MHASH_VERSION PHP_VERSION + +#define PHP_HASH_HMAC 0x0001 + +#define PHP_HASH_SERIALIZE_MAGIC_SPEC 2 + +#define L64 INT64_C + +typedef struct _php_hashcontext_object php_hashcontext_object; + +typedef void (*php_hash_init_func_t)(void *context, HashTable *args); +typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, size_t count); +typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context); +typedef int (*php_hash_copy_func_t)(const void *ops, void *orig_context, void *dest_context); +typedef int (*php_hash_serialize_func_t)(const php_hashcontext_object *hash, zend_long *magic, zval *zv); +typedef int (*php_hash_unserialize_func_t)(php_hashcontext_object *hash, zend_long magic, const zval *zv); + +typedef struct _php_hash_ops { + const char *algo; + php_hash_init_func_t hash_init; + php_hash_update_func_t hash_update; + php_hash_final_func_t hash_final; + php_hash_copy_func_t hash_copy; + php_hash_serialize_func_t hash_serialize; + php_hash_unserialize_func_t hash_unserialize; + const char *serialize_spec; + + size_t digest_size; + size_t block_size; + size_t context_size; + unsigned is_crypto: 1; +} php_hash_ops; + +struct _php_hashcontext_object { + const php_hash_ops *ops; + void *context; + + zend_long options; + unsigned char *key; + + zend_object std; +}; + +static inline php_hashcontext_object *php_hashcontext_from_object(zend_object *obj) { + return ((php_hashcontext_object*)(obj + 1)) - 1; +} + +extern const php_hash_ops php_hash_md2_ops; +extern const php_hash_ops php_hash_md4_ops; +extern const php_hash_ops php_hash_md5_ops; +extern const php_hash_ops php_hash_sha1_ops; +extern const php_hash_ops php_hash_sha224_ops; +extern const php_hash_ops php_hash_sha256_ops; +extern const php_hash_ops php_hash_sha384_ops; +extern const php_hash_ops php_hash_sha512_ops; +extern const php_hash_ops php_hash_sha512_256_ops; +extern const php_hash_ops php_hash_sha512_224_ops; +extern const php_hash_ops php_hash_sha3_224_ops; +extern const php_hash_ops php_hash_sha3_256_ops; +extern const php_hash_ops php_hash_sha3_384_ops; +extern const php_hash_ops php_hash_sha3_512_ops; +extern const php_hash_ops php_hash_ripemd128_ops; +extern const php_hash_ops php_hash_ripemd160_ops; +extern const php_hash_ops php_hash_ripemd256_ops; +extern const php_hash_ops php_hash_ripemd320_ops; +extern const php_hash_ops php_hash_whirlpool_ops; +extern const php_hash_ops php_hash_3tiger128_ops; +extern const php_hash_ops php_hash_3tiger160_ops; +extern const php_hash_ops php_hash_3tiger192_ops; +extern const php_hash_ops php_hash_4tiger128_ops; +extern const php_hash_ops php_hash_4tiger160_ops; +extern const php_hash_ops php_hash_4tiger192_ops; +extern const php_hash_ops php_hash_snefru_ops; +extern const php_hash_ops php_hash_gost_ops; +extern const php_hash_ops php_hash_gost_crypto_ops; +extern const php_hash_ops php_hash_adler32_ops; +extern const php_hash_ops php_hash_crc32_ops; +extern const php_hash_ops php_hash_crc32b_ops; +extern const php_hash_ops php_hash_crc32c_ops; +extern const php_hash_ops php_hash_fnv132_ops; +extern const php_hash_ops php_hash_fnv1a32_ops; +extern const php_hash_ops php_hash_fnv164_ops; +extern const php_hash_ops php_hash_fnv1a64_ops; +extern const php_hash_ops php_hash_joaat_ops; +extern const php_hash_ops php_hash_murmur3a_ops; +extern const php_hash_ops php_hash_murmur3c_ops; +extern const php_hash_ops php_hash_murmur3f_ops; +extern const php_hash_ops php_hash_xxh32_ops; +extern const php_hash_ops php_hash_xxh64_ops; +extern const php_hash_ops php_hash_xxh3_64_ops; +extern const php_hash_ops php_hash_xxh3_128_ops; + +#define PHP_HASH_HAVAL_OPS(p,b) extern const php_hash_ops php_hash_##p##haval##b##_ops; + +PHP_HASH_HAVAL_OPS(3,128) +PHP_HASH_HAVAL_OPS(3,160) +PHP_HASH_HAVAL_OPS(3,192) +PHP_HASH_HAVAL_OPS(3,224) +PHP_HASH_HAVAL_OPS(3,256) + +PHP_HASH_HAVAL_OPS(4,128) +PHP_HASH_HAVAL_OPS(4,160) +PHP_HASH_HAVAL_OPS(4,192) +PHP_HASH_HAVAL_OPS(4,224) +PHP_HASH_HAVAL_OPS(4,256) + +PHP_HASH_HAVAL_OPS(5,128) +PHP_HASH_HAVAL_OPS(5,160) +PHP_HASH_HAVAL_OPS(5,192) +PHP_HASH_HAVAL_OPS(5,224) +PHP_HASH_HAVAL_OPS(5,256) + +extern zend_module_entry hash_module_entry; +#define phpext_hash_ptr &hash_module_entry + +#ifdef PHP_WIN32 +# define PHP_HASH_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_HASH_API __attribute__ ((visibility("default"))) +#else +# define PHP_HASH_API +#endif + +extern PHP_HASH_API zend_class_entry *php_hashcontext_ce; +PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(zend_string *algo); +PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops *ops); +PHP_HASH_API int php_hash_copy(const void *ops, void *orig_context, void *dest_context); +PHP_HASH_API int php_hash_serialize(const php_hashcontext_object *context, zend_long *magic, zval *zv); +PHP_HASH_API int php_hash_unserialize(php_hashcontext_object *context, zend_long magic, const zval *zv); +PHP_HASH_API int php_hash_serialize_spec(const php_hashcontext_object *context, zval *zv, const char *spec); +PHP_HASH_API int php_hash_unserialize_spec(php_hashcontext_object *hash, const zval *zv, const char *spec); + +static inline void *php_hash_alloc_context(const php_hash_ops *ops) { + /* Zero out context memory so serialization doesn't expose internals */ + return ecalloc(1, ops->context_size); +} + +static inline void php_hash_bin2hex(char *out, const unsigned char *in, size_t in_len) +{ + static const char hexits[17] = "0123456789abcdef"; + size_t i; + + for(i = 0; i < in_len; i++) { + out[i * 2] = hexits[in[i] >> 4]; + out[(i * 2) + 1] = hexits[in[i] & 0x0F]; + } +} + +#endif /* PHP_HASH_H */ diff --git a/include/php/ext/hash/php_hash_adler32.h b/include/php/ext/hash/php_hash_adler32.h new file mode 100644 index 0000000..9095357 --- /dev/null +++ b/include/php/ext/hash/php_hash_adler32.h @@ -0,0 +1,32 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Wallner | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_ADLER32_H +#define PHP_HASH_ADLER32_H + +#include "ext/standard/basic_functions.h" + +typedef struct { + uint32_t state; +} PHP_ADLER32_CTX; +#define PHP_ADLER32_SPEC "l." + +PHP_HASH_API void PHP_ADLER32Init(PHP_ADLER32_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_ADLER32Update(PHP_ADLER32_CTX *context, const unsigned char *input, size_t len); +PHP_HASH_API void PHP_ADLER32Final(unsigned char digest[4], PHP_ADLER32_CTX *context); +PHP_HASH_API int PHP_ADLER32Copy(const php_hash_ops *ops, PHP_ADLER32_CTX *orig_context, PHP_ADLER32_CTX *copy_context); + +#endif diff --git a/include/php/ext/hash/php_hash_crc32.h b/include/php/ext/hash/php_hash_crc32.h new file mode 100644 index 0000000..5208293 --- /dev/null +++ b/include/php/ext/hash/php_hash_crc32.h @@ -0,0 +1,35 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Wallner | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_CRC32_H +#define PHP_HASH_CRC32_H + +#include "ext/standard/basic_functions.h" + +typedef struct { + uint32_t state; +} PHP_CRC32_CTX; +#define PHP_CRC32_SPEC "l." + +PHP_HASH_API void PHP_CRC32Init(PHP_CRC32_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_CRC32Update(PHP_CRC32_CTX *context, const unsigned char *input, size_t len); +PHP_HASH_API void PHP_CRC32BUpdate(PHP_CRC32_CTX *context, const unsigned char *input, size_t len); +PHP_HASH_API void PHP_CRC32CUpdate(PHP_CRC32_CTX *context, const unsigned char *input, size_t len); +PHP_HASH_API void PHP_CRC32LEFinal(unsigned char digest[4], PHP_CRC32_CTX *context); +PHP_HASH_API void PHP_CRC32BEFinal(unsigned char digest[4], PHP_CRC32_CTX *context); +PHP_HASH_API int PHP_CRC32Copy(const php_hash_ops *ops, PHP_CRC32_CTX *orig_context, PHP_CRC32_CTX *copy_context); + +#endif diff --git a/include/php/ext/hash/php_hash_fnv.h b/include/php/ext/hash/php_hash_fnv.h new file mode 100644 index 0000000..e9d1ce8 --- /dev/null +++ b/include/php/ext/hash/php_hash_fnv.h @@ -0,0 +1,66 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Maclean | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_FNV_H +#define PHP_HASH_FNV_H + +#define PHP_FNV1_32_INIT ((uint32_t)0x811c9dc5) + +#define PHP_FNV_32_PRIME ((uint32_t)0x01000193) + +#define PHP_FNV1_64_INIT ((uint64_t)0xcbf29ce484222325ULL) + +#define PHP_FNV_64_PRIME ((uint64_t)0x100000001b3ULL) + + +/* + * hash types + */ +enum php_fnv_type { + PHP_FNV_NONE = 0, /* invalid FNV hash type */ + PHP_FNV0_32 = 1, /* FNV-0 32 bit hash */ + PHP_FNV1_32 = 2, /* FNV-1 32 bit hash */ + PHP_FNV1a_32 = 3, /* FNV-1a 32 bit hash */ + PHP_FNV0_64 = 4, /* FNV-0 64 bit hash */ + PHP_FNV1_64 = 5, /* FNV-1 64 bit hash */ + PHP_FNV1a_64 = 6, /* FNV-1a 64 bit hash */ +}; + +typedef struct { + uint32_t state; +} PHP_FNV132_CTX; +#define PHP_FNV132_SPEC "l." + +typedef struct { + uint64_t state; +} PHP_FNV164_CTX; +#define PHP_FNV164_SPEC "q." + + +PHP_HASH_API void PHP_FNV132Init(PHP_FNV132_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input, size_t inputLen); +PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input, size_t inputLen); +PHP_HASH_API void PHP_FNV132Final(unsigned char digest[4], PHP_FNV132_CTX * context); + +PHP_HASH_API void PHP_FNV164Init(PHP_FNV164_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input, size_t inputLen); +PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input, size_t inputLen); +PHP_HASH_API void PHP_FNV164Final(unsigned char digest[8], PHP_FNV164_CTX * context); + +static uint32_t fnv_32_buf(void *buf, size_t len, uint32_t hval, int alternate); +static uint64_t fnv_64_buf(void *buf, size_t len, uint64_t hval, int alternate); + +#endif diff --git a/include/php/ext/hash/php_hash_gost.h b/include/php/ext/hash/php_hash_gost.h new file mode 100644 index 0000000..45110df --- /dev/null +++ b/include/php/ext/hash/php_hash_gost.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Wallner | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_GOST_H +#define PHP_HASH_GOST_H + +#include "ext/standard/basic_functions.h" + +/* GOST context */ +typedef struct { + uint32_t state[16]; + uint32_t count[2]; + unsigned char length; + unsigned char buffer[32]; + const uint32_t (*tables)[4][256]; +} PHP_GOST_CTX; +#define PHP_GOST_SPEC "l16l2bb32" + +PHP_HASH_API void PHP_GOSTInit(PHP_GOST_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_GOSTFinal(unsigned char[32], PHP_GOST_CTX *); + +#endif diff --git a/include/php/ext/hash/php_hash_haval.h b/include/php/ext/hash/php_hash_haval.h new file mode 100644 index 0000000..7f1fb6b --- /dev/null +++ b/include/php/ext/hash/php_hash_haval.h @@ -0,0 +1,56 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sara Golemon | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_HAVAL_H +#define PHP_HASH_HAVAL_H + +#include "ext/standard/basic_functions.h" +/* HAVAL context. */ +typedef struct { + uint32_t state[8]; + uint32_t count[2]; + unsigned char buffer[128]; + + char passes; + short output; + void (*Transform)(uint32_t state[8], const unsigned char block[128]); +} PHP_HAVAL_CTX; +#define PHP_HAVAL_SPEC "l8l2b128" + +#define PHP_HASH_HAVAL_INIT_DECL(p,b) PHP_HASH_API void PHP_##p##HAVAL##b##Init(PHP_HAVAL_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); \ + PHP_HASH_API void PHP_HAVAL##b##Final(unsigned char*, PHP_HAVAL_CTX *); + +PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *, const unsigned char *, size_t); + +PHP_HASH_HAVAL_INIT_DECL(3,128) +PHP_HASH_HAVAL_INIT_DECL(3,160) +PHP_HASH_HAVAL_INIT_DECL(3,192) +PHP_HASH_HAVAL_INIT_DECL(3,224) +PHP_HASH_HAVAL_INIT_DECL(3,256) + +PHP_HASH_HAVAL_INIT_DECL(4,128) +PHP_HASH_HAVAL_INIT_DECL(4,160) +PHP_HASH_HAVAL_INIT_DECL(4,192) +PHP_HASH_HAVAL_INIT_DECL(4,224) +PHP_HASH_HAVAL_INIT_DECL(4,256) + +PHP_HASH_HAVAL_INIT_DECL(5,128) +PHP_HASH_HAVAL_INIT_DECL(5,160) +PHP_HASH_HAVAL_INIT_DECL(5,192) +PHP_HASH_HAVAL_INIT_DECL(5,224) +PHP_HASH_HAVAL_INIT_DECL(5,256) + +#endif diff --git a/include/php/ext/hash/php_hash_joaat.h b/include/php/ext/hash/php_hash_joaat.h new file mode 100644 index 0000000..fcc4cc3 --- /dev/null +++ b/include/php/ext/hash/php_hash_joaat.h @@ -0,0 +1,31 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Martin Jansen | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_JOAAT_H +#define PHP_HASH_JOAAT_H + +typedef struct { + uint32_t state; +} PHP_JOAAT_CTX; +#define PHP_JOAAT_SPEC "l." + +PHP_HASH_API void PHP_JOAATInit(PHP_JOAAT_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, size_t inputLen); +PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[4], PHP_JOAAT_CTX * context); + +static uint32_t joaat_buf(void *buf, size_t len, uint32_t hval); + +#endif diff --git a/include/php/ext/hash/php_hash_md.h b/include/php/ext/hash/php_hash_md.h new file mode 100644 index 0000000..f648fbf --- /dev/null +++ b/include/php/ext/hash/php_hash_md.h @@ -0,0 +1,50 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Original Author: Rasmus Lerdorf | + | Modified for pHASH by: Sara Golemon + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_MD_H +#define PHP_HASH_MD_H + +#include "ext/standard/md5.h" + +/* MD4 context */ +typedef struct { + uint32_t state[4]; + uint32_t count[2]; + unsigned char buffer[64]; +} PHP_MD4_CTX; +#define PHP_MD4_SPEC "l4l2b64." + +#define PHP_MD4Init(ctx) PHP_MD4InitArgs(ctx, NULL) +PHP_HASH_API void PHP_MD4InitArgs(PHP_MD4_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX *context, const unsigned char *, size_t); +PHP_HASH_API void PHP_MD4Final(unsigned char[16], PHP_MD4_CTX *); + +/* MD2 context */ +typedef struct { + unsigned char state[48]; + unsigned char checksum[16]; + unsigned char buffer[16]; + unsigned char in_buffer; +} PHP_MD2_CTX; +#define PHP_MD2_SPEC "b48b16b16b." + +#define PHP_MD2Init(ctx) PHP_MD2InitArgs(ctx, NULL) +PHP_HASH_API void PHP_MD2InitArgs(PHP_MD2_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *, size_t); +PHP_HASH_API void PHP_MD2Final(unsigned char[16], PHP_MD2_CTX *); + +#endif diff --git a/include/php/ext/hash/php_hash_murmur.h b/include/php/ext/hash/php_hash_murmur.h new file mode 100644 index 0000000..b1c326a --- /dev/null +++ b/include/php/ext/hash/php_hash_murmur.h @@ -0,0 +1,57 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Anatol Belski | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_MURMUR_H +#define PHP_HASH_MURMUR_H + +typedef struct { + uint32_t h; + uint32_t carry; + uint32_t len; +} PHP_MURMUR3A_CTX; +#define PHP_MURMUR3A_SPEC "lll" + +PHP_HASH_API void PHP_MURMUR3AInit(PHP_MURMUR3A_CTX *ctx, HashTable *args); +PHP_HASH_API void PHP_MURMUR3AUpdate(PHP_MURMUR3A_CTX *ctx, const unsigned char *in, size_t len); +PHP_HASH_API void PHP_MURMUR3AFinal(unsigned char digest[4], PHP_MURMUR3A_CTX *ctx); +PHP_HASH_API int PHP_MURMUR3ACopy(const php_hash_ops *ops, PHP_MURMUR3A_CTX *orig_context, PHP_MURMUR3A_CTX *copy_context); + +typedef struct { + uint32_t h[4]; + uint32_t carry[4]; + uint32_t len; +} PHP_MURMUR3C_CTX; +#define PHP_MURMUR3C_SPEC "lllllllll" + +PHP_HASH_API void PHP_MURMUR3CInit(PHP_MURMUR3C_CTX *ctx, HashTable *args); +PHP_HASH_API void PHP_MURMUR3CUpdate(PHP_MURMUR3C_CTX *ctx, const unsigned char *in, size_t len); +PHP_HASH_API void PHP_MURMUR3CFinal(unsigned char digest[16], PHP_MURMUR3C_CTX *ctx); +PHP_HASH_API int PHP_MURMUR3CCopy(const php_hash_ops *ops, PHP_MURMUR3C_CTX *orig_context, PHP_MURMUR3C_CTX *copy_context); + +typedef struct { + uint64_t h[2]; + uint64_t carry[2]; + uint32_t len; +} PHP_MURMUR3F_CTX; +#define PHP_MURMUR3F_SPEC "qqqql" + +PHP_HASH_API void PHP_MURMUR3FInit(PHP_MURMUR3F_CTX *ctx, HashTable *args); +PHP_HASH_API void PHP_MURMUR3FUpdate(PHP_MURMUR3F_CTX *ctx, const unsigned char *in, size_t len); +PHP_HASH_API void PHP_MURMUR3FFinal(unsigned char digest[16], PHP_MURMUR3F_CTX *ctx); +PHP_HASH_API int PHP_MURMUR3FCopy(const php_hash_ops *ops, PHP_MURMUR3F_CTX *orig_context, PHP_MURMUR3F_CTX *copy_context); + +#endif /* PHP_HASH_MURMUR_H */ + diff --git a/include/php/ext/hash/php_hash_ripemd.h b/include/php/ext/hash/php_hash_ripemd.h new file mode 100644 index 0000000..da5621a --- /dev/null +++ b/include/php/ext/hash/php_hash_ripemd.h @@ -0,0 +1,66 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sara Golemon | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_RIPEMD_H +#define PHP_HASH_RIPEMD_H +#include "ext/standard/basic_functions.h" + +/* RIPEMD context. */ +typedef struct { + uint32_t state[4]; /* state (ABCD) */ + uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} PHP_RIPEMD128_CTX; +#define PHP_RIPEMD128_SPEC "l4l2b64." + +typedef struct { + uint32_t state[5]; /* state (ABCD) */ + uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} PHP_RIPEMD160_CTX; +#define PHP_RIPEMD160_SPEC "l5l2b64." + +typedef struct { + uint32_t state[8]; /* state (ABCD) */ + uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} PHP_RIPEMD256_CTX; +#define PHP_RIPEMD256_SPEC "l8l2b64." + +typedef struct { + uint32_t state[10]; /* state (ABCD) */ + uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} PHP_RIPEMD320_CTX; +#define PHP_RIPEMD320_SPEC "l10l2b64." + +PHP_HASH_API void PHP_RIPEMD128Init(PHP_RIPEMD128_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_RIPEMD128Final(unsigned char[16], PHP_RIPEMD128_CTX *); + +PHP_HASH_API void PHP_RIPEMD160Init(PHP_RIPEMD160_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_RIPEMD160Final(unsigned char[20], PHP_RIPEMD160_CTX *); + +PHP_HASH_API void PHP_RIPEMD256Init(PHP_RIPEMD256_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_RIPEMD256Final(unsigned char[32], PHP_RIPEMD256_CTX *); + +PHP_HASH_API void PHP_RIPEMD320Init(PHP_RIPEMD320_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_RIPEMD320Final(unsigned char[40], PHP_RIPEMD320_CTX *); + +#endif /* PHP_HASH_RIPEMD_H */ diff --git a/include/php/ext/hash/php_hash_sha.h b/include/php/ext/hash/php_hash_sha.h new file mode 100644 index 0000000..a7d71f7 --- /dev/null +++ b/include/php/ext/hash/php_hash_sha.h @@ -0,0 +1,86 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | SHA1 Author: Stefan Esser | + | SHA256 Author: Sara Golemon | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_SHA_H +#define PHP_HASH_SHA_H + +#include "ext/standard/sha1.h" +#include "ext/standard/basic_functions.h" + +/* SHA224 context. */ +typedef struct { + uint32_t state[8]; /* state */ + uint32_t count[2]; /* number of bits, modulo 2^64 */ + unsigned char buffer[64]; /* input buffer */ +} PHP_SHA224_CTX; +#define PHP_SHA224_SPEC "l8l2b64." + +#define PHP_SHA224Init(ctx) PHP_SHA224InitArgs(ctx, NULL) +PHP_HASH_API void PHP_SHA224InitArgs(PHP_SHA224_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_SHA224Final(unsigned char[28], PHP_SHA224_CTX *); + +/* SHA256 context. */ +typedef struct { + uint32_t state[8]; /* state */ + uint32_t count[2]; /* number of bits, modulo 2^64 */ + unsigned char buffer[64]; /* input buffer */ +} PHP_SHA256_CTX; +#define PHP_SHA256_SPEC "l8l2b64." + +#define PHP_SHA256Init(ctx) PHP_SHA256InitArgs(ctx, NULL) +PHP_HASH_API void PHP_SHA256InitArgs(PHP_SHA256_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_SHA256Final(unsigned char[32], PHP_SHA256_CTX *); + +/* SHA384 context */ +typedef struct { + uint64_t state[8]; /* state */ + uint64_t count[2]; /* number of bits, modulo 2^128 */ + unsigned char buffer[128]; /* input buffer */ +} PHP_SHA384_CTX; +#define PHP_SHA384_SPEC "q8q2b128." + +#define PHP_SHA384Init(ctx) PHP_SHA384InitArgs(ctx, NULL) +PHP_HASH_API void PHP_SHA384InitArgs(PHP_SHA384_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_SHA384Final(unsigned char[48], PHP_SHA384_CTX *); + +/* SHA512 context */ +typedef struct { + uint64_t state[8]; /* state */ + uint64_t count[2]; /* number of bits, modulo 2^128 */ + unsigned char buffer[128]; /* input buffer */ +} PHP_SHA512_CTX; +#define PHP_SHA512_SPEC "q8q2b128." + +#define PHP_SHA512Init(ctx) PHP_SHA512InitArgs(ctx, NULL) +PHP_HASH_API void PHP_SHA512InitArgs(PHP_SHA512_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_SHA512Final(unsigned char[64], PHP_SHA512_CTX *); + +#define PHP_SHA512_256Init(ctx) PHP_SHA512_256InitArgs(ctx, NULL) +PHP_HASH_API void PHP_SHA512_256InitArgs(PHP_SHA512_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +#define PHP_SHA512_256Update PHP_SHA512Update +PHP_HASH_API void PHP_SHA512_256Final(unsigned char[32], PHP_SHA512_CTX *); + +#define PHP_SHA512_224Init(ctx) PHP_SHA512_224InitArgs(ctx, NULL) +PHP_HASH_API void PHP_SHA512_224InitArgs(PHP_SHA512_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +#define PHP_SHA512_224Update PHP_SHA512Update +PHP_HASH_API void PHP_SHA512_224Final(unsigned char[28], PHP_SHA512_CTX *); + +#endif /* PHP_HASH_SHA_H */ diff --git a/include/php/ext/hash/php_hash_sha3.h b/include/php/ext/hash/php_hash_sha3.h new file mode 100644 index 0000000..b574087 --- /dev/null +++ b/include/php/ext/hash/php_hash_sha3.h @@ -0,0 +1,55 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sara Golemon | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_SHA3_H +#define PHP_HASH_SHA3_H + +#include "php.h" + +typedef struct { +#ifdef HAVE_SLOW_HASH3 + unsigned char state[200]; // 5 * 5 * sizeof(uint64) + uint32_t pos; +#else + unsigned char state[224]; // this must fit a Keccak_HashInstance +#endif +} PHP_SHA3_CTX; +#ifdef HAVE_SLOW_HASH3 +#define PHP_SHA3_SPEC "b200l." +#endif + +typedef PHP_SHA3_CTX PHP_SHA3_224_CTX; +typedef PHP_SHA3_CTX PHP_SHA3_256_CTX; +typedef PHP_SHA3_CTX PHP_SHA3_384_CTX; +typedef PHP_SHA3_CTX PHP_SHA3_512_CTX; + +PHP_HASH_API void PHP_SHA3224Init(PHP_SHA3_224_CTX*, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SHA3224Update(PHP_SHA3_224_CTX*, const unsigned char*, size_t); +PHP_HASH_API void PHP_SAH3224Final(unsigned char[32], PHP_SHA3_224_CTX*); + +PHP_HASH_API void PHP_SHA3256Init(PHP_SHA3_256_CTX*, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SHA3256Update(PHP_SHA3_256_CTX*, const unsigned char*, size_t); +PHP_HASH_API void PHP_SAH3256Final(unsigned char[32], PHP_SHA3_256_CTX*); + +PHP_HASH_API void PHP_SHA3384Init(PHP_SHA3_384_CTX*, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SHA3384Update(PHP_SHA3_384_CTX*, const unsigned char*, size_t); +PHP_HASH_API void PHP_SAH3384Final(unsigned char[32], PHP_SHA3_384_CTX*); + +PHP_HASH_API void PHP_SHA3512Init(PHP_SHA3_512_CTX*, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SHA3512Update(PHP_SHA3_512_CTX*, const unsigned char*, size_t); +PHP_HASH_API void PHP_SAH3512Final(unsigned char[32], PHP_SHA3_512_CTX*); + +#endif diff --git a/include/php/ext/hash/php_hash_snefru.h b/include/php/ext/hash/php_hash_snefru.h new file mode 100644 index 0000000..217eb87 --- /dev/null +++ b/include/php/ext/hash/php_hash_snefru.h @@ -0,0 +1,39 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Wallner | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_SNEFRU_H +#define PHP_HASH_SNEFRU_H + +/* SNEFRU-2.5a with 8 passes and 256 bit hash output + * AKA "Xerox Secure Hash Function" + */ + +#include "ext/standard/basic_functions.h" + +/* SNEFRU context */ +typedef struct { + uint32_t state[16]; + uint32_t count[2]; + unsigned char length; + unsigned char buffer[32]; +} PHP_SNEFRU_CTX; +#define PHP_SNEFRU_SPEC "l16l2bb32" + +PHP_HASH_API void PHP_SNEFRUInit(PHP_SNEFRU_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_SNEFRUFinal(unsigned char[32], PHP_SNEFRU_CTX *); + +#endif diff --git a/include/php/ext/hash/php_hash_tiger.h b/include/php/ext/hash/php_hash_tiger.h new file mode 100644 index 0000000..92515c4 --- /dev/null +++ b/include/php/ext/hash/php_hash_tiger.h @@ -0,0 +1,37 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Wallner | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_TIGER_H +#define PHP_HASH_TIGER_H + +/* TIGER context */ +typedef struct { + uint64_t state[3]; + uint64_t passed; + unsigned char buffer[64]; + uint32_t length; + unsigned int passes:1; +} PHP_TIGER_CTX; +#define PHP_TIGER_SPEC "q3qb64l" + +PHP_HASH_API void PHP_3TIGERInit(PHP_TIGER_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_4TIGERInit(PHP_TIGER_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHP_HASH_API void PHP_TIGERUpdate(PHP_TIGER_CTX *context, const unsigned char *input, size_t len); +PHP_HASH_API void PHP_TIGER128Final(unsigned char digest[16], PHP_TIGER_CTX *context); +PHP_HASH_API void PHP_TIGER160Final(unsigned char digest[20], PHP_TIGER_CTX *context); +PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX *context); + +#endif diff --git a/include/php/ext/hash/php_hash_whirlpool.h b/include/php/ext/hash/php_hash_whirlpool.h new file mode 100644 index 0000000..f28ab23 --- /dev/null +++ b/include/php/ext/hash/php_hash_whirlpool.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Wallner | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_WHIRLPOOL_H +#define PHP_HASH_WHIRLPOOL_H + +/* WHIRLPOOL context */ +typedef struct { + uint64_t state[8]; + unsigned char bitlength[32]; + struct { + int pos; + int bits; + unsigned char data[64]; + } buffer; +} PHP_WHIRLPOOL_CTX; +#define PHP_WHIRLPOOL_SPEC "q8b32iib64." + +PHP_HASH_API void PHP_WHIRLPOOLInit(PHP_WHIRLPOOL_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHP_HASH_API void PHP_WHIRLPOOLUpdate(PHP_WHIRLPOOL_CTX *, const unsigned char *, size_t); +PHP_HASH_API void PHP_WHIRLPOOLFinal(unsigned char[64], PHP_WHIRLPOOL_CTX *); + +#endif diff --git a/include/php/ext/hash/php_hash_xxhash.h b/include/php/ext/hash/php_hash_xxhash.h new file mode 100644 index 0000000..a1e8840 --- /dev/null +++ b/include/php/ext/hash/php_hash_xxhash.h @@ -0,0 +1,73 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Anatol Belski | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HASH_XXHASH_H +#define PHP_HASH_XXHASH_H + +#define XXH_INLINE_ALL 1 +#include "xxhash.h" + +typedef struct { + XXH32_state_t s; +} PHP_XXH32_CTX; +#define PHP_XXH32_SPEC "llllllllllll" + +PHP_HASH_API void PHP_XXH32Init(PHP_XXH32_CTX *ctx, HashTable *args); +PHP_HASH_API void PHP_XXH32Update(PHP_XXH32_CTX *ctx, const unsigned char *in, size_t len); +PHP_HASH_API void PHP_XXH32Final(unsigned char digest[4], PHP_XXH32_CTX *ctx); +PHP_HASH_API int PHP_XXH32Copy(const php_hash_ops *ops, PHP_XXH32_CTX *orig_context, PHP_XXH32_CTX *copy_context); + +typedef struct { + XXH64_state_t s; +} PHP_XXH64_CTX; +#define PHP_XXH64_SPEC "qqqqqqqqqllq" + +PHP_HASH_API void PHP_XXH64Init(PHP_XXH64_CTX *ctx, HashTable *args); +PHP_HASH_API void PHP_XXH64Update(PHP_XXH64_CTX *ctx, const unsigned char *in, size_t len); +PHP_HASH_API void PHP_XXH64Final(unsigned char digest[8], PHP_XXH64_CTX *ctx); +PHP_HASH_API int PHP_XXH64Copy(const php_hash_ops *ops, PHP_XXH64_CTX *orig_context, PHP_XXH64_CTX *copy_context); + +#define PHP_XXH3_SECRET_SIZE_MIN XXH3_SECRET_SIZE_MIN +#define PHP_XXH3_SECRET_SIZE_MAX 256 + +typedef struct { + XXH3_state_t s; + /* The value must survive the whole streaming cycle from init to final. + + A more flexible mechanism would be to carry zend_string* passed through + the options. However, that will require to introduce a destructor + handler for ctx, so then it wolud be automatically called from the + object destructor. Until that is given, the viable way is to use a + plausible max secret length. */ + const unsigned char secret[PHP_XXH3_SECRET_SIZE_MAX]; +} PHP_XXH3_CTX; + +typedef PHP_XXH3_CTX PHP_XXH3_64_CTX; + +PHP_HASH_API void PHP_XXH3_64_Init(PHP_XXH3_64_CTX *ctx, HashTable *args); +PHP_HASH_API void PHP_XXH3_64_Update(PHP_XXH3_64_CTX *ctx, const unsigned char *in, size_t len); +PHP_HASH_API void PHP_XXH3_64_Final(unsigned char digest[8], PHP_XXH3_64_CTX *ctx); +PHP_HASH_API int PHP_XXH3_64_Copy(const php_hash_ops *ops, PHP_XXH3_64_CTX *orig_context, PHP_XXH3_64_CTX *copy_context); + +typedef PHP_XXH3_CTX PHP_XXH3_128_CTX; + +PHP_HASH_API void PHP_XXH3_128_Init(PHP_XXH3_128_CTX *ctx, HashTable *args); +PHP_HASH_API void PHP_XXH3_128_Update(PHP_XXH3_128_CTX *ctx, const unsigned char *in, size_t len); +PHP_HASH_API void PHP_XXH3_128_Final(unsigned char digest[16], PHP_XXH3_128_CTX *ctx); +PHP_HASH_API int PHP_XXH3_128_Copy(const php_hash_ops *ops, PHP_XXH3_128_CTX *orig_context, PHP_XXH3_128_CTX *copy_context); + +#endif /* PHP_HASH_XXHASH_H */ + diff --git a/include/php/ext/iconv/iconv_arginfo.h b/include/php/ext/iconv/iconv_arginfo.h new file mode 100644 index 0000000..324cac4 --- /dev/null +++ b/include/php/ext/iconv/iconv_arginfo.h @@ -0,0 +1,95 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 4367fa431d3e4814e42d9aa514c10cae1d842d8f */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_strlen, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_substr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_strpos, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_strrpos, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_mime_encode, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, field_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, field_value, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_mime_decode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_mime_decode_headers, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, headers, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, from_encoding, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, to_encoding, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iconv_set_encoding, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_get_encoding, 0, 0, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_STRING, 0, "\"all\"") +ZEND_END_ARG_INFO() + + +ZEND_FUNCTION(iconv_strlen); +ZEND_FUNCTION(iconv_substr); +ZEND_FUNCTION(iconv_strpos); +ZEND_FUNCTION(iconv_strrpos); +ZEND_FUNCTION(iconv_mime_encode); +ZEND_FUNCTION(iconv_mime_decode); +ZEND_FUNCTION(iconv_mime_decode_headers); +ZEND_FUNCTION(iconv); +ZEND_FUNCTION(iconv_set_encoding); +ZEND_FUNCTION(iconv_get_encoding); + + +static const zend_function_entry ext_functions[] = { + ZEND_FE(iconv_strlen, arginfo_iconv_strlen) + ZEND_FE(iconv_substr, arginfo_iconv_substr) + ZEND_FE(iconv_strpos, arginfo_iconv_strpos) + ZEND_FE(iconv_strrpos, arginfo_iconv_strrpos) + ZEND_FE(iconv_mime_encode, arginfo_iconv_mime_encode) + ZEND_FE(iconv_mime_decode, arginfo_iconv_mime_decode) + ZEND_FE(iconv_mime_decode_headers, arginfo_iconv_mime_decode_headers) + ZEND_FE(iconv, arginfo_iconv) + ZEND_FE(iconv_set_encoding, arginfo_iconv_set_encoding) + ZEND_FE(iconv_get_encoding, arginfo_iconv_get_encoding) + ZEND_FE_END +}; + +static void register_iconv_symbols(int module_number) +{ + REGISTER_STRING_CONSTANT("ICONV_IMPL", PHP_ICONV_IMPL_VALUE, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("ICONV_VERSION", get_iconv_version(), CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_STRICT", PHP_ICONV_MIME_DECODE_STRICT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_CONTINUE_ON_ERROR", PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR, CONST_PERSISTENT); +} diff --git a/include/php/ext/iconv/php_iconv.h b/include/php/ext/iconv/php_iconv.h new file mode 100644 index 0000000..7bc1cce --- /dev/null +++ b/include/php/ext/iconv/php_iconv.h @@ -0,0 +1,93 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rui Hirokawa | + | Stig Bakken | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_ICONV_H +#define PHP_ICONV_H + +#ifdef PHP_WIN32 +# ifdef PHP_ICONV_EXPORTS +# define PHP_ICONV_API __declspec(dllexport) +# else +# define PHP_ICONV_API __declspec(dllimport) +# endif +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_ICONV_API __attribute__ ((visibility("default"))) +#else +# define PHP_ICONV_API +#endif + +#include "php_version.h" +#define PHP_ICONV_VERSION PHP_VERSION + +#ifdef HAVE_ICONV +extern zend_module_entry iconv_module_entry; +#define iconv_module_ptr &iconv_module_entry + +PHP_MINIT_FUNCTION(miconv); +PHP_MSHUTDOWN_FUNCTION(miconv); +PHP_MINFO_FUNCTION(miconv); + +ZEND_BEGIN_MODULE_GLOBALS(iconv) + char *input_encoding; + char *internal_encoding; + char *output_encoding; +ZEND_END_MODULE_GLOBALS(iconv) + +#define ICONVG(v) ZEND_MODULE_GLOBALS_ACCESSOR(iconv, v) + +#if defined(ZTS) && defined(COMPILE_DL_ICONV) +ZEND_TSRMLS_CACHE_EXTERN() +#endif + +#ifdef HAVE_IBM_ICONV +# define ICONV_ASCII_ENCODING "IBM-850" +# define ICONV_UCS4_ENCODING "UCS-4" +#else +# define ICONV_ASCII_ENCODING "ASCII" +# define ICONV_UCS4_ENCODING "UCS-4LE" +#endif + +#ifndef ICONV_CSNMAXLEN +#define ICONV_CSNMAXLEN 64 +#endif + +/* {{{ typedef enum php_iconv_err_t */ +typedef enum _php_iconv_err_t { + PHP_ICONV_ERR_SUCCESS = SUCCESS, + PHP_ICONV_ERR_CONVERTER = 1, + PHP_ICONV_ERR_WRONG_CHARSET = 2, + PHP_ICONV_ERR_TOO_BIG = 3, + PHP_ICONV_ERR_ILLEGAL_SEQ = 4, + PHP_ICONV_ERR_ILLEGAL_CHAR = 5, + PHP_ICONV_ERR_UNKNOWN = 6, + PHP_ICONV_ERR_MALFORMED = 7, + PHP_ICONV_ERR_ALLOC = 8, + PHP_ICONV_ERR_OUT_BY_BOUNDS = 9 +} php_iconv_err_t; +/* }}} */ + +PHP_ICONV_API php_iconv_err_t php_iconv_string(const char * in_p, size_t in_len, zend_string **out, const char *out_charset, const char *in_charset); + +#else + +#define iconv_module_ptr NULL + +#endif /* HAVE_ICONV */ + +#define phpext_iconv_ptr iconv_module_ptr + +#endif /* PHP_ICONV_H */ diff --git a/include/php/ext/json/php_json.h b/include/php/ext/json/php_json.h new file mode 100644 index 0000000..00c87ec --- /dev/null +++ b/include/php/ext/json/php_json.h @@ -0,0 +1,114 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Omar Kilani | + | Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_JSON_H +#define PHP_JSON_H + +#include "php_version.h" +#include "zend_smart_str_public.h" + +#define PHP_JSON_VERSION PHP_VERSION + +extern zend_module_entry json_module_entry; +#define phpext_json_ptr &json_module_entry + +#if defined(PHP_WIN32) && defined(JSON_EXPORTS) +#define PHP_JSON_API __declspec(dllexport) +#else +#define PHP_JSON_API PHPAPI +#endif + +#ifdef ZTS +#include "TSRM.h" +#endif + +extern PHP_JSON_API zend_class_entry *php_json_serializable_ce; + +/* error codes */ +typedef enum { + PHP_JSON_ERROR_NONE = 0, + PHP_JSON_ERROR_DEPTH, + PHP_JSON_ERROR_STATE_MISMATCH, + PHP_JSON_ERROR_CTRL_CHAR, + PHP_JSON_ERROR_SYNTAX, + PHP_JSON_ERROR_UTF8, + PHP_JSON_ERROR_RECURSION, + PHP_JSON_ERROR_INF_OR_NAN, + PHP_JSON_ERROR_UNSUPPORTED_TYPE, + PHP_JSON_ERROR_INVALID_PROPERTY_NAME, + PHP_JSON_ERROR_UTF16, + PHP_JSON_ERROR_NON_BACKED_ENUM, +} php_json_error_code; + +/* json_decode() options */ +#define PHP_JSON_OBJECT_AS_ARRAY (1<<0) +#define PHP_JSON_BIGINT_AS_STRING (1<<1) + +/* json_encode() options */ +#define PHP_JSON_HEX_TAG (1<<0) +#define PHP_JSON_HEX_AMP (1<<1) +#define PHP_JSON_HEX_APOS (1<<2) +#define PHP_JSON_HEX_QUOT (1<<3) +#define PHP_JSON_FORCE_OBJECT (1<<4) +#define PHP_JSON_NUMERIC_CHECK (1<<5) +#define PHP_JSON_UNESCAPED_SLASHES (1<<6) +#define PHP_JSON_PRETTY_PRINT (1<<7) +#define PHP_JSON_UNESCAPED_UNICODE (1<<8) +#define PHP_JSON_PARTIAL_OUTPUT_ON_ERROR (1<<9) +#define PHP_JSON_PRESERVE_ZERO_FRACTION (1<<10) +#define PHP_JSON_UNESCAPED_LINE_TERMINATORS (1<<11) + +/* json_validate(), json_decode() and json_encode() common options */ +#define PHP_JSON_INVALID_UTF8_IGNORE (1<<20) + +/* json_decode() and json_encode() common options */ +#define PHP_JSON_INVALID_UTF8_SUBSTITUTE (1<<21) +#define PHP_JSON_THROW_ON_ERROR (1<<22) + +/* Internal flags */ +#define PHP_JSON_OUTPUT_ARRAY 0 +#define PHP_JSON_OUTPUT_OBJECT 1 + +/* default depth */ +#define PHP_JSON_PARSER_DEFAULT_DEPTH 512 + +ZEND_BEGIN_MODULE_GLOBALS(json) + int encoder_depth; + int encode_max_depth; + php_json_error_code error_code; +ZEND_END_MODULE_GLOBALS(json) + +PHP_JSON_API ZEND_EXTERN_MODULE_GLOBALS(json) +#define JSON_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(json, v) + +#if defined(ZTS) && defined(COMPILE_DL_JSON) +ZEND_TSRMLS_CACHE_EXTERN() +#endif + +PHP_JSON_API zend_string *php_json_encode_string(const char *s, size_t len, int options); + +PHP_JSON_API zend_result php_json_encode_ex(smart_str *buf, zval *val, int options, zend_long depth); +PHP_JSON_API zend_result php_json_encode(smart_str *buf, zval *val, int options); +PHP_JSON_API zend_result php_json_decode_ex(zval *return_value, const char *str, size_t str_len, zend_long options, zend_long depth); +PHP_JSON_API bool php_json_validate_ex(const char *str, size_t str_len, zend_long options, zend_long depth); + +static inline zend_result php_json_decode(zval *return_value, const char *str, size_t str_len, bool assoc, zend_long depth) +{ + return php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth); +} + +#endif /* PHP_JSON_H */ diff --git a/include/php/ext/json/php_json_parser.h b/include/php/ext/json/php_json_parser.h new file mode 100644 index 0000000..8aedce9 --- /dev/null +++ b/include/php/ext/json/php_json_parser.h @@ -0,0 +1,86 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_JSON_PARSER_H +#define PHP_JSON_PARSER_H + +#include "php.h" +#include "php_json_scanner.h" + +typedef struct _php_json_parser php_json_parser; + +typedef int (*php_json_parser_func_array_create_t)( + php_json_parser *parser, zval *array); +typedef int (*php_json_parser_func_array_append_t)( + php_json_parser *parser, zval *array, zval *zvalue); +typedef int (*php_json_parser_func_array_start_t)( + php_json_parser *parser); +typedef int (*php_json_parser_func_array_end_t)( + php_json_parser *parser, zval *object); +typedef int (*php_json_parser_func_object_create_t)( + php_json_parser *parser, zval *object); +typedef int (*php_json_parser_func_object_update_t)( + php_json_parser *parser, zval *object, zend_string *key, zval *zvalue); +typedef int (*php_json_parser_func_object_start_t)( + php_json_parser *parser); +typedef int (*php_json_parser_func_object_end_t)( + php_json_parser *parser, zval *object); + +typedef struct _php_json_parser_methods { + php_json_parser_func_array_create_t array_create; + php_json_parser_func_array_append_t array_append; + php_json_parser_func_array_start_t array_start; + php_json_parser_func_array_end_t array_end; + php_json_parser_func_object_create_t object_create; + php_json_parser_func_object_update_t object_update; + php_json_parser_func_object_start_t object_start; + php_json_parser_func_object_end_t object_end; +} php_json_parser_methods; + +struct _php_json_parser { + php_json_scanner scanner; + zval *return_value; + int depth; + int max_depth; + php_json_parser_methods methods; +}; + +PHP_JSON_API void php_json_parser_init_ex( + php_json_parser *parser, + zval *return_value, + const char *str, + size_t str_len, + int options, + int max_depth, + const php_json_parser_methods *methods); + +PHP_JSON_API void php_json_parser_init( + php_json_parser *parser, + zval *return_value, + const char *str, + size_t str_len, + int options, + int max_depth); + +PHP_JSON_API php_json_error_code php_json_parser_error_code(const php_json_parser *parser); + +PHP_JSON_API int php_json_parse(php_json_parser *parser); + +int php_json_yyparse(php_json_parser *parser); + +const php_json_parser_methods* php_json_get_validate_methods(void); + +#endif /* PHP_JSON_PARSER_H */ diff --git a/include/php/ext/json/php_json_scanner.h b/include/php/ext/json/php_json_scanner.h new file mode 100644 index 0000000..a49be68 --- /dev/null +++ b/include/php/ext/json/php_json_scanner.h @@ -0,0 +1,46 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_JSON_SCANNER_H +#define PHP_JSON_SCANNER_H + +#include "php.h" +#include "php_json.h" + +typedef unsigned char php_json_ctype; + +typedef struct _php_json_scanner { + php_json_ctype *cursor; /* cursor position */ + php_json_ctype *token; /* token position */ + php_json_ctype *limit; /* the last read character + 1 position */ + php_json_ctype *marker; /* marker position for backtracking */ + php_json_ctype *ctxmarker; /* marker position for context backtracking */ + php_json_ctype *str_start; /* start position of the string */ + php_json_ctype *pstr; /* string pointer for escapes conversion */ + zval value; /* value */ + int str_esc; /* number of extra characters for escaping */ + int state; /* condition state */ + int options; /* options */ + php_json_error_code errcode; /* error type if there is an error */ + int utf8_invalid; /* whether utf8 is invalid */ + int utf8_invalid_count; /* number of extra character for invalid utf8 */ +} php_json_scanner; + + +void php_json_scanner_init(php_json_scanner *scanner, const char *str, size_t str_len, int options); +int php_json_scan(php_json_scanner *s); + +#endif /* PHP_JSON_SCANNER_H */ diff --git a/include/php/ext/libxml/php_libxml.h b/include/php/ext/libxml/php_libxml.h new file mode 100644 index 0000000..9fbe9ff --- /dev/null +++ b/include/php/ext/libxml/php_libxml.h @@ -0,0 +1,215 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Shane Caraveo | + | Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_LIBXML_H +#define PHP_LIBXML_H + +#ifdef HAVE_LIBXML +extern zend_module_entry libxml_module_entry; +#define libxml_module_ptr &libxml_module_entry + +#include "php_version.h" +#define PHP_LIBXML_VERSION PHP_VERSION + +#ifdef PHP_WIN32 +# define PHP_LIBXML_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_LIBXML_API __attribute__ ((visibility("default"))) +#else +# define PHP_LIBXML_API +#endif + +#include "zend_smart_str.h" +#include +#include + +#define LIBXML_SAVE_NOEMPTYTAG 1<<2 + +ZEND_BEGIN_MODULE_GLOBALS(libxml) + zval stream_context; + smart_str error_buffer; + zend_llist *error_list; + zend_fcall_info_cache entity_loader_callback; + bool entity_loader_disabled; +ZEND_END_MODULE_GLOBALS(libxml) + +typedef struct _libxml_doc_props { + HashTable *classmap; + bool formatoutput; + bool validateonparse; + bool resolveexternals; + bool preservewhitespace; + bool substituteentities; + bool stricterror; + bool recover; +} libxml_doc_props; + +typedef struct { + size_t modification_nr; +} php_libxml_cache_tag; + +typedef struct _php_libxml_ref_obj { + void *ptr; + int refcount; + libxml_doc_props *doc_props; + php_libxml_cache_tag cache_tag; +} php_libxml_ref_obj; + +typedef struct _php_libxml_node_ptr { + xmlNodePtr node; + int refcount; + void *_private; +} php_libxml_node_ptr; + +typedef struct _php_libxml_node_object { + php_libxml_node_ptr *node; + php_libxml_ref_obj *document; + HashTable *properties; + zend_object std; +} php_libxml_node_object; + + +static inline php_libxml_node_object *php_libxml_node_fetch_object(zend_object *obj) { + return (php_libxml_node_object *)((char*)(obj) - obj->handlers->offset); +} + +static zend_always_inline void php_libxml_invalidate_node_list_cache(php_libxml_ref_obj *doc_ptr) +{ + if (!doc_ptr) { + return; + } +#if SIZEOF_SIZE_T == 8 + /* If one operation happens every nanosecond, then it would still require 584 years to overflow + * the counter. So we'll just assume this never happens. */ + doc_ptr->cache_tag.modification_nr++; +#else + size_t new_modification_nr = doc_ptr->cache_tag.modification_nr + 1; + if (EXPECTED(new_modification_nr > 0)) { /* unsigned overflow; checking after addition results in one less instruction */ + doc_ptr->cache_tag.modification_nr = new_modification_nr; + } +#endif +} + +static zend_always_inline void php_libxml_invalidate_node_list_cache_from_doc(xmlDocPtr docp) +{ + if (docp && docp->_private) { /* docp is NULL for detached nodes */ + php_libxml_node_ptr *node_private = (php_libxml_node_ptr *) docp->_private; + php_libxml_node_object *object_private = (php_libxml_node_object *) node_private->_private; + if (object_private) { + php_libxml_invalidate_node_list_cache(object_private->document); + } + } +} + +#define Z_LIBXML_NODE_P(zv) php_libxml_node_fetch_object(Z_OBJ_P((zv))) + +typedef void * (*php_libxml_export_node) (zval *object); + +PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data); +PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object); +PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp); +PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object); +PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object); +PHP_LIBXML_API zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function); +/* When an explicit freeing of node and children is required */ +PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node); +PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node); +/* When object dtor is called as node may still be referenced */ +PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object); +PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...); +PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...); +PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...); +PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s); +PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext); +PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg); +PHP_LIBXML_API bool php_libxml_disable_entity_loader(bool disable); +PHP_LIBXML_API void php_libxml_set_old_ns(xmlDocPtr doc, xmlNsPtr ns); + +/* Init/shutdown functions*/ +PHP_LIBXML_API void php_libxml_initialize(void); +PHP_LIBXML_API void php_libxml_shutdown(void); + +#define LIBXML(v) ZEND_MODULE_GLOBALS_ACCESSOR(libxml, v) + +#if defined(ZTS) && defined(COMPILE_DL_LIBXML) +ZEND_TSRMLS_CACHE_EXTERN() +#endif + +#if defined(__clang__) +# define PHP_LIBXML_IGNORE_DEPRECATIONS_START \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +# define PHP_LIBXML_IGNORE_DEPRECATIONS_END \ + _Pragma("clang diagnostic pop") +#elif defined(__GNUC__) +# define PHP_LIBXML_IGNORE_DEPRECATIONS_START \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +# define PHP_LIBXML_IGNORE_DEPRECATIONS_END \ + _Pragma("GCC diagnostic pop") +#else +# define PHP_LIBXML_IGNORE_DEPRECATIONS_START +# define PHP_LIBXML_IGNORE_DEPRECATIONS_END +#endif + +/* Other extension may override the global state options, these global options + * are copied initially to ctxt->options. Set the options to a known good value. + * See libxml2 globals.c and parserInternals.c. + * The unique_name argument allows multiple sanitizes and restores within the + * same function, even nested is necessary. */ +#define PHP_LIBXML_SANITIZE_GLOBALS(unique_name) \ + PHP_LIBXML_IGNORE_DEPRECATIONS_START \ + int xml_old_loadsubset_##unique_name = xmlLoadExtDtdDefaultValue; \ + xmlLoadExtDtdDefaultValue = 0; \ + int xml_old_validate_##unique_name = xmlDoValidityCheckingDefaultValue; \ + xmlDoValidityCheckingDefaultValue = 0; \ + int xml_old_pedantic_##unique_name = xmlPedanticParserDefault(0); \ + int xml_old_substitute_##unique_name = xmlSubstituteEntitiesDefault(0); \ + int xml_old_linenrs_##unique_name = xmlLineNumbersDefault(0); \ + int xml_old_blanks_##unique_name = xmlKeepBlanksDefault(1); \ + PHP_LIBXML_IGNORE_DEPRECATIONS_END + +#define PHP_LIBXML_RESTORE_GLOBALS(unique_name) \ + PHP_LIBXML_IGNORE_DEPRECATIONS_START \ + xmlLoadExtDtdDefaultValue = xml_old_loadsubset_##unique_name; \ + xmlDoValidityCheckingDefaultValue = xml_old_validate_##unique_name; \ + (void) xmlPedanticParserDefault(xml_old_pedantic_##unique_name); \ + (void) xmlSubstituteEntitiesDefault(xml_old_substitute_##unique_name); \ + (void) xmlLineNumbersDefault(xml_old_linenrs_##unique_name); \ + (void) xmlKeepBlanksDefault(xml_old_blanks_##unique_name); \ + PHP_LIBXML_IGNORE_DEPRECATIONS_END + +/* Alternative for above, working directly on the context and not setting globals. + * Generally faster because no locking is involved, and this has the advantage that it sets the options to a known good value. */ +static zend_always_inline void php_libxml_sanitize_parse_ctxt_options(xmlParserCtxtPtr ctxt) +{ + ctxt->loadsubset = 0; + ctxt->validate = 0; + ctxt->pedantic = 0; + ctxt->replaceEntities = 0; + ctxt->linenumbers = 0; + ctxt->keepBlanks = 1; + ctxt->options = 0; +} + +#else /* HAVE_LIBXML */ +#define libxml_module_ptr NULL +#endif + +#define phpext_libxml_ptr libxml_module_ptr + +#endif /* PHP_LIBXML_H */ diff --git a/include/php/ext/pcre/pcre2lib/config.h b/include/php/ext/pcre/pcre2lib/config.h new file mode 100644 index 0000000..9bd2a9e --- /dev/null +++ b/include/php/ext/pcre/pcre2lib/config.h @@ -0,0 +1,100 @@ + +#include + +#ifdef PHP_WIN32 +# include +#else +# include +#endif + +#define SUPPORT_UNICODE 1 +#define SUPPORT_PCRE2_8 1 + +#if defined(__GNUC__) && __GNUC__ >= 4 +# ifdef __cplusplus +# define PCRE2_EXP_DECL extern "C" __attribute__ ((visibility("default"))) +# else +# define PCRE2_EXP_DECL extern __attribute__ ((visibility("default"))) +# endif +# define PCRE2_EXP_DEFN __attribute__ ((visibility("default"))) +#endif + +/* Define to any value for valgrind support to find invalid memory reads. */ +#ifdef HAVE_PCRE_VALGRIND_SUPPORT +#define SUPPORT_VALGRIND 1 +#endif + +/* Define to any value to enable support for Just-In-Time compiling. */ +#ifdef HAVE_PCRE_JIT_SUPPORT +#define SUPPORT_JIT +#endif + +/* This limits the amount of memory that pcre2_match() may use while matching + a pattern. The value is in kilobytes. */ +#ifndef HEAP_LIMIT +#define HEAP_LIMIT 20000000 +#endif + +/* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested + parentheses (of any kind) in a pattern. This limits the amount of system + stack that is used while compiling a pattern. */ +#ifndef PARENS_NEST_LIMIT +#define PARENS_NEST_LIMIT 250 +#endif + +/* The value of MATCH_LIMIT determines the default number of times the + pcre2_match() function can record a backtrack position during a single + matching attempt. There is a runtime interface for setting a different + limit. The limit exists in order to catch runaway regular expressions that + take for ever to determine that they do not match. The default is set very + large so that it does not accidentally catch legitimate cases. */ +#ifndef MATCH_LIMIT +#define MATCH_LIMIT 10000000 +#endif + +/* The above limit applies to all backtracks, whether or not they are nested. + In some environments it is desirable to limit the nesting of backtracking + (that is, the depth of tree that is searched) more strictly, in order to + restrict the maximum amount of heap memory that is used. The value of + MATCH_LIMIT_DEPTH provides this facility. To have any useful effect, it + must be less than the value of MATCH_LIMIT. The default is to use the same + value as MATCH_LIMIT. There is a runtime method for setting a different + limit. */ +#ifndef MATCH_LIMIT_DEPTH +#define MATCH_LIMIT_DEPTH MATCH_LIMIT +#endif + +/* This limit is parameterized just in case anybody ever wants to change it. + Care must be taken if it is increased, because it guards against integer + overflow caused by enormously large patterns. */ +#ifndef MAX_NAME_COUNT +#define MAX_NAME_COUNT 10000 +#endif + +/* This limit is parameterized just in case anybody ever wants to change it. + Care must be taken if it is increased, because it guards against integer + overflow caused by enormously large patterns. */ +#ifndef MAX_NAME_SIZE +#define MAX_NAME_SIZE 32 +#endif + +/* Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns. */ +/* #undef NEVER_BACKSLASH_C */ + +/* The value of NEWLINE_DEFAULT determines the default newline character + sequence. PCRE2 client programs can override this by selecting other values + at run time. The valid values are 1 (CR), 2 (LF), 3 (CRLF), 4 (ANY), 5 + (ANYCRLF), and 6 (NUL). */ +#ifndef NEWLINE_DEFAULT +#define NEWLINE_DEFAULT 2 +#endif + +/* The value of LINK_SIZE determines the number of bytes used to store links + as offsets within the compiled regex. The default is 2, which allows for + compiled patterns up to 64K long. This covers the vast majority of cases. + However, PCRE2 can also be compiled to use 3 or 4 bytes instead. This + allows for longer patterns in extreme cases. */ +#ifndef LINK_SIZE +#define LINK_SIZE 2 +#endif + diff --git a/include/php/ext/pcre/pcre2lib/pcre2.h b/include/php/ext/pcre/pcre2lib/pcre2.h new file mode 100644 index 0000000..6eeca45 --- /dev/null +++ b/include/php/ext/pcre/pcre2lib/pcre2.h @@ -0,0 +1,993 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* This is the public header file for the PCRE library, second API, to be +#included by applications that call PCRE2 functions. + + Copyright (c) 2016-2021 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +#ifndef PCRE2_H_IDEMPOTENT_GUARD +#define PCRE2_H_IDEMPOTENT_GUARD + +/* The current PCRE version information. */ + +#define PCRE2_MAJOR 10 +#define PCRE2_MINOR 42 +#define PCRE2_PRERELEASE +#define PCRE2_DATE 2022-12-12 + +/* When an application links to a PCRE DLL in Windows, the symbols that are +imported have to be identified as such. When building PCRE2, the appropriate +export setting is defined in pcre2_internal.h, which includes this file. So we +don't change existing definitions of PCRE2_EXP_DECL. */ + +#if defined(_WIN32) && !defined(PCRE2_STATIC) +# ifndef PCRE2_EXP_DECL +# define PCRE2_EXP_DECL extern __declspec(dllimport) +# endif +#endif + +/* By default, we use the standard "extern" declarations. */ + +#ifndef PCRE2_EXP_DECL +# ifdef __cplusplus +# define PCRE2_EXP_DECL extern "C" +# else +# define PCRE2_EXP_DECL extern +# endif +#endif + +/* When compiling with the MSVC compiler, it is sometimes necessary to include +a "calling convention" before exported function names. (This is secondhand +information; I know nothing about MSVC myself). For example, something like + + void __cdecl function(....) + +might be needed. In order so make this easy, all the exported functions have +PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not +set, we ensure here that it has no effect. */ + +#ifndef PCRE2_CALL_CONVENTION +#define PCRE2_CALL_CONVENTION +#endif + +/* Have to include limits.h, stdlib.h, and inttypes.h to ensure that size_t and +uint8_t, UCHAR_MAX, etc are defined. Some systems that do have inttypes.h do +not have stdint.h, which is why we use inttypes.h, which according to the C +standard is a superset of stdint.h. If inttypes.h is not available the build +will break and the relevant values must be provided by some other means. */ + +#include +#include +#include + +/* Allow for C++ users compiling this directly. */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* The following option bits can be passed to pcre2_compile(), pcre2_match(), +or pcre2_dfa_match(). PCRE2_NO_UTF_CHECK affects only the function to which it +is passed. Put these bits at the most significant end of the options word so +others can be added next to them */ + +#define PCRE2_ANCHORED 0x80000000u +#define PCRE2_NO_UTF_CHECK 0x40000000u +#define PCRE2_ENDANCHORED 0x20000000u + +/* The following option bits can be passed only to pcre2_compile(). However, +they may affect compilation, JIT compilation, and/or interpretive execution. +The following tags indicate which: + +C alters what is compiled by pcre2_compile() +J alters what is compiled by pcre2_jit_compile() +M is inspected during pcre2_match() execution +D is inspected during pcre2_dfa_match() execution +*/ + +#define PCRE2_ALLOW_EMPTY_CLASS 0x00000001u /* C */ +#define PCRE2_ALT_BSUX 0x00000002u /* C */ +#define PCRE2_AUTO_CALLOUT 0x00000004u /* C */ +#define PCRE2_CASELESS 0x00000008u /* C */ +#define PCRE2_DOLLAR_ENDONLY 0x00000010u /* J M D */ +#define PCRE2_DOTALL 0x00000020u /* C */ +#define PCRE2_DUPNAMES 0x00000040u /* C */ +#define PCRE2_EXTENDED 0x00000080u /* C */ +#define PCRE2_FIRSTLINE 0x00000100u /* J M D */ +#define PCRE2_MATCH_UNSET_BACKREF 0x00000200u /* C J M */ +#define PCRE2_MULTILINE 0x00000400u /* C */ +#define PCRE2_NEVER_UCP 0x00000800u /* C */ +#define PCRE2_NEVER_UTF 0x00001000u /* C */ +#define PCRE2_NO_AUTO_CAPTURE 0x00002000u /* C */ +#define PCRE2_NO_AUTO_POSSESS 0x00004000u /* C */ +#define PCRE2_NO_DOTSTAR_ANCHOR 0x00008000u /* C */ +#define PCRE2_NO_START_OPTIMIZE 0x00010000u /* J M D */ +#define PCRE2_UCP 0x00020000u /* C J M D */ +#define PCRE2_UNGREEDY 0x00040000u /* C */ +#define PCRE2_UTF 0x00080000u /* C J M D */ +#define PCRE2_NEVER_BACKSLASH_C 0x00100000u /* C */ +#define PCRE2_ALT_CIRCUMFLEX 0x00200000u /* J M D */ +#define PCRE2_ALT_VERBNAMES 0x00400000u /* C */ +#define PCRE2_USE_OFFSET_LIMIT 0x00800000u /* J M D */ +#define PCRE2_EXTENDED_MORE 0x01000000u /* C */ +#define PCRE2_LITERAL 0x02000000u /* C */ +#define PCRE2_MATCH_INVALID_UTF 0x04000000u /* J M D */ + +/* An additional compile options word is available in the compile context. */ + +#define PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES 0x00000001u /* C */ +#define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL 0x00000002u /* C */ +#define PCRE2_EXTRA_MATCH_WORD 0x00000004u /* C */ +#define PCRE2_EXTRA_MATCH_LINE 0x00000008u /* C */ +#define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */ +#define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */ +#define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK 0x00000040u /* C */ + +/* These are for pcre2_jit_compile(). */ + +#define PCRE2_JIT_COMPLETE 0x00000001u /* For full matching */ +#define PCRE2_JIT_PARTIAL_SOFT 0x00000002u +#define PCRE2_JIT_PARTIAL_HARD 0x00000004u +#define PCRE2_JIT_INVALID_UTF 0x00000100u + +/* These are for pcre2_match(), pcre2_dfa_match(), pcre2_jit_match(), and +pcre2_substitute(). Some are allowed only for one of the functions, and in +these cases it is noted below. Note that PCRE2_ANCHORED, PCRE2_ENDANCHORED and +PCRE2_NO_UTF_CHECK can also be passed to these functions (though +pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */ + +#define PCRE2_NOTBOL 0x00000001u +#define PCRE2_NOTEOL 0x00000002u +#define PCRE2_NOTEMPTY 0x00000004u /* ) These two must be kept */ +#define PCRE2_NOTEMPTY_ATSTART 0x00000008u /* ) adjacent to each other. */ +#define PCRE2_PARTIAL_SOFT 0x00000010u +#define PCRE2_PARTIAL_HARD 0x00000020u +#define PCRE2_DFA_RESTART 0x00000040u /* pcre2_dfa_match() only */ +#define PCRE2_DFA_SHORTEST 0x00000080u /* pcre2_dfa_match() only */ +#define PCRE2_SUBSTITUTE_GLOBAL 0x00000100u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_EXTENDED 0x00000200u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* pcre2_substitute() only */ +#define PCRE2_NO_JIT 0x00002000u /* Not for pcre2_dfa_match() */ +#define PCRE2_COPY_MATCHED_SUBJECT 0x00004000u +#define PCRE2_SUBSTITUTE_LITERAL 0x00008000u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_MATCHED 0x00010000u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_REPLACEMENT_ONLY 0x00020000u /* pcre2_substitute() only */ + +/* Options for pcre2_pattern_convert(). */ + +#define PCRE2_CONVERT_UTF 0x00000001u +#define PCRE2_CONVERT_NO_UTF_CHECK 0x00000002u +#define PCRE2_CONVERT_POSIX_BASIC 0x00000004u +#define PCRE2_CONVERT_POSIX_EXTENDED 0x00000008u +#define PCRE2_CONVERT_GLOB 0x00000010u +#define PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR 0x00000030u +#define PCRE2_CONVERT_GLOB_NO_STARSTAR 0x00000050u + +/* Newline and \R settings, for use in compile contexts. The newline values +must be kept in step with values set in config.h and both sets must all be +greater than zero. */ + +#define PCRE2_NEWLINE_CR 1 +#define PCRE2_NEWLINE_LF 2 +#define PCRE2_NEWLINE_CRLF 3 +#define PCRE2_NEWLINE_ANY 4 +#define PCRE2_NEWLINE_ANYCRLF 5 +#define PCRE2_NEWLINE_NUL 6 + +#define PCRE2_BSR_UNICODE 1 +#define PCRE2_BSR_ANYCRLF 2 + +/* Error codes for pcre2_compile(). Some of these are also used by +pcre2_pattern_convert(). */ + +#define PCRE2_ERROR_END_BACKSLASH 101 +#define PCRE2_ERROR_END_BACKSLASH_C 102 +#define PCRE2_ERROR_UNKNOWN_ESCAPE 103 +#define PCRE2_ERROR_QUANTIFIER_OUT_OF_ORDER 104 +#define PCRE2_ERROR_QUANTIFIER_TOO_BIG 105 +#define PCRE2_ERROR_MISSING_SQUARE_BRACKET 106 +#define PCRE2_ERROR_ESCAPE_INVALID_IN_CLASS 107 +#define PCRE2_ERROR_CLASS_RANGE_ORDER 108 +#define PCRE2_ERROR_QUANTIFIER_INVALID 109 +#define PCRE2_ERROR_INTERNAL_UNEXPECTED_REPEAT 110 +#define PCRE2_ERROR_INVALID_AFTER_PARENS_QUERY 111 +#define PCRE2_ERROR_POSIX_CLASS_NOT_IN_CLASS 112 +#define PCRE2_ERROR_POSIX_NO_SUPPORT_COLLATING 113 +#define PCRE2_ERROR_MISSING_CLOSING_PARENTHESIS 114 +#define PCRE2_ERROR_BAD_SUBPATTERN_REFERENCE 115 +#define PCRE2_ERROR_NULL_PATTERN 116 +#define PCRE2_ERROR_BAD_OPTIONS 117 +#define PCRE2_ERROR_MISSING_COMMENT_CLOSING 118 +#define PCRE2_ERROR_PARENTHESES_NEST_TOO_DEEP 119 +#define PCRE2_ERROR_PATTERN_TOO_LARGE 120 +#define PCRE2_ERROR_HEAP_FAILED 121 +#define PCRE2_ERROR_UNMATCHED_CLOSING_PARENTHESIS 122 +#define PCRE2_ERROR_INTERNAL_CODE_OVERFLOW 123 +#define PCRE2_ERROR_MISSING_CONDITION_CLOSING 124 +#define PCRE2_ERROR_LOOKBEHIND_NOT_FIXED_LENGTH 125 +#define PCRE2_ERROR_ZERO_RELATIVE_REFERENCE 126 +#define PCRE2_ERROR_TOO_MANY_CONDITION_BRANCHES 127 +#define PCRE2_ERROR_CONDITION_ASSERTION_EXPECTED 128 +#define PCRE2_ERROR_BAD_RELATIVE_REFERENCE 129 +#define PCRE2_ERROR_UNKNOWN_POSIX_CLASS 130 +#define PCRE2_ERROR_INTERNAL_STUDY_ERROR 131 +#define PCRE2_ERROR_UNICODE_NOT_SUPPORTED 132 +#define PCRE2_ERROR_PARENTHESES_STACK_CHECK 133 +#define PCRE2_ERROR_CODE_POINT_TOO_BIG 134 +#define PCRE2_ERROR_LOOKBEHIND_TOO_COMPLICATED 135 +#define PCRE2_ERROR_LOOKBEHIND_INVALID_BACKSLASH_C 136 +#define PCRE2_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE 137 +#define PCRE2_ERROR_CALLOUT_NUMBER_TOO_BIG 138 +#define PCRE2_ERROR_MISSING_CALLOUT_CLOSING 139 +#define PCRE2_ERROR_ESCAPE_INVALID_IN_VERB 140 +#define PCRE2_ERROR_UNRECOGNIZED_AFTER_QUERY_P 141 +#define PCRE2_ERROR_MISSING_NAME_TERMINATOR 142 +#define PCRE2_ERROR_DUPLICATE_SUBPATTERN_NAME 143 +#define PCRE2_ERROR_INVALID_SUBPATTERN_NAME 144 +#define PCRE2_ERROR_UNICODE_PROPERTIES_UNAVAILABLE 145 +#define PCRE2_ERROR_MALFORMED_UNICODE_PROPERTY 146 +#define PCRE2_ERROR_UNKNOWN_UNICODE_PROPERTY 147 +#define PCRE2_ERROR_SUBPATTERN_NAME_TOO_LONG 148 +#define PCRE2_ERROR_TOO_MANY_NAMED_SUBPATTERNS 149 +#define PCRE2_ERROR_CLASS_INVALID_RANGE 150 +#define PCRE2_ERROR_OCTAL_BYTE_TOO_BIG 151 +#define PCRE2_ERROR_INTERNAL_OVERRAN_WORKSPACE 152 +#define PCRE2_ERROR_INTERNAL_MISSING_SUBPATTERN 153 +#define PCRE2_ERROR_DEFINE_TOO_MANY_BRANCHES 154 +#define PCRE2_ERROR_BACKSLASH_O_MISSING_BRACE 155 +#define PCRE2_ERROR_INTERNAL_UNKNOWN_NEWLINE 156 +#define PCRE2_ERROR_BACKSLASH_G_SYNTAX 157 +#define PCRE2_ERROR_PARENS_QUERY_R_MISSING_CLOSING 158 +/* Error 159 is obsolete and should now never occur */ +#define PCRE2_ERROR_VERB_ARGUMENT_NOT_ALLOWED 159 +#define PCRE2_ERROR_VERB_UNKNOWN 160 +#define PCRE2_ERROR_SUBPATTERN_NUMBER_TOO_BIG 161 +#define PCRE2_ERROR_SUBPATTERN_NAME_EXPECTED 162 +#define PCRE2_ERROR_INTERNAL_PARSED_OVERFLOW 163 +#define PCRE2_ERROR_INVALID_OCTAL 164 +#define PCRE2_ERROR_SUBPATTERN_NAMES_MISMATCH 165 +#define PCRE2_ERROR_MARK_MISSING_ARGUMENT 166 +#define PCRE2_ERROR_INVALID_HEXADECIMAL 167 +#define PCRE2_ERROR_BACKSLASH_C_SYNTAX 168 +#define PCRE2_ERROR_BACKSLASH_K_SYNTAX 169 +#define PCRE2_ERROR_INTERNAL_BAD_CODE_LOOKBEHINDS 170 +#define PCRE2_ERROR_BACKSLASH_N_IN_CLASS 171 +#define PCRE2_ERROR_CALLOUT_STRING_TOO_LONG 172 +#define PCRE2_ERROR_UNICODE_DISALLOWED_CODE_POINT 173 +#define PCRE2_ERROR_UTF_IS_DISABLED 174 +#define PCRE2_ERROR_UCP_IS_DISABLED 175 +#define PCRE2_ERROR_VERB_NAME_TOO_LONG 176 +#define PCRE2_ERROR_BACKSLASH_U_CODE_POINT_TOO_BIG 177 +#define PCRE2_ERROR_MISSING_OCTAL_OR_HEX_DIGITS 178 +#define PCRE2_ERROR_VERSION_CONDITION_SYNTAX 179 +#define PCRE2_ERROR_INTERNAL_BAD_CODE_AUTO_POSSESS 180 +#define PCRE2_ERROR_CALLOUT_NO_STRING_DELIMITER 181 +#define PCRE2_ERROR_CALLOUT_BAD_STRING_DELIMITER 182 +#define PCRE2_ERROR_BACKSLASH_C_CALLER_DISABLED 183 +#define PCRE2_ERROR_QUERY_BARJX_NEST_TOO_DEEP 184 +#define PCRE2_ERROR_BACKSLASH_C_LIBRARY_DISABLED 185 +#define PCRE2_ERROR_PATTERN_TOO_COMPLICATED 186 +#define PCRE2_ERROR_LOOKBEHIND_TOO_LONG 187 +#define PCRE2_ERROR_PATTERN_STRING_TOO_LONG 188 +#define PCRE2_ERROR_INTERNAL_BAD_CODE 189 +#define PCRE2_ERROR_INTERNAL_BAD_CODE_IN_SKIP 190 +#define PCRE2_ERROR_NO_SURROGATES_IN_UTF16 191 +#define PCRE2_ERROR_BAD_LITERAL_OPTIONS 192 +#define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE 193 +#define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS 194 +#define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN 195 +#define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE 196 +#define PCRE2_ERROR_TOO_MANY_CAPTURES 197 +#define PCRE2_ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED 198 +#define PCRE2_ERROR_BACKSLASH_K_IN_LOOKAROUND 199 + + +/* "Expected" matching error codes: no match and partial match. */ + +#define PCRE2_ERROR_NOMATCH (-1) +#define PCRE2_ERROR_PARTIAL (-2) + +/* Error codes for UTF-8 validity checks */ + +#define PCRE2_ERROR_UTF8_ERR1 (-3) +#define PCRE2_ERROR_UTF8_ERR2 (-4) +#define PCRE2_ERROR_UTF8_ERR3 (-5) +#define PCRE2_ERROR_UTF8_ERR4 (-6) +#define PCRE2_ERROR_UTF8_ERR5 (-7) +#define PCRE2_ERROR_UTF8_ERR6 (-8) +#define PCRE2_ERROR_UTF8_ERR7 (-9) +#define PCRE2_ERROR_UTF8_ERR8 (-10) +#define PCRE2_ERROR_UTF8_ERR9 (-11) +#define PCRE2_ERROR_UTF8_ERR10 (-12) +#define PCRE2_ERROR_UTF8_ERR11 (-13) +#define PCRE2_ERROR_UTF8_ERR12 (-14) +#define PCRE2_ERROR_UTF8_ERR13 (-15) +#define PCRE2_ERROR_UTF8_ERR14 (-16) +#define PCRE2_ERROR_UTF8_ERR15 (-17) +#define PCRE2_ERROR_UTF8_ERR16 (-18) +#define PCRE2_ERROR_UTF8_ERR17 (-19) +#define PCRE2_ERROR_UTF8_ERR18 (-20) +#define PCRE2_ERROR_UTF8_ERR19 (-21) +#define PCRE2_ERROR_UTF8_ERR20 (-22) +#define PCRE2_ERROR_UTF8_ERR21 (-23) + +/* Error codes for UTF-16 validity checks */ + +#define PCRE2_ERROR_UTF16_ERR1 (-24) +#define PCRE2_ERROR_UTF16_ERR2 (-25) +#define PCRE2_ERROR_UTF16_ERR3 (-26) + +/* Error codes for UTF-32 validity checks */ + +#define PCRE2_ERROR_UTF32_ERR1 (-27) +#define PCRE2_ERROR_UTF32_ERR2 (-28) + +/* Miscellaneous error codes for pcre2[_dfa]_match(), substring extraction +functions, context functions, and serializing functions. They are in numerical +order. Originally they were in alphabetical order too, but now that PCRE2 is +released, the numbers must not be changed. */ + +#define PCRE2_ERROR_BADDATA (-29) +#define PCRE2_ERROR_MIXEDTABLES (-30) /* Name was changed */ +#define PCRE2_ERROR_BADMAGIC (-31) +#define PCRE2_ERROR_BADMODE (-32) +#define PCRE2_ERROR_BADOFFSET (-33) +#define PCRE2_ERROR_BADOPTION (-34) +#define PCRE2_ERROR_BADREPLACEMENT (-35) +#define PCRE2_ERROR_BADUTFOFFSET (-36) +#define PCRE2_ERROR_CALLOUT (-37) /* Never used by PCRE2 itself */ +#define PCRE2_ERROR_DFA_BADRESTART (-38) +#define PCRE2_ERROR_DFA_RECURSE (-39) +#define PCRE2_ERROR_DFA_UCOND (-40) +#define PCRE2_ERROR_DFA_UFUNC (-41) +#define PCRE2_ERROR_DFA_UITEM (-42) +#define PCRE2_ERROR_DFA_WSSIZE (-43) +#define PCRE2_ERROR_INTERNAL (-44) +#define PCRE2_ERROR_JIT_BADOPTION (-45) +#define PCRE2_ERROR_JIT_STACKLIMIT (-46) +#define PCRE2_ERROR_MATCHLIMIT (-47) +#define PCRE2_ERROR_NOMEMORY (-48) +#define PCRE2_ERROR_NOSUBSTRING (-49) +#define PCRE2_ERROR_NOUNIQUESUBSTRING (-50) +#define PCRE2_ERROR_NULL (-51) +#define PCRE2_ERROR_RECURSELOOP (-52) +#define PCRE2_ERROR_DEPTHLIMIT (-53) +#define PCRE2_ERROR_RECURSIONLIMIT (-53) /* Obsolete synonym */ +#define PCRE2_ERROR_UNAVAILABLE (-54) +#define PCRE2_ERROR_UNSET (-55) +#define PCRE2_ERROR_BADOFFSETLIMIT (-56) +#define PCRE2_ERROR_BADREPESCAPE (-57) +#define PCRE2_ERROR_REPMISSINGBRACE (-58) +#define PCRE2_ERROR_BADSUBSTITUTION (-59) +#define PCRE2_ERROR_BADSUBSPATTERN (-60) +#define PCRE2_ERROR_TOOMANYREPLACE (-61) +#define PCRE2_ERROR_BADSERIALIZEDDATA (-62) +#define PCRE2_ERROR_HEAPLIMIT (-63) +#define PCRE2_ERROR_CONVERT_SYNTAX (-64) +#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) +#define PCRE2_ERROR_DFA_UINVALID_UTF (-66) + + +/* Request types for pcre2_pattern_info() */ + +#define PCRE2_INFO_ALLOPTIONS 0 +#define PCRE2_INFO_ARGOPTIONS 1 +#define PCRE2_INFO_BACKREFMAX 2 +#define PCRE2_INFO_BSR 3 +#define PCRE2_INFO_CAPTURECOUNT 4 +#define PCRE2_INFO_FIRSTCODEUNIT 5 +#define PCRE2_INFO_FIRSTCODETYPE 6 +#define PCRE2_INFO_FIRSTBITMAP 7 +#define PCRE2_INFO_HASCRORLF 8 +#define PCRE2_INFO_JCHANGED 9 +#define PCRE2_INFO_JITSIZE 10 +#define PCRE2_INFO_LASTCODEUNIT 11 +#define PCRE2_INFO_LASTCODETYPE 12 +#define PCRE2_INFO_MATCHEMPTY 13 +#define PCRE2_INFO_MATCHLIMIT 14 +#define PCRE2_INFO_MAXLOOKBEHIND 15 +#define PCRE2_INFO_MINLENGTH 16 +#define PCRE2_INFO_NAMECOUNT 17 +#define PCRE2_INFO_NAMEENTRYSIZE 18 +#define PCRE2_INFO_NAMETABLE 19 +#define PCRE2_INFO_NEWLINE 20 +#define PCRE2_INFO_DEPTHLIMIT 21 +#define PCRE2_INFO_RECURSIONLIMIT 21 /* Obsolete synonym */ +#define PCRE2_INFO_SIZE 22 +#define PCRE2_INFO_HASBACKSLASHC 23 +#define PCRE2_INFO_FRAMESIZE 24 +#define PCRE2_INFO_HEAPLIMIT 25 +#define PCRE2_INFO_EXTRAOPTIONS 26 + +/* Request types for pcre2_config(). */ + +#define PCRE2_CONFIG_BSR 0 +#define PCRE2_CONFIG_JIT 1 +#define PCRE2_CONFIG_JITTARGET 2 +#define PCRE2_CONFIG_LINKSIZE 3 +#define PCRE2_CONFIG_MATCHLIMIT 4 +#define PCRE2_CONFIG_NEWLINE 5 +#define PCRE2_CONFIG_PARENSLIMIT 6 +#define PCRE2_CONFIG_DEPTHLIMIT 7 +#define PCRE2_CONFIG_RECURSIONLIMIT 7 /* Obsolete synonym */ +#define PCRE2_CONFIG_STACKRECURSE 8 /* Obsolete */ +#define PCRE2_CONFIG_UNICODE 9 +#define PCRE2_CONFIG_UNICODE_VERSION 10 +#define PCRE2_CONFIG_VERSION 11 +#define PCRE2_CONFIG_HEAPLIMIT 12 +#define PCRE2_CONFIG_NEVER_BACKSLASH_C 13 +#define PCRE2_CONFIG_COMPILED_WIDTHS 14 +#define PCRE2_CONFIG_TABLES_LENGTH 15 + + +/* Types for code units in patterns and subject strings. */ + +typedef uint8_t PCRE2_UCHAR8; +typedef uint16_t PCRE2_UCHAR16; +typedef uint32_t PCRE2_UCHAR32; + +typedef const PCRE2_UCHAR8 *PCRE2_SPTR8; +typedef const PCRE2_UCHAR16 *PCRE2_SPTR16; +typedef const PCRE2_UCHAR32 *PCRE2_SPTR32; + +/* The PCRE2_SIZE type is used for all string lengths and offsets in PCRE2, +including pattern offsets for errors and subject offsets after a match. We +define special values to indicate zero-terminated strings and unset offsets in +the offset vector (ovector). */ + +#define PCRE2_SIZE size_t +#define PCRE2_SIZE_MAX SIZE_MAX +#define PCRE2_ZERO_TERMINATED (~(PCRE2_SIZE)0) +#define PCRE2_UNSET (~(PCRE2_SIZE)0) + +/* Generic types for opaque structures and JIT callback functions. These +declarations are defined in a macro that is expanded for each width later. */ + +#define PCRE2_TYPES_LIST \ +struct pcre2_real_general_context; \ +typedef struct pcre2_real_general_context pcre2_general_context; \ +\ +struct pcre2_real_compile_context; \ +typedef struct pcre2_real_compile_context pcre2_compile_context; \ +\ +struct pcre2_real_match_context; \ +typedef struct pcre2_real_match_context pcre2_match_context; \ +\ +struct pcre2_real_convert_context; \ +typedef struct pcre2_real_convert_context pcre2_convert_context; \ +\ +struct pcre2_real_code; \ +typedef struct pcre2_real_code pcre2_code; \ +\ +struct pcre2_real_match_data; \ +typedef struct pcre2_real_match_data pcre2_match_data; \ +\ +struct pcre2_real_jit_stack; \ +typedef struct pcre2_real_jit_stack pcre2_jit_stack; \ +\ +typedef pcre2_jit_stack *(*pcre2_jit_callback)(void *); + + +/* The structures for passing out data via callout functions. We use structures +so that new fields can be added on the end in future versions, without changing +the API of the function, thereby allowing old clients to work without +modification. Define the generic versions in a macro; the width-specific +versions are generated from this macro below. */ + +/* Flags for the callout_flags field. These are cleared after a callout. */ + +#define PCRE2_CALLOUT_STARTMATCH 0x00000001u /* Set for each bumpalong */ +#define PCRE2_CALLOUT_BACKTRACK 0x00000002u /* Set after a backtrack */ + +#define PCRE2_STRUCTURE_LIST \ +typedef struct pcre2_callout_block { \ + uint32_t version; /* Identifies version of block */ \ + /* ------------------------ Version 0 ------------------------------- */ \ + uint32_t callout_number; /* Number compiled into pattern */ \ + uint32_t capture_top; /* Max current capture */ \ + uint32_t capture_last; /* Most recently closed capture */ \ + PCRE2_SIZE *offset_vector; /* The offset vector */ \ + PCRE2_SPTR mark; /* Pointer to current mark or NULL */ \ + PCRE2_SPTR subject; /* The subject being matched */ \ + PCRE2_SIZE subject_length; /* The length of the subject */ \ + PCRE2_SIZE start_match; /* Offset to start of this match attempt */ \ + PCRE2_SIZE current_position; /* Where we currently are in the subject */ \ + PCRE2_SIZE pattern_position; /* Offset to next item in the pattern */ \ + PCRE2_SIZE next_item_length; /* Length of next item in the pattern */ \ + /* ------------------- Added for Version 1 -------------------------- */ \ + PCRE2_SIZE callout_string_offset; /* Offset to string within pattern */ \ + PCRE2_SIZE callout_string_length; /* Length of string compiled into pattern */ \ + PCRE2_SPTR callout_string; /* String compiled into pattern */ \ + /* ------------------- Added for Version 2 -------------------------- */ \ + uint32_t callout_flags; /* See above for list */ \ + /* ------------------------------------------------------------------ */ \ +} pcre2_callout_block; \ +\ +typedef struct pcre2_callout_enumerate_block { \ + uint32_t version; /* Identifies version of block */ \ + /* ------------------------ Version 0 ------------------------------- */ \ + PCRE2_SIZE pattern_position; /* Offset to next item in the pattern */ \ + PCRE2_SIZE next_item_length; /* Length of next item in the pattern */ \ + uint32_t callout_number; /* Number compiled into pattern */ \ + PCRE2_SIZE callout_string_offset; /* Offset to string within pattern */ \ + PCRE2_SIZE callout_string_length; /* Length of string compiled into pattern */ \ + PCRE2_SPTR callout_string; /* String compiled into pattern */ \ + /* ------------------------------------------------------------------ */ \ +} pcre2_callout_enumerate_block; \ +\ +typedef struct pcre2_substitute_callout_block { \ + uint32_t version; /* Identifies version of block */ \ + /* ------------------------ Version 0 ------------------------------- */ \ + PCRE2_SPTR input; /* Pointer to input subject string */ \ + PCRE2_SPTR output; /* Pointer to output buffer */ \ + PCRE2_SIZE output_offsets[2]; /* Changed portion of the output */ \ + PCRE2_SIZE *ovector; /* Pointer to current ovector */ \ + uint32_t oveccount; /* Count of pairs set in ovector */ \ + uint32_t subscount; /* Substitution number */ \ + /* ------------------------------------------------------------------ */ \ +} pcre2_substitute_callout_block; + + +/* List the generic forms of all other functions in macros, which will be +expanded for each width below. Start with functions that give general +information. */ + +#define PCRE2_GENERAL_INFO_FUNCTIONS \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION pcre2_config(uint32_t, void *); + + +/* Functions for manipulating contexts. */ + +#define PCRE2_GENERAL_CONTEXT_FUNCTIONS \ +PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \ + *pcre2_general_context_copy(pcre2_general_context *); \ +PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \ + *pcre2_general_context_create(void *(*)(PCRE2_SIZE, void *), \ + void (*)(void *, void *), void *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_general_context_free(pcre2_general_context *); + +#define PCRE2_COMPILE_CONTEXT_FUNCTIONS \ +PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \ + *pcre2_compile_context_copy(pcre2_compile_context *); \ +PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \ + *pcre2_compile_context_create(pcre2_general_context *);\ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_compile_context_free(pcre2_compile_context *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_bsr(pcre2_compile_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_character_tables(pcre2_compile_context *, const uint8_t *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_newline(pcre2_compile_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_parens_nest_limit(pcre2_compile_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_compile_recursion_guard(pcre2_compile_context *, \ + int (*)(uint32_t, void *), void *); + +#define PCRE2_MATCH_CONTEXT_FUNCTIONS \ +PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \ + *pcre2_match_context_copy(pcre2_match_context *); \ +PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \ + *pcre2_match_context_create(pcre2_general_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_match_context_free(pcre2_match_context *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_callout(pcre2_match_context *, \ + int (*)(pcre2_callout_block *, void *), void *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_substitute_callout(pcre2_match_context *, \ + int (*)(pcre2_substitute_callout_block *, void *), void *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_heap_limit(pcre2_match_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_match_limit(pcre2_match_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_offset_limit(pcre2_match_context *, PCRE2_SIZE); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_recursion_memory_management(pcre2_match_context *, \ + void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *); + +#define PCRE2_CONVERT_CONTEXT_FUNCTIONS \ +PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \ + *pcre2_convert_context_copy(pcre2_convert_context *); \ +PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \ + *pcre2_convert_context_create(pcre2_general_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_convert_context_free(pcre2_convert_context *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_glob_escape(pcre2_convert_context *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_glob_separator(pcre2_convert_context *, uint32_t); + + +/* Functions concerned with compiling a pattern to PCRE internal code. */ + +#define PCRE2_COMPILE_FUNCTIONS \ +PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \ + *pcre2_compile(PCRE2_SPTR, PCRE2_SIZE, uint32_t, int *, PCRE2_SIZE *, \ + pcre2_compile_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_code_free(pcre2_code *); \ +PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \ + *pcre2_code_copy(const pcre2_code *); \ +PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \ + *pcre2_code_copy_with_tables(const pcre2_code *); + + +/* Functions that give information about a compiled pattern. */ + +#define PCRE2_PATTERN_INFO_FUNCTIONS \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_pattern_info(const pcre2_code *, uint32_t, void *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_callout_enumerate(const pcre2_code *, \ + int (*)(pcre2_callout_enumerate_block *, void *), void *); + + +/* Functions for running a match and inspecting the result. */ + +#define PCRE2_MATCH_FUNCTIONS \ +PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \ + *pcre2_match_data_create(uint32_t, pcre2_general_context *); \ +PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \ + *pcre2_match_data_create_from_pattern(const pcre2_code *, \ + pcre2_general_context *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ + uint32_t, pcre2_match_data *, pcre2_match_context *, int *, PCRE2_SIZE); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ + uint32_t, pcre2_match_data *, pcre2_match_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_match_data_free(pcre2_match_data *); \ +PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \ + pcre2_get_mark(pcre2_match_data *); \ +PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ + pcre2_get_match_data_size(pcre2_match_data *); \ +PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \ + pcre2_get_ovector_count(pcre2_match_data *); \ +PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ + *pcre2_get_ovector_pointer(pcre2_match_data *); \ +PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ + pcre2_get_startchar(pcre2_match_data *); + + +/* Convenience functions for handling matched substrings. */ + +#define PCRE2_SUBSTRING_FUNCTIONS \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_copy_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR *, \ + PCRE2_SIZE *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_copy_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR *, \ + PCRE2_SIZE *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_substring_free(PCRE2_UCHAR *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_get_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR **, \ + PCRE2_SIZE *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_get_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR **, \ + PCRE2_SIZE *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_length_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_SIZE *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_length_bynumber(pcre2_match_data *, uint32_t, PCRE2_SIZE *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_nametable_scan(const pcre2_code *, PCRE2_SPTR, PCRE2_SPTR *, \ + PCRE2_SPTR *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_substring_list_free(PCRE2_SPTR *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **); + +/* Functions for serializing / deserializing compiled patterns. */ + +#define PCRE2_SERIALIZE_FUNCTIONS \ +PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \ + pcre2_serialize_encode(const pcre2_code **, int32_t, uint8_t **, \ + PCRE2_SIZE *, pcre2_general_context *); \ +PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \ + pcre2_serialize_decode(pcre2_code **, int32_t, const uint8_t *, \ + pcre2_general_context *); \ +PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \ + pcre2_serialize_get_number_of_codes(const uint8_t *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_serialize_free(uint8_t *); + + +/* Convenience function for match + substitute. */ + +#define PCRE2_SUBSTITUTE_FUNCTION \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_substitute(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ + uint32_t, pcre2_match_data *, pcre2_match_context *, PCRE2_SPTR, \ + PCRE2_SIZE, PCRE2_UCHAR *, PCRE2_SIZE *); + + +/* Functions for converting pattern source strings. */ + +#define PCRE2_CONVERT_FUNCTIONS \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_pattern_convert(PCRE2_SPTR, PCRE2_SIZE, uint32_t, PCRE2_UCHAR **, \ + PCRE2_SIZE *, pcre2_convert_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_converted_pattern_free(PCRE2_UCHAR *); + + +/* Functions for JIT processing */ + +#define PCRE2_JIT_FUNCTIONS \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_jit_compile(pcre2_code *, uint32_t); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_jit_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ + uint32_t, pcre2_match_data *, pcre2_match_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_jit_free_unused_memory(pcre2_general_context *); \ +PCRE2_EXP_DECL pcre2_jit_stack PCRE2_CALL_CONVENTION \ + *pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE, pcre2_general_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_jit_stack_free(pcre2_jit_stack *); + + +/* Other miscellaneous functions. */ + +#define PCRE2_OTHER_FUNCTIONS \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \ +PCRE2_EXP_DECL const uint8_t PCRE2_CALL_CONVENTION \ + *pcre2_maketables(pcre2_general_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_maketables_free(pcre2_general_context *, const uint8_t *); + +/* Define macros that generate width-specific names from generic versions. The +three-level macro scheme is necessary to get the macros expanded when we want +them to be. First we get the width from PCRE2_LOCAL_WIDTH, which is used for +generating three versions of everything below. After that, PCRE2_SUFFIX will be +re-defined to use PCRE2_CODE_UNIT_WIDTH, for use when macros such as +pcre2_compile are called by application code. */ + +#define PCRE2_JOIN(a,b) a ## b +#define PCRE2_GLUE(a,b) PCRE2_JOIN(a,b) +#define PCRE2_SUFFIX(a) PCRE2_GLUE(a,PCRE2_LOCAL_WIDTH) + + +/* Data types */ + +#define PCRE2_UCHAR PCRE2_SUFFIX(PCRE2_UCHAR) +#define PCRE2_SPTR PCRE2_SUFFIX(PCRE2_SPTR) + +#define pcre2_code PCRE2_SUFFIX(pcre2_code_) +#define pcre2_jit_callback PCRE2_SUFFIX(pcre2_jit_callback_) +#define pcre2_jit_stack PCRE2_SUFFIX(pcre2_jit_stack_) + +#define pcre2_real_code PCRE2_SUFFIX(pcre2_real_code_) +#define pcre2_real_general_context PCRE2_SUFFIX(pcre2_real_general_context_) +#define pcre2_real_compile_context PCRE2_SUFFIX(pcre2_real_compile_context_) +#define pcre2_real_convert_context PCRE2_SUFFIX(pcre2_real_convert_context_) +#define pcre2_real_match_context PCRE2_SUFFIX(pcre2_real_match_context_) +#define pcre2_real_jit_stack PCRE2_SUFFIX(pcre2_real_jit_stack_) +#define pcre2_real_match_data PCRE2_SUFFIX(pcre2_real_match_data_) + + +/* Data blocks */ + +#define pcre2_callout_block PCRE2_SUFFIX(pcre2_callout_block_) +#define pcre2_callout_enumerate_block PCRE2_SUFFIX(pcre2_callout_enumerate_block_) +#define pcre2_substitute_callout_block PCRE2_SUFFIX(pcre2_substitute_callout_block_) +#define pcre2_general_context PCRE2_SUFFIX(pcre2_general_context_) +#define pcre2_compile_context PCRE2_SUFFIX(pcre2_compile_context_) +#define pcre2_convert_context PCRE2_SUFFIX(pcre2_convert_context_) +#define pcre2_match_context PCRE2_SUFFIX(pcre2_match_context_) +#define pcre2_match_data PCRE2_SUFFIX(pcre2_match_data_) + + +/* Functions: the complete list in alphabetical order */ + +#define pcre2_callout_enumerate PCRE2_SUFFIX(pcre2_callout_enumerate_) +#define pcre2_code_copy PCRE2_SUFFIX(pcre2_code_copy_) +#define pcre2_code_copy_with_tables PCRE2_SUFFIX(pcre2_code_copy_with_tables_) +#define pcre2_code_free PCRE2_SUFFIX(pcre2_code_free_) +#define pcre2_compile PCRE2_SUFFIX(pcre2_compile_) +#define pcre2_compile_context_copy PCRE2_SUFFIX(pcre2_compile_context_copy_) +#define pcre2_compile_context_create PCRE2_SUFFIX(pcre2_compile_context_create_) +#define pcre2_compile_context_free PCRE2_SUFFIX(pcre2_compile_context_free_) +#define pcre2_config PCRE2_SUFFIX(pcre2_config_) +#define pcre2_convert_context_copy PCRE2_SUFFIX(pcre2_convert_context_copy_) +#define pcre2_convert_context_create PCRE2_SUFFIX(pcre2_convert_context_create_) +#define pcre2_convert_context_free PCRE2_SUFFIX(pcre2_convert_context_free_) +#define pcre2_converted_pattern_free PCRE2_SUFFIX(pcre2_converted_pattern_free_) +#define pcre2_dfa_match PCRE2_SUFFIX(pcre2_dfa_match_) +#define pcre2_general_context_copy PCRE2_SUFFIX(pcre2_general_context_copy_) +#define pcre2_general_context_create PCRE2_SUFFIX(pcre2_general_context_create_) +#define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_) +#define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_) +#define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_) +#define pcre2_get_match_data_size PCRE2_SUFFIX(pcre2_get_match_data_size_) +#define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_) +#define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_) +#define pcre2_get_startchar PCRE2_SUFFIX(pcre2_get_startchar_) +#define pcre2_jit_compile PCRE2_SUFFIX(pcre2_jit_compile_) +#define pcre2_jit_match PCRE2_SUFFIX(pcre2_jit_match_) +#define pcre2_jit_free_unused_memory PCRE2_SUFFIX(pcre2_jit_free_unused_memory_) +#define pcre2_jit_stack_assign PCRE2_SUFFIX(pcre2_jit_stack_assign_) +#define pcre2_jit_stack_create PCRE2_SUFFIX(pcre2_jit_stack_create_) +#define pcre2_jit_stack_free PCRE2_SUFFIX(pcre2_jit_stack_free_) +#define pcre2_maketables PCRE2_SUFFIX(pcre2_maketables_) +#define pcre2_maketables_free PCRE2_SUFFIX(pcre2_maketables_free_) +#define pcre2_match PCRE2_SUFFIX(pcre2_match_) +#define pcre2_match_context_copy PCRE2_SUFFIX(pcre2_match_context_copy_) +#define pcre2_match_context_create PCRE2_SUFFIX(pcre2_match_context_create_) +#define pcre2_match_context_free PCRE2_SUFFIX(pcre2_match_context_free_) +#define pcre2_match_data_create PCRE2_SUFFIX(pcre2_match_data_create_) +#define pcre2_match_data_create_from_pattern PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_) +#define pcre2_match_data_free PCRE2_SUFFIX(pcre2_match_data_free_) +#define pcre2_pattern_convert PCRE2_SUFFIX(pcre2_pattern_convert_) +#define pcre2_pattern_info PCRE2_SUFFIX(pcre2_pattern_info_) +#define pcre2_serialize_decode PCRE2_SUFFIX(pcre2_serialize_decode_) +#define pcre2_serialize_encode PCRE2_SUFFIX(pcre2_serialize_encode_) +#define pcre2_serialize_free PCRE2_SUFFIX(pcre2_serialize_free_) +#define pcre2_serialize_get_number_of_codes PCRE2_SUFFIX(pcre2_serialize_get_number_of_codes_) +#define pcre2_set_bsr PCRE2_SUFFIX(pcre2_set_bsr_) +#define pcre2_set_callout PCRE2_SUFFIX(pcre2_set_callout_) +#define pcre2_set_character_tables PCRE2_SUFFIX(pcre2_set_character_tables_) +#define pcre2_set_compile_extra_options PCRE2_SUFFIX(pcre2_set_compile_extra_options_) +#define pcre2_set_compile_recursion_guard PCRE2_SUFFIX(pcre2_set_compile_recursion_guard_) +#define pcre2_set_depth_limit PCRE2_SUFFIX(pcre2_set_depth_limit_) +#define pcre2_set_glob_escape PCRE2_SUFFIX(pcre2_set_glob_escape_) +#define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_) +#define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_) +#define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_) +#define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_) +#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_) +#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_) +#define pcre2_set_offset_limit PCRE2_SUFFIX(pcre2_set_offset_limit_) +#define pcre2_set_substitute_callout PCRE2_SUFFIX(pcre2_set_substitute_callout_) +#define pcre2_substitute PCRE2_SUFFIX(pcre2_substitute_) +#define pcre2_substring_copy_byname PCRE2_SUFFIX(pcre2_substring_copy_byname_) +#define pcre2_substring_copy_bynumber PCRE2_SUFFIX(pcre2_substring_copy_bynumber_) +#define pcre2_substring_free PCRE2_SUFFIX(pcre2_substring_free_) +#define pcre2_substring_get_byname PCRE2_SUFFIX(pcre2_substring_get_byname_) +#define pcre2_substring_get_bynumber PCRE2_SUFFIX(pcre2_substring_get_bynumber_) +#define pcre2_substring_length_byname PCRE2_SUFFIX(pcre2_substring_length_byname_) +#define pcre2_substring_length_bynumber PCRE2_SUFFIX(pcre2_substring_length_bynumber_) +#define pcre2_substring_list_get PCRE2_SUFFIX(pcre2_substring_list_get_) +#define pcre2_substring_list_free PCRE2_SUFFIX(pcre2_substring_list_free_) +#define pcre2_substring_nametable_scan PCRE2_SUFFIX(pcre2_substring_nametable_scan_) +#define pcre2_substring_number_from_name PCRE2_SUFFIX(pcre2_substring_number_from_name_) + +/* Keep this old function name for backwards compatibility */ +#define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_) + +/* Keep this obsolete function for backwards compatibility: it is now a noop. */ +#define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_) + +/* Now generate all three sets of width-specific structures and function +prototypes. */ + +#define PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS \ +PCRE2_TYPES_LIST \ +PCRE2_STRUCTURE_LIST \ +PCRE2_GENERAL_INFO_FUNCTIONS \ +PCRE2_GENERAL_CONTEXT_FUNCTIONS \ +PCRE2_COMPILE_CONTEXT_FUNCTIONS \ +PCRE2_CONVERT_CONTEXT_FUNCTIONS \ +PCRE2_CONVERT_FUNCTIONS \ +PCRE2_MATCH_CONTEXT_FUNCTIONS \ +PCRE2_COMPILE_FUNCTIONS \ +PCRE2_PATTERN_INFO_FUNCTIONS \ +PCRE2_MATCH_FUNCTIONS \ +PCRE2_SUBSTRING_FUNCTIONS \ +PCRE2_SERIALIZE_FUNCTIONS \ +PCRE2_SUBSTITUTE_FUNCTION \ +PCRE2_JIT_FUNCTIONS \ +PCRE2_OTHER_FUNCTIONS + +#define PCRE2_LOCAL_WIDTH 8 +PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS +#undef PCRE2_LOCAL_WIDTH + +#define PCRE2_LOCAL_WIDTH 16 +PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS +#undef PCRE2_LOCAL_WIDTH + +#define PCRE2_LOCAL_WIDTH 32 +PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS +#undef PCRE2_LOCAL_WIDTH + +/* Undefine the list macros; they are no longer needed. */ + +#undef PCRE2_TYPES_LIST +#undef PCRE2_STRUCTURE_LIST +#undef PCRE2_GENERAL_INFO_FUNCTIONS +#undef PCRE2_GENERAL_CONTEXT_FUNCTIONS +#undef PCRE2_COMPILE_CONTEXT_FUNCTIONS +#undef PCRE2_CONVERT_CONTEXT_FUNCTIONS +#undef PCRE2_MATCH_CONTEXT_FUNCTIONS +#undef PCRE2_COMPILE_FUNCTIONS +#undef PCRE2_PATTERN_INFO_FUNCTIONS +#undef PCRE2_MATCH_FUNCTIONS +#undef PCRE2_SUBSTRING_FUNCTIONS +#undef PCRE2_SERIALIZE_FUNCTIONS +#undef PCRE2_SUBSTITUTE_FUNCTION +#undef PCRE2_JIT_FUNCTIONS +#undef PCRE2_OTHER_FUNCTIONS +#undef PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS + +/* PCRE2_CODE_UNIT_WIDTH must be defined. If it is 8, 16, or 32, redefine +PCRE2_SUFFIX to use it. If it is 0, undefine the other macros and make +PCRE2_SUFFIX a no-op. Otherwise, generate an error. */ + +#undef PCRE2_SUFFIX +#ifndef PCRE2_CODE_UNIT_WIDTH +#error PCRE2_CODE_UNIT_WIDTH must be defined before including pcre2.h. +#error Use 8, 16, or 32; or 0 for a multi-width application. +#else /* PCRE2_CODE_UNIT_WIDTH is defined */ +#if PCRE2_CODE_UNIT_WIDTH == 8 || \ + PCRE2_CODE_UNIT_WIDTH == 16 || \ + PCRE2_CODE_UNIT_WIDTH == 32 +#define PCRE2_SUFFIX(a) PCRE2_GLUE(a, PCRE2_CODE_UNIT_WIDTH) +#elif PCRE2_CODE_UNIT_WIDTH == 0 +#undef PCRE2_JOIN +#undef PCRE2_GLUE +#define PCRE2_SUFFIX(a) a +#else +#error PCRE2_CODE_UNIT_WIDTH must be 0, 8, 16, or 32. +#endif +#endif /* PCRE2_CODE_UNIT_WIDTH is defined */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* PCRE2_H_IDEMPOTENT_GUARD */ + +/* End of pcre2.h */ diff --git a/include/php/ext/pcre/pcre2lib/pcre2_internal.h b/include/php/ext/pcre/pcre2lib/pcre2_internal.h new file mode 100644 index 0000000..92dd313 --- /dev/null +++ b/include/php/ext/pcre/pcre2lib/pcre2_internal.h @@ -0,0 +1,2047 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE2 is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2022 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +#ifndef PCRE2_INTERNAL_H_IDEMPOTENT_GUARD +#define PCRE2_INTERNAL_H_IDEMPOTENT_GUARD + +/* We do not support both EBCDIC and Unicode at the same time. The "configure" +script prevents both being selected, but not everybody uses "configure". EBCDIC +is only supported for the 8-bit library, but the check for this has to be later +in this file, because the first part is not width-dependent, and is included by +pcre2test.c with CODE_UNIT_WIDTH == 0. */ + +#if defined EBCDIC && defined SUPPORT_UNICODE +#error The use of both EBCDIC and SUPPORT_UNICODE is not supported. +#endif + +/* Standard C headers */ + +#include +#include +#include +#include +#include +#include + +/* Macros to make boolean values more obvious. The #ifndef is to pacify +compiler warnings in environments where these macros are defined elsewhere. +Unfortunately, there is no way to do the same for the typedef. */ + +typedef int BOOL; +#ifndef FALSE +#define FALSE 0 +#define TRUE 1 +#endif + +/* Valgrind (memcheck) support */ + +#ifdef SUPPORT_VALGRIND +#include +#endif + +/* -ftrivial-auto-var-init support supports initializing all local variables +to avoid some classes of bug, but this can cause an unacceptable slowdown +for large on-stack arrays in hot functions. This macro lets us annotate +such arrays. */ + +#ifdef HAVE_ATTRIBUTE_UNINITIALIZED +#define PCRE2_KEEP_UNINITIALIZED __attribute__((uninitialized)) +#else +#define PCRE2_KEEP_UNINITIALIZED +#endif + +/* Older versions of MSVC lack snprintf(). This define allows for +warning/error-free compilation and testing with MSVC compilers back to at least +MSVC 10/2010. Except for VC6 (which is missing some fundamentals and fails). */ + +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define snprintf _snprintf +#endif + +/* When compiling a DLL for Windows, the exported symbols have to be declared +using some MS magic. I found some useful information on this web page: +http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the +information there, using __declspec(dllexport) without "extern" we have a +definition; with "extern" we have a declaration. The settings here override the +setting in pcre2.h (which is included below); it defines only PCRE2_EXP_DECL, +which is all that is needed for applications (they just import the symbols). We +use: + + PCRE2_EXP_DECL for declarations + PCRE2_EXP_DEFN for definitions + +The reason for wrapping this in #ifndef PCRE2_EXP_DECL is so that pcre2test, +which is an application, but needs to import this file in order to "peek" at +internals, can #include pcre2.h first to get an application's-eye view. + +In principle, people compiling for non-Windows, non-Unix-like (i.e. uncommon, +special-purpose environments) might want to stick other stuff in front of +exported symbols. That's why, in the non-Windows case, we set PCRE2_EXP_DEFN +only if it is not already set. */ + +#ifndef PCRE2_EXP_DECL +# ifdef _WIN32 +# ifndef PCRE2_STATIC +# define PCRE2_EXP_DECL extern __declspec(dllexport) +# define PCRE2_EXP_DEFN __declspec(dllexport) +# else +# define PCRE2_EXP_DECL extern +# define PCRE2_EXP_DEFN +# endif +# else +# ifdef __cplusplus +# define PCRE2_EXP_DECL extern "C" +# else +# define PCRE2_EXP_DECL extern +# endif +# ifndef PCRE2_EXP_DEFN +# define PCRE2_EXP_DEFN PCRE2_EXP_DECL +# endif +# endif +#endif + +/* Include the public PCRE2 header and the definitions of UCP character +property values. This must follow the setting of PCRE2_EXP_DECL above. */ + +#include "pcre2.h" +#include "pcre2_ucp.h" + +/* When PCRE2 is compiled as a C++ library, the subject pointer can be replaced +with a custom type. This makes it possible, for example, to allow pcre2_match() +to process subject strings that are discontinuous by using a smart pointer +class. It must always be possible to inspect all of the subject string in +pcre2_match() because of the way it backtracks. */ + +/* WARNING: This is as yet untested for PCRE2. */ + +#ifdef CUSTOM_SUBJECT_PTR +#undef PCRE2_SPTR +#define PCRE2_SPTR CUSTOM_SUBJECT_PTR +#endif + +/* When checking for integer overflow in pcre2_compile(), we need to handle +large integers. If a 64-bit integer type is available, we can use that. +Otherwise we have to cast to double, which of course requires floating point +arithmetic. Handle this by defining a macro for the appropriate type. */ + +#if defined INT64_MAX || defined int64_t +#define INT64_OR_DOUBLE int64_t +#else +#define INT64_OR_DOUBLE double +#endif + +/* External (in the C sense) functions and tables that are private to the +libraries are always referenced using the PRIV macro. This makes it possible +for pcre2test.c to include some of the source files from the libraries using a +different PRIV definition to avoid name clashes. It also makes it clear in the +code that a non-static object is being referenced. */ + +#ifndef PRIV +#define PRIV(name) _pcre2_##name +#endif + +/* When compiling for use with the Virtual Pascal compiler, these functions +need to have their names changed. PCRE2 must be compiled with the -DVPCOMPAT +option on the command line. */ + +#ifdef VPCOMPAT +#define strlen(s) _strlen(s) +#define strncmp(s1,s2,m) _strncmp(s1,s2,m) +#define memcmp(s,c,n) _memcmp(s,c,n) +#define memcpy(d,s,n) _memcpy(d,s,n) +#define memmove(d,s,n) _memmove(d,s,n) +#define memset(s,c,n) _memset(s,c,n) +#else /* VPCOMPAT */ + +/* Otherwise, to cope with SunOS4 and other systems that lack memmove(), define +a macro that calls an emulating function. */ + +#ifndef HAVE_MEMMOVE +#undef memmove /* Some systems may have a macro */ +#define memmove(a, b, c) PRIV(memmove)(a, b, c) +#endif /* not HAVE_MEMMOVE */ +#endif /* not VPCOMPAT */ + +/* This is an unsigned int value that no UTF character can ever have, as +Unicode doesn't go beyond 0x0010ffff. */ + +#define NOTACHAR 0xffffffff + +/* This is the largest valid UTF/Unicode code point. */ + +#define MAX_UTF_CODE_POINT 0x10ffff + +/* Compile-time positive error numbers (all except UTF errors, which are +negative) start at this value. It should probably never be changed, in case +some application is checking for specific numbers. There is a copy of this +#define in pcre2posix.c (which now no longer includes this file). Ideally, a +way of having a single definition should be found, but as the number is +unlikely to change, this is not a pressing issue. The original reason for +having a base other than 0 was to keep the absolute values of compile-time and +run-time error numbers numerically different, but in the event the code does +not rely on this. */ + +#define COMPILE_ERROR_BASE 100 + +/* The initial frames vector for remembering pcre2_match() backtracking points +is allocated on the heap, of this size (bytes) or ten times the frame size if +larger, unless the heap limit is smaller. Typical frame sizes are a few hundred +bytes (it depends on the number of capturing parentheses) so 20KiB handles +quite a few frames. A larger vector on the heap is obtained for matches that +need more frames, subject to the heap limit. */ + +#define START_FRAMES_SIZE 20480 + +/* For DFA matching, an initial internal workspace vector is allocated on the +stack. The heap is used only if this turns out to be too small. */ + +#define DFA_START_RWS_SIZE 30720 + +/* Define the default BSR convention. */ + +#ifdef BSR_ANYCRLF +#define BSR_DEFAULT PCRE2_BSR_ANYCRLF +#else +#define BSR_DEFAULT PCRE2_BSR_UNICODE +#endif + + +/* ---------------- Basic UTF-8 macros ---------------- */ + +/* These UTF-8 macros are always defined because they are used in pcre2test for +handling wide characters in 16-bit and 32-bit modes, even if an 8-bit library +is not supported. */ + +/* Tests whether a UTF-8 code point needs extra bytes to decode. */ + +#define HASUTF8EXTRALEN(c) ((c) >= 0xc0) + +/* The following macros were originally written in the form of loops that used +data from the tables whose names start with PRIV(utf8_table). They were +rewritten by a user so as not to use loops, because in some environments this +gives a significant performance advantage, and it seems never to do any harm. +*/ + +/* Base macro to pick up the remaining bytes of a UTF-8 character, not +advancing the pointer. */ + +#define GETUTF8(c, eptr) \ + { \ + if ((c & 0x20u) == 0) \ + c = ((c & 0x1fu) << 6) | (eptr[1] & 0x3fu); \ + else if ((c & 0x10u) == 0) \ + c = ((c & 0x0fu) << 12) | ((eptr[1] & 0x3fu) << 6) | (eptr[2] & 0x3fu); \ + else if ((c & 0x08u) == 0) \ + c = ((c & 0x07u) << 18) | ((eptr[1] & 0x3fu) << 12) | \ + ((eptr[2] & 0x3fu) << 6) | (eptr[3] & 0x3fu); \ + else if ((c & 0x04u) == 0) \ + c = ((c & 0x03u) << 24) | ((eptr[1] & 0x3fu) << 18) | \ + ((eptr[2] & 0x3fu) << 12) | ((eptr[3] & 0x3fu) << 6) | \ + (eptr[4] & 0x3fu); \ + else \ + c = ((c & 0x01u) << 30) | ((eptr[1] & 0x3fu) << 24) | \ + ((eptr[2] & 0x3fu) << 18) | ((eptr[3] & 0x3fu) << 12) | \ + ((eptr[4] & 0x3fu) << 6) | (eptr[5] & 0x3fu); \ + } + +/* Base macro to pick up the remaining bytes of a UTF-8 character, advancing +the pointer. */ + +#define GETUTF8INC(c, eptr) \ + { \ + if ((c & 0x20u) == 0) \ + c = ((c & 0x1fu) << 6) | (*eptr++ & 0x3fu); \ + else if ((c & 0x10u) == 0) \ + { \ + c = ((c & 0x0fu) << 12) | ((*eptr & 0x3fu) << 6) | (eptr[1] & 0x3fu); \ + eptr += 2; \ + } \ + else if ((c & 0x08u) == 0) \ + { \ + c = ((c & 0x07u) << 18) | ((*eptr & 0x3fu) << 12) | \ + ((eptr[1] & 0x3fu) << 6) | (eptr[2] & 0x3fu); \ + eptr += 3; \ + } \ + else if ((c & 0x04u) == 0) \ + { \ + c = ((c & 0x03u) << 24) | ((*eptr & 0x3fu) << 18) | \ + ((eptr[1] & 0x3fu) << 12) | ((eptr[2] & 0x3fu) << 6) | \ + (eptr[3] & 0x3fu); \ + eptr += 4; \ + } \ + else \ + { \ + c = ((c & 0x01u) << 30) | ((*eptr & 0x3fu) << 24) | \ + ((eptr[1] & 0x3fu) << 18) | ((eptr[2] & 0x3fu) << 12) | \ + ((eptr[3] & 0x3fu) << 6) | (eptr[4] & 0x3fu); \ + eptr += 5; \ + } \ + } + +/* Base macro to pick up the remaining bytes of a UTF-8 character, not +advancing the pointer, incrementing the length. */ + +#define GETUTF8LEN(c, eptr, len) \ + { \ + if ((c & 0x20u) == 0) \ + { \ + c = ((c & 0x1fu) << 6) | (eptr[1] & 0x3fu); \ + len++; \ + } \ + else if ((c & 0x10u) == 0) \ + { \ + c = ((c & 0x0fu) << 12) | ((eptr[1] & 0x3fu) << 6) | (eptr[2] & 0x3fu); \ + len += 2; \ + } \ + else if ((c & 0x08u) == 0) \ + {\ + c = ((c & 0x07u) << 18) | ((eptr[1] & 0x3fu) << 12) | \ + ((eptr[2] & 0x3fu) << 6) | (eptr[3] & 0x3fu); \ + len += 3; \ + } \ + else if ((c & 0x04u) == 0) \ + { \ + c = ((c & 0x03u) << 24) | ((eptr[1] & 0x3fu) << 18) | \ + ((eptr[2] & 0x3fu) << 12) | ((eptr[3] & 0x3fu) << 6) | \ + (eptr[4] & 0x3fu); \ + len += 4; \ + } \ + else \ + {\ + c = ((c & 0x01u) << 30) | ((eptr[1] & 0x3fu) << 24) | \ + ((eptr[2] & 0x3fu) << 18) | ((eptr[3] & 0x3fu) << 12) | \ + ((eptr[4] & 0x3fu) << 6) | (eptr[5] & 0x3fu); \ + len += 5; \ + } \ + } + +/* --------------- Whitespace macros ---------------- */ + +/* Tests for Unicode horizontal and vertical whitespace characters must check a +number of different values. Using a switch statement for this generates the +fastest code (no loop, no memory access), and there are several places in the +interpreter code where this happens. In order to ensure that all the case lists +remain in step, we use macros so that there is only one place where the lists +are defined. + +These values are also required as lists in pcre2_compile.c when processing \h, +\H, \v and \V in a character class. The lists are defined in pcre2_tables.c, +but macros that define the values are here so that all the definitions are +together. The lists must be in ascending character order, terminated by +NOTACHAR (which is 0xffffffff). + +Any changes should ensure that the various macros are kept in step with each +other. NOTE: The values also appear in pcre2_jit_compile.c. */ + +/* -------------- ASCII/Unicode environments -------------- */ + +#ifndef EBCDIC + +/* Character U+180E (Mongolian Vowel Separator) is not included in the list of +spaces in the Unicode file PropList.txt, and Perl does not recognize it as a +space. However, in many other sources it is listed as a space and has been in +PCRE (both APIs) for a long time. */ + +#define HSPACE_LIST \ + CHAR_HT, CHAR_SPACE, CHAR_NBSP, \ + 0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, \ + 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202f, 0x205f, 0x3000, \ + NOTACHAR + +#define HSPACE_MULTIBYTE_CASES \ + case 0x1680: /* OGHAM SPACE MARK */ \ + case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ \ + case 0x2000: /* EN QUAD */ \ + case 0x2001: /* EM QUAD */ \ + case 0x2002: /* EN SPACE */ \ + case 0x2003: /* EM SPACE */ \ + case 0x2004: /* THREE-PER-EM SPACE */ \ + case 0x2005: /* FOUR-PER-EM SPACE */ \ + case 0x2006: /* SIX-PER-EM SPACE */ \ + case 0x2007: /* FIGURE SPACE */ \ + case 0x2008: /* PUNCTUATION SPACE */ \ + case 0x2009: /* THIN SPACE */ \ + case 0x200A: /* HAIR SPACE */ \ + case 0x202f: /* NARROW NO-BREAK SPACE */ \ + case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ \ + case 0x3000 /* IDEOGRAPHIC SPACE */ + +#define HSPACE_BYTE_CASES \ + case CHAR_HT: \ + case CHAR_SPACE: \ + case CHAR_NBSP + +#define HSPACE_CASES \ + HSPACE_BYTE_CASES: \ + HSPACE_MULTIBYTE_CASES + +#define VSPACE_LIST \ + CHAR_LF, CHAR_VT, CHAR_FF, CHAR_CR, CHAR_NEL, 0x2028, 0x2029, NOTACHAR + +#define VSPACE_MULTIBYTE_CASES \ + case 0x2028: /* LINE SEPARATOR */ \ + case 0x2029 /* PARAGRAPH SEPARATOR */ + +#define VSPACE_BYTE_CASES \ + case CHAR_LF: \ + case CHAR_VT: \ + case CHAR_FF: \ + case CHAR_CR: \ + case CHAR_NEL + +#define VSPACE_CASES \ + VSPACE_BYTE_CASES: \ + VSPACE_MULTIBYTE_CASES + +/* -------------- EBCDIC environments -------------- */ + +#else +#define HSPACE_LIST CHAR_HT, CHAR_SPACE, CHAR_NBSP, NOTACHAR + +#define HSPACE_BYTE_CASES \ + case CHAR_HT: \ + case CHAR_SPACE: \ + case CHAR_NBSP + +#define HSPACE_CASES HSPACE_BYTE_CASES + +#ifdef EBCDIC_NL25 +#define VSPACE_LIST \ + CHAR_VT, CHAR_FF, CHAR_CR, CHAR_NEL, CHAR_LF, NOTACHAR +#else +#define VSPACE_LIST \ + CHAR_VT, CHAR_FF, CHAR_CR, CHAR_LF, CHAR_NEL, NOTACHAR +#endif + +#define VSPACE_BYTE_CASES \ + case CHAR_LF: \ + case CHAR_VT: \ + case CHAR_FF: \ + case CHAR_CR: \ + case CHAR_NEL + +#define VSPACE_CASES VSPACE_BYTE_CASES +#endif /* EBCDIC */ + +/* -------------- End of whitespace macros -------------- */ + + +/* PCRE2 is able to support several different kinds of newline (CR, LF, CRLF, +"any" and "anycrlf" at present). The following macros are used to package up +testing for newlines. NLBLOCK, PSSTART, and PSEND are defined in the various +modules to indicate in which datablock the parameters exist, and what the +start/end of string field names are. */ + +#define NLTYPE_FIXED 0 /* Newline is a fixed length string */ +#define NLTYPE_ANY 1 /* Newline is any Unicode line ending */ +#define NLTYPE_ANYCRLF 2 /* Newline is CR, LF, or CRLF */ + +/* This macro checks for a newline at the given position */ + +#define IS_NEWLINE(p) \ + ((NLBLOCK->nltype != NLTYPE_FIXED)? \ + ((p) < NLBLOCK->PSEND && \ + PRIV(is_newline)((p), NLBLOCK->nltype, NLBLOCK->PSEND, \ + &(NLBLOCK->nllen), utf)) \ + : \ + ((p) <= NLBLOCK->PSEND - NLBLOCK->nllen && \ + UCHAR21TEST(p) == NLBLOCK->nl[0] && \ + (NLBLOCK->nllen == 1 || UCHAR21TEST(p+1) == NLBLOCK->nl[1]) \ + ) \ + ) + +/* This macro checks for a newline immediately preceding the given position */ + +#define WAS_NEWLINE(p) \ + ((NLBLOCK->nltype != NLTYPE_FIXED)? \ + ((p) > NLBLOCK->PSSTART && \ + PRIV(was_newline)((p), NLBLOCK->nltype, NLBLOCK->PSSTART, \ + &(NLBLOCK->nllen), utf)) \ + : \ + ((p) >= NLBLOCK->PSSTART + NLBLOCK->nllen && \ + UCHAR21TEST(p - NLBLOCK->nllen) == NLBLOCK->nl[0] && \ + (NLBLOCK->nllen == 1 || UCHAR21TEST(p - NLBLOCK->nllen + 1) == NLBLOCK->nl[1]) \ + ) \ + ) + +/* Private flags containing information about the compiled pattern. The first +three must not be changed, because whichever is set is actually the number of +bytes in a code unit in that mode. */ + +#define PCRE2_MODE8 0x00000001 /* compiled in 8 bit mode */ +#define PCRE2_MODE16 0x00000002 /* compiled in 16 bit mode */ +#define PCRE2_MODE32 0x00000004 /* compiled in 32 bit mode */ +#define PCRE2_FIRSTSET 0x00000010 /* first_code unit is set */ +#define PCRE2_FIRSTCASELESS 0x00000020 /* caseless first code unit */ +#define PCRE2_FIRSTMAPSET 0x00000040 /* bitmap of first code units is set */ +#define PCRE2_LASTSET 0x00000080 /* last code unit is set */ +#define PCRE2_LASTCASELESS 0x00000100 /* caseless last code unit */ +#define PCRE2_STARTLINE 0x00000200 /* start after \n for multiline */ +#define PCRE2_JCHANGED 0x00000400 /* j option used in pattern */ +#define PCRE2_HASCRORLF 0x00000800 /* explicit \r or \n in pattern */ +#define PCRE2_HASTHEN 0x00001000 /* pattern contains (*THEN) */ +#define PCRE2_MATCH_EMPTY 0x00002000 /* pattern can match empty string */ +#define PCRE2_BSR_SET 0x00004000 /* BSR was set in the pattern */ +#define PCRE2_NL_SET 0x00008000 /* newline was set in the pattern */ +#define PCRE2_NOTEMPTY_SET 0x00010000 /* (*NOTEMPTY) used ) keep */ +#define PCRE2_NE_ATST_SET 0x00020000 /* (*NOTEMPTY_ATSTART) used) together */ +#define PCRE2_DEREF_TABLES 0x00040000 /* release character tables */ +#define PCRE2_NOJIT 0x00080000 /* (*NOJIT) used */ +#define PCRE2_HASBKPORX 0x00100000 /* contains \P, \p, or \X */ +#define PCRE2_DUPCAPUSED 0x00200000 /* contains (?| */ +#define PCRE2_HASBKC 0x00400000 /* contains \C */ +#define PCRE2_HASACCEPT 0x00800000 /* contains (*ACCEPT) */ + +#define PCRE2_MODE_MASK (PCRE2_MODE8 | PCRE2_MODE16 | PCRE2_MODE32) + +/* Values for the matchedby field in a match data block. */ + +enum { PCRE2_MATCHEDBY_INTERPRETER, /* pcre2_match() */ + PCRE2_MATCHEDBY_DFA_INTERPRETER, /* pcre2_dfa_match() */ + PCRE2_MATCHEDBY_JIT }; /* pcre2_jit_match() */ + +/* Values for the flags field in a match data block. */ + +#define PCRE2_MD_COPIED_SUBJECT 0x01u + +/* Magic number to provide a small check against being handed junk. */ + +#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */ + +/* The maximum remaining length of subject we are prepared to search for a +req_unit match from an anchored pattern. In 8-bit mode, memchr() is used and is +much faster than the search loop that has to be used in 16-bit and 32-bit +modes. */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define REQ_CU_MAX 5000 +#else +#define REQ_CU_MAX 2000 +#endif + +/* Offsets for the bitmap tables in the cbits set of tables. Each table +contains a set of bits for a class map. Some classes are built by combining +these tables. */ + +#define cbit_space 0 /* [:space:] or \s */ +#define cbit_xdigit 32 /* [:xdigit:] */ +#define cbit_digit 64 /* [:digit:] or \d */ +#define cbit_upper 96 /* [:upper:] */ +#define cbit_lower 128 /* [:lower:] */ +#define cbit_word 160 /* [:word:] or \w */ +#define cbit_graph 192 /* [:graph:] */ +#define cbit_print 224 /* [:print:] */ +#define cbit_punct 256 /* [:punct:] */ +#define cbit_cntrl 288 /* [:cntrl:] */ +#define cbit_length 320 /* Length of the cbits table */ + +/* Bit definitions for entries in the ctypes table. Do not change these values +without checking pcre2_jit_compile.c, which has an assertion to ensure that +ctype_word has the value 16. */ + +#define ctype_space 0x01 +#define ctype_letter 0x02 +#define ctype_lcletter 0x04 +#define ctype_digit 0x08 +#define ctype_word 0x10 /* alphanumeric or '_' */ + +/* Offsets of the various tables from the base tables pointer, and +total length of the tables. */ + +#define lcc_offset 0 /* Lower case */ +#define fcc_offset 256 /* Flip case */ +#define cbits_offset 512 /* Character classes */ +#define ctypes_offset (cbits_offset + cbit_length) /* Character types */ +#define TABLES_LENGTH (ctypes_offset + 256) + + +/* -------------------- Character and string names ------------------------ */ + +/* If PCRE2 is to support UTF-8 on EBCDIC platforms, we cannot use normal +character constants like '*' because the compiler would emit their EBCDIC code, +which is different from their ASCII/UTF-8 code. Instead we define macros for +the characters so that they always use the ASCII/UTF-8 code when UTF-8 support +is enabled. When UTF-8 support is not enabled, the definitions use character +literals. Both character and string versions of each character are needed, and +there are some longer strings as well. + +This means that, on EBCDIC platforms, the PCRE2 library can handle either +EBCDIC, or UTF-8, but not both. To support both in the same compiled library +would need different lookups depending on whether PCRE2_UTF was set or not. +This would make it impossible to use characters in switch/case statements, +which would reduce performance. For a theoretical use (which nobody has asked +for) in a minority area (EBCDIC platforms), this is not sensible. Any +application that did need both could compile two versions of the library, using +macros to give the functions distinct names. */ + +#ifndef SUPPORT_UNICODE + +/* UTF-8 support is not enabled; use the platform-dependent character literals +so that PCRE2 works in both ASCII and EBCDIC environments, but only in non-UTF +mode. Newline characters are problematic in EBCDIC. Though it has CR and LF +characters, a common practice has been to use its NL (0x15) character as the +line terminator in C-like processing environments. However, sometimes the LF +(0x25) character is used instead, according to this Unicode document: + +http://unicode.org/standard/reports/tr13/tr13-5.html + +PCRE2 defaults EBCDIC NL to 0x15, but has a build-time option to select 0x25 +instead. Whichever is *not* chosen is defined as NEL. + +In both ASCII and EBCDIC environments, CHAR_NL and CHAR_LF are synonyms for the +same code point. */ + +#ifdef EBCDIC + +#ifndef EBCDIC_NL25 +#define CHAR_NL '\x15' +#define CHAR_NEL '\x25' +#define STR_NL "\x15" +#define STR_NEL "\x25" +#else +#define CHAR_NL '\x25' +#define CHAR_NEL '\x15' +#define STR_NL "\x25" +#define STR_NEL "\x15" +#endif + +#define CHAR_LF CHAR_NL +#define STR_LF STR_NL + +#define CHAR_ESC '\047' +#define CHAR_DEL '\007' +#define CHAR_NBSP ((unsigned char)'\x41') +#define STR_ESC "\047" +#define STR_DEL "\007" + +#else /* Not EBCDIC */ + +/* In ASCII/Unicode, linefeed is '\n' and we equate this to NL for +compatibility. NEL is the Unicode newline character; make sure it is +a positive value. */ + +#define CHAR_LF '\n' +#define CHAR_NL CHAR_LF +#define CHAR_NEL ((unsigned char)'\x85') +#define CHAR_ESC '\033' +#define CHAR_DEL '\177' +#define CHAR_NBSP ((unsigned char)'\xa0') + +#define STR_LF "\n" +#define STR_NL STR_LF +#define STR_NEL "\x85" +#define STR_ESC "\033" +#define STR_DEL "\177" + +#endif /* EBCDIC */ + +/* The remaining definitions work in both environments. */ + +#define CHAR_NUL '\0' +#define CHAR_HT '\t' +#define CHAR_VT '\v' +#define CHAR_FF '\f' +#define CHAR_CR '\r' +#define CHAR_BS '\b' +#define CHAR_BEL '\a' + +#define CHAR_SPACE ' ' +#define CHAR_EXCLAMATION_MARK '!' +#define CHAR_QUOTATION_MARK '"' +#define CHAR_NUMBER_SIGN '#' +#define CHAR_DOLLAR_SIGN '$' +#define CHAR_PERCENT_SIGN '%' +#define CHAR_AMPERSAND '&' +#define CHAR_APOSTROPHE '\'' +#define CHAR_LEFT_PARENTHESIS '(' +#define CHAR_RIGHT_PARENTHESIS ')' +#define CHAR_ASTERISK '*' +#define CHAR_PLUS '+' +#define CHAR_COMMA ',' +#define CHAR_MINUS '-' +#define CHAR_DOT '.' +#define CHAR_SLASH '/' +#define CHAR_0 '0' +#define CHAR_1 '1' +#define CHAR_2 '2' +#define CHAR_3 '3' +#define CHAR_4 '4' +#define CHAR_5 '5' +#define CHAR_6 '6' +#define CHAR_7 '7' +#define CHAR_8 '8' +#define CHAR_9 '9' +#define CHAR_COLON ':' +#define CHAR_SEMICOLON ';' +#define CHAR_LESS_THAN_SIGN '<' +#define CHAR_EQUALS_SIGN '=' +#define CHAR_GREATER_THAN_SIGN '>' +#define CHAR_QUESTION_MARK '?' +#define CHAR_COMMERCIAL_AT '@' +#define CHAR_A 'A' +#define CHAR_B 'B' +#define CHAR_C 'C' +#define CHAR_D 'D' +#define CHAR_E 'E' +#define CHAR_F 'F' +#define CHAR_G 'G' +#define CHAR_H 'H' +#define CHAR_I 'I' +#define CHAR_J 'J' +#define CHAR_K 'K' +#define CHAR_L 'L' +#define CHAR_M 'M' +#define CHAR_N 'N' +#define CHAR_O 'O' +#define CHAR_P 'P' +#define CHAR_Q 'Q' +#define CHAR_R 'R' +#define CHAR_S 'S' +#define CHAR_T 'T' +#define CHAR_U 'U' +#define CHAR_V 'V' +#define CHAR_W 'W' +#define CHAR_X 'X' +#define CHAR_Y 'Y' +#define CHAR_Z 'Z' +#define CHAR_LEFT_SQUARE_BRACKET '[' +#define CHAR_BACKSLASH '\\' +#define CHAR_RIGHT_SQUARE_BRACKET ']' +#define CHAR_CIRCUMFLEX_ACCENT '^' +#define CHAR_UNDERSCORE '_' +#define CHAR_GRAVE_ACCENT '`' +#define CHAR_a 'a' +#define CHAR_b 'b' +#define CHAR_c 'c' +#define CHAR_d 'd' +#define CHAR_e 'e' +#define CHAR_f 'f' +#define CHAR_g 'g' +#define CHAR_h 'h' +#define CHAR_i 'i' +#define CHAR_j 'j' +#define CHAR_k 'k' +#define CHAR_l 'l' +#define CHAR_m 'm' +#define CHAR_n 'n' +#define CHAR_o 'o' +#define CHAR_p 'p' +#define CHAR_q 'q' +#define CHAR_r 'r' +#define CHAR_s 's' +#define CHAR_t 't' +#define CHAR_u 'u' +#define CHAR_v 'v' +#define CHAR_w 'w' +#define CHAR_x 'x' +#define CHAR_y 'y' +#define CHAR_z 'z' +#define CHAR_LEFT_CURLY_BRACKET '{' +#define CHAR_VERTICAL_LINE '|' +#define CHAR_RIGHT_CURLY_BRACKET '}' +#define CHAR_TILDE '~' + +#define STR_HT "\t" +#define STR_VT "\v" +#define STR_FF "\f" +#define STR_CR "\r" +#define STR_BS "\b" +#define STR_BEL "\a" + +#define STR_SPACE " " +#define STR_EXCLAMATION_MARK "!" +#define STR_QUOTATION_MARK "\"" +#define STR_NUMBER_SIGN "#" +#define STR_DOLLAR_SIGN "$" +#define STR_PERCENT_SIGN "%" +#define STR_AMPERSAND "&" +#define STR_APOSTROPHE "'" +#define STR_LEFT_PARENTHESIS "(" +#define STR_RIGHT_PARENTHESIS ")" +#define STR_ASTERISK "*" +#define STR_PLUS "+" +#define STR_COMMA "," +#define STR_MINUS "-" +#define STR_DOT "." +#define STR_SLASH "/" +#define STR_0 "0" +#define STR_1 "1" +#define STR_2 "2" +#define STR_3 "3" +#define STR_4 "4" +#define STR_5 "5" +#define STR_6 "6" +#define STR_7 "7" +#define STR_8 "8" +#define STR_9 "9" +#define STR_COLON ":" +#define STR_SEMICOLON ";" +#define STR_LESS_THAN_SIGN "<" +#define STR_EQUALS_SIGN "=" +#define STR_GREATER_THAN_SIGN ">" +#define STR_QUESTION_MARK "?" +#define STR_COMMERCIAL_AT "@" +#define STR_A "A" +#define STR_B "B" +#define STR_C "C" +#define STR_D "D" +#define STR_E "E" +#define STR_F "F" +#define STR_G "G" +#define STR_H "H" +#define STR_I "I" +#define STR_J "J" +#define STR_K "K" +#define STR_L "L" +#define STR_M "M" +#define STR_N "N" +#define STR_O "O" +#define STR_P "P" +#define STR_Q "Q" +#define STR_R "R" +#define STR_S "S" +#define STR_T "T" +#define STR_U "U" +#define STR_V "V" +#define STR_W "W" +#define STR_X "X" +#define STR_Y "Y" +#define STR_Z "Z" +#define STR_LEFT_SQUARE_BRACKET "[" +#define STR_BACKSLASH "\\" +#define STR_RIGHT_SQUARE_BRACKET "]" +#define STR_CIRCUMFLEX_ACCENT "^" +#define STR_UNDERSCORE "_" +#define STR_GRAVE_ACCENT "`" +#define STR_a "a" +#define STR_b "b" +#define STR_c "c" +#define STR_d "d" +#define STR_e "e" +#define STR_f "f" +#define STR_g "g" +#define STR_h "h" +#define STR_i "i" +#define STR_j "j" +#define STR_k "k" +#define STR_l "l" +#define STR_m "m" +#define STR_n "n" +#define STR_o "o" +#define STR_p "p" +#define STR_q "q" +#define STR_r "r" +#define STR_s "s" +#define STR_t "t" +#define STR_u "u" +#define STR_v "v" +#define STR_w "w" +#define STR_x "x" +#define STR_y "y" +#define STR_z "z" +#define STR_LEFT_CURLY_BRACKET "{" +#define STR_VERTICAL_LINE "|" +#define STR_RIGHT_CURLY_BRACKET "}" +#define STR_TILDE "~" + +#define STRING_ACCEPT0 "ACCEPT\0" +#define STRING_COMMIT0 "COMMIT\0" +#define STRING_F0 "F\0" +#define STRING_FAIL0 "FAIL\0" +#define STRING_MARK0 "MARK\0" +#define STRING_PRUNE0 "PRUNE\0" +#define STRING_SKIP0 "SKIP\0" +#define STRING_THEN "THEN" + +#define STRING_atomic0 "atomic\0" +#define STRING_pla0 "pla\0" +#define STRING_plb0 "plb\0" +#define STRING_napla0 "napla\0" +#define STRING_naplb0 "naplb\0" +#define STRING_nla0 "nla\0" +#define STRING_nlb0 "nlb\0" +#define STRING_sr0 "sr\0" +#define STRING_asr0 "asr\0" +#define STRING_positive_lookahead0 "positive_lookahead\0" +#define STRING_positive_lookbehind0 "positive_lookbehind\0" +#define STRING_non_atomic_positive_lookahead0 "non_atomic_positive_lookahead\0" +#define STRING_non_atomic_positive_lookbehind0 "non_atomic_positive_lookbehind\0" +#define STRING_negative_lookahead0 "negative_lookahead\0" +#define STRING_negative_lookbehind0 "negative_lookbehind\0" +#define STRING_script_run0 "script_run\0" +#define STRING_atomic_script_run "atomic_script_run" + +#define STRING_alpha0 "alpha\0" +#define STRING_lower0 "lower\0" +#define STRING_upper0 "upper\0" +#define STRING_alnum0 "alnum\0" +#define STRING_ascii0 "ascii\0" +#define STRING_blank0 "blank\0" +#define STRING_cntrl0 "cntrl\0" +#define STRING_digit0 "digit\0" +#define STRING_graph0 "graph\0" +#define STRING_print0 "print\0" +#define STRING_punct0 "punct\0" +#define STRING_space0 "space\0" +#define STRING_word0 "word\0" +#define STRING_xdigit "xdigit" + +#define STRING_DEFINE "DEFINE" +#define STRING_VERSION "VERSION" +#define STRING_WEIRD_STARTWORD "[:<:]]" +#define STRING_WEIRD_ENDWORD "[:>:]]" + +#define STRING_CR_RIGHTPAR "CR)" +#define STRING_LF_RIGHTPAR "LF)" +#define STRING_CRLF_RIGHTPAR "CRLF)" +#define STRING_ANY_RIGHTPAR "ANY)" +#define STRING_ANYCRLF_RIGHTPAR "ANYCRLF)" +#define STRING_NUL_RIGHTPAR "NUL)" +#define STRING_BSR_ANYCRLF_RIGHTPAR "BSR_ANYCRLF)" +#define STRING_BSR_UNICODE_RIGHTPAR "BSR_UNICODE)" +#define STRING_UTF8_RIGHTPAR "UTF8)" +#define STRING_UTF16_RIGHTPAR "UTF16)" +#define STRING_UTF32_RIGHTPAR "UTF32)" +#define STRING_UTF_RIGHTPAR "UTF)" +#define STRING_UCP_RIGHTPAR "UCP)" +#define STRING_NO_AUTO_POSSESS_RIGHTPAR "NO_AUTO_POSSESS)" +#define STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR "NO_DOTSTAR_ANCHOR)" +#define STRING_NO_JIT_RIGHTPAR "NO_JIT)" +#define STRING_NO_START_OPT_RIGHTPAR "NO_START_OPT)" +#define STRING_NOTEMPTY_RIGHTPAR "NOTEMPTY)" +#define STRING_NOTEMPTY_ATSTART_RIGHTPAR "NOTEMPTY_ATSTART)" +#define STRING_LIMIT_HEAP_EQ "LIMIT_HEAP=" +#define STRING_LIMIT_MATCH_EQ "LIMIT_MATCH=" +#define STRING_LIMIT_DEPTH_EQ "LIMIT_DEPTH=" +#define STRING_LIMIT_RECURSION_EQ "LIMIT_RECURSION=" +#define STRING_MARK "MARK" + +#define STRING_bc "bc" +#define STRING_bidiclass "bidiclass" +#define STRING_sc "sc" +#define STRING_script "script" +#define STRING_scriptextensions "scriptextensions" +#define STRING_scx "scx" + +#else /* SUPPORT_UNICODE */ + +/* UTF-8 support is enabled; always use UTF-8 (=ASCII) character codes. This +works in both modes non-EBCDIC platforms, and on EBCDIC platforms in UTF-8 mode +only. */ + +#define CHAR_HT '\011' +#define CHAR_VT '\013' +#define CHAR_FF '\014' +#define CHAR_CR '\015' +#define CHAR_LF '\012' +#define CHAR_NL CHAR_LF +#define CHAR_NEL ((unsigned char)'\x85') +#define CHAR_BS '\010' +#define CHAR_BEL '\007' +#define CHAR_ESC '\033' +#define CHAR_DEL '\177' + +#define CHAR_NUL '\0' +#define CHAR_SPACE '\040' +#define CHAR_EXCLAMATION_MARK '\041' +#define CHAR_QUOTATION_MARK '\042' +#define CHAR_NUMBER_SIGN '\043' +#define CHAR_DOLLAR_SIGN '\044' +#define CHAR_PERCENT_SIGN '\045' +#define CHAR_AMPERSAND '\046' +#define CHAR_APOSTROPHE '\047' +#define CHAR_LEFT_PARENTHESIS '\050' +#define CHAR_RIGHT_PARENTHESIS '\051' +#define CHAR_ASTERISK '\052' +#define CHAR_PLUS '\053' +#define CHAR_COMMA '\054' +#define CHAR_MINUS '\055' +#define CHAR_DOT '\056' +#define CHAR_SLASH '\057' +#define CHAR_0 '\060' +#define CHAR_1 '\061' +#define CHAR_2 '\062' +#define CHAR_3 '\063' +#define CHAR_4 '\064' +#define CHAR_5 '\065' +#define CHAR_6 '\066' +#define CHAR_7 '\067' +#define CHAR_8 '\070' +#define CHAR_9 '\071' +#define CHAR_COLON '\072' +#define CHAR_SEMICOLON '\073' +#define CHAR_LESS_THAN_SIGN '\074' +#define CHAR_EQUALS_SIGN '\075' +#define CHAR_GREATER_THAN_SIGN '\076' +#define CHAR_QUESTION_MARK '\077' +#define CHAR_COMMERCIAL_AT '\100' +#define CHAR_A '\101' +#define CHAR_B '\102' +#define CHAR_C '\103' +#define CHAR_D '\104' +#define CHAR_E '\105' +#define CHAR_F '\106' +#define CHAR_G '\107' +#define CHAR_H '\110' +#define CHAR_I '\111' +#define CHAR_J '\112' +#define CHAR_K '\113' +#define CHAR_L '\114' +#define CHAR_M '\115' +#define CHAR_N '\116' +#define CHAR_O '\117' +#define CHAR_P '\120' +#define CHAR_Q '\121' +#define CHAR_R '\122' +#define CHAR_S '\123' +#define CHAR_T '\124' +#define CHAR_U '\125' +#define CHAR_V '\126' +#define CHAR_W '\127' +#define CHAR_X '\130' +#define CHAR_Y '\131' +#define CHAR_Z '\132' +#define CHAR_LEFT_SQUARE_BRACKET '\133' +#define CHAR_BACKSLASH '\134' +#define CHAR_RIGHT_SQUARE_BRACKET '\135' +#define CHAR_CIRCUMFLEX_ACCENT '\136' +#define CHAR_UNDERSCORE '\137' +#define CHAR_GRAVE_ACCENT '\140' +#define CHAR_a '\141' +#define CHAR_b '\142' +#define CHAR_c '\143' +#define CHAR_d '\144' +#define CHAR_e '\145' +#define CHAR_f '\146' +#define CHAR_g '\147' +#define CHAR_h '\150' +#define CHAR_i '\151' +#define CHAR_j '\152' +#define CHAR_k '\153' +#define CHAR_l '\154' +#define CHAR_m '\155' +#define CHAR_n '\156' +#define CHAR_o '\157' +#define CHAR_p '\160' +#define CHAR_q '\161' +#define CHAR_r '\162' +#define CHAR_s '\163' +#define CHAR_t '\164' +#define CHAR_u '\165' +#define CHAR_v '\166' +#define CHAR_w '\167' +#define CHAR_x '\170' +#define CHAR_y '\171' +#define CHAR_z '\172' +#define CHAR_LEFT_CURLY_BRACKET '\173' +#define CHAR_VERTICAL_LINE '\174' +#define CHAR_RIGHT_CURLY_BRACKET '\175' +#define CHAR_TILDE '\176' +#define CHAR_NBSP ((unsigned char)'\xa0') + +#define STR_HT "\011" +#define STR_VT "\013" +#define STR_FF "\014" +#define STR_CR "\015" +#define STR_NL "\012" +#define STR_BS "\010" +#define STR_BEL "\007" +#define STR_ESC "\033" +#define STR_DEL "\177" + +#define STR_SPACE "\040" +#define STR_EXCLAMATION_MARK "\041" +#define STR_QUOTATION_MARK "\042" +#define STR_NUMBER_SIGN "\043" +#define STR_DOLLAR_SIGN "\044" +#define STR_PERCENT_SIGN "\045" +#define STR_AMPERSAND "\046" +#define STR_APOSTROPHE "\047" +#define STR_LEFT_PARENTHESIS "\050" +#define STR_RIGHT_PARENTHESIS "\051" +#define STR_ASTERISK "\052" +#define STR_PLUS "\053" +#define STR_COMMA "\054" +#define STR_MINUS "\055" +#define STR_DOT "\056" +#define STR_SLASH "\057" +#define STR_0 "\060" +#define STR_1 "\061" +#define STR_2 "\062" +#define STR_3 "\063" +#define STR_4 "\064" +#define STR_5 "\065" +#define STR_6 "\066" +#define STR_7 "\067" +#define STR_8 "\070" +#define STR_9 "\071" +#define STR_COLON "\072" +#define STR_SEMICOLON "\073" +#define STR_LESS_THAN_SIGN "\074" +#define STR_EQUALS_SIGN "\075" +#define STR_GREATER_THAN_SIGN "\076" +#define STR_QUESTION_MARK "\077" +#define STR_COMMERCIAL_AT "\100" +#define STR_A "\101" +#define STR_B "\102" +#define STR_C "\103" +#define STR_D "\104" +#define STR_E "\105" +#define STR_F "\106" +#define STR_G "\107" +#define STR_H "\110" +#define STR_I "\111" +#define STR_J "\112" +#define STR_K "\113" +#define STR_L "\114" +#define STR_M "\115" +#define STR_N "\116" +#define STR_O "\117" +#define STR_P "\120" +#define STR_Q "\121" +#define STR_R "\122" +#define STR_S "\123" +#define STR_T "\124" +#define STR_U "\125" +#define STR_V "\126" +#define STR_W "\127" +#define STR_X "\130" +#define STR_Y "\131" +#define STR_Z "\132" +#define STR_LEFT_SQUARE_BRACKET "\133" +#define STR_BACKSLASH "\134" +#define STR_RIGHT_SQUARE_BRACKET "\135" +#define STR_CIRCUMFLEX_ACCENT "\136" +#define STR_UNDERSCORE "\137" +#define STR_GRAVE_ACCENT "\140" +#define STR_a "\141" +#define STR_b "\142" +#define STR_c "\143" +#define STR_d "\144" +#define STR_e "\145" +#define STR_f "\146" +#define STR_g "\147" +#define STR_h "\150" +#define STR_i "\151" +#define STR_j "\152" +#define STR_k "\153" +#define STR_l "\154" +#define STR_m "\155" +#define STR_n "\156" +#define STR_o "\157" +#define STR_p "\160" +#define STR_q "\161" +#define STR_r "\162" +#define STR_s "\163" +#define STR_t "\164" +#define STR_u "\165" +#define STR_v "\166" +#define STR_w "\167" +#define STR_x "\170" +#define STR_y "\171" +#define STR_z "\172" +#define STR_LEFT_CURLY_BRACKET "\173" +#define STR_VERTICAL_LINE "\174" +#define STR_RIGHT_CURLY_BRACKET "\175" +#define STR_TILDE "\176" + +#define STRING_ACCEPT0 STR_A STR_C STR_C STR_E STR_P STR_T "\0" +#define STRING_COMMIT0 STR_C STR_O STR_M STR_M STR_I STR_T "\0" +#define STRING_F0 STR_F "\0" +#define STRING_FAIL0 STR_F STR_A STR_I STR_L "\0" +#define STRING_MARK0 STR_M STR_A STR_R STR_K "\0" +#define STRING_PRUNE0 STR_P STR_R STR_U STR_N STR_E "\0" +#define STRING_SKIP0 STR_S STR_K STR_I STR_P "\0" +#define STRING_THEN STR_T STR_H STR_E STR_N + +#define STRING_atomic0 STR_a STR_t STR_o STR_m STR_i STR_c "\0" +#define STRING_pla0 STR_p STR_l STR_a "\0" +#define STRING_plb0 STR_p STR_l STR_b "\0" +#define STRING_napla0 STR_n STR_a STR_p STR_l STR_a "\0" +#define STRING_naplb0 STR_n STR_a STR_p STR_l STR_b "\0" +#define STRING_nla0 STR_n STR_l STR_a "\0" +#define STRING_nlb0 STR_n STR_l STR_b "\0" +#define STRING_sr0 STR_s STR_r "\0" +#define STRING_asr0 STR_a STR_s STR_r "\0" +#define STRING_positive_lookahead0 STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0" +#define STRING_positive_lookbehind0 STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0" +#define STRING_non_atomic_positive_lookahead0 STR_n STR_o STR_n STR_UNDERSCORE STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0" +#define STRING_non_atomic_positive_lookbehind0 STR_n STR_o STR_n STR_UNDERSCORE STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0" +#define STRING_negative_lookahead0 STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0" +#define STRING_negative_lookbehind0 STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0" +#define STRING_script_run0 STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n "\0" +#define STRING_atomic_script_run STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n + +#define STRING_alpha0 STR_a STR_l STR_p STR_h STR_a "\0" +#define STRING_lower0 STR_l STR_o STR_w STR_e STR_r "\0" +#define STRING_upper0 STR_u STR_p STR_p STR_e STR_r "\0" +#define STRING_alnum0 STR_a STR_l STR_n STR_u STR_m "\0" +#define STRING_ascii0 STR_a STR_s STR_c STR_i STR_i "\0" +#define STRING_blank0 STR_b STR_l STR_a STR_n STR_k "\0" +#define STRING_cntrl0 STR_c STR_n STR_t STR_r STR_l "\0" +#define STRING_digit0 STR_d STR_i STR_g STR_i STR_t "\0" +#define STRING_graph0 STR_g STR_r STR_a STR_p STR_h "\0" +#define STRING_print0 STR_p STR_r STR_i STR_n STR_t "\0" +#define STRING_punct0 STR_p STR_u STR_n STR_c STR_t "\0" +#define STRING_space0 STR_s STR_p STR_a STR_c STR_e "\0" +#define STRING_word0 STR_w STR_o STR_r STR_d "\0" +#define STRING_xdigit STR_x STR_d STR_i STR_g STR_i STR_t + +#define STRING_DEFINE STR_D STR_E STR_F STR_I STR_N STR_E +#define STRING_VERSION STR_V STR_E STR_R STR_S STR_I STR_O STR_N +#define STRING_WEIRD_STARTWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_LESS_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET +#define STRING_WEIRD_ENDWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_GREATER_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET + +#define STRING_CR_RIGHTPAR STR_C STR_R STR_RIGHT_PARENTHESIS +#define STRING_LF_RIGHTPAR STR_L STR_F STR_RIGHT_PARENTHESIS +#define STRING_CRLF_RIGHTPAR STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS +#define STRING_ANY_RIGHTPAR STR_A STR_N STR_Y STR_RIGHT_PARENTHESIS +#define STRING_ANYCRLF_RIGHTPAR STR_A STR_N STR_Y STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS +#define STRING_NUL_RIGHTPAR STR_N STR_U STR_L STR_RIGHT_PARENTHESIS +#define STRING_BSR_ANYCRLF_RIGHTPAR STR_B STR_S STR_R STR_UNDERSCORE STR_A STR_N STR_Y STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS +#define STRING_BSR_UNICODE_RIGHTPAR STR_B STR_S STR_R STR_UNDERSCORE STR_U STR_N STR_I STR_C STR_O STR_D STR_E STR_RIGHT_PARENTHESIS +#define STRING_UTF8_RIGHTPAR STR_U STR_T STR_F STR_8 STR_RIGHT_PARENTHESIS +#define STRING_UTF16_RIGHTPAR STR_U STR_T STR_F STR_1 STR_6 STR_RIGHT_PARENTHESIS +#define STRING_UTF32_RIGHTPAR STR_U STR_T STR_F STR_3 STR_2 STR_RIGHT_PARENTHESIS +#define STRING_UTF_RIGHTPAR STR_U STR_T STR_F STR_RIGHT_PARENTHESIS +#define STRING_UCP_RIGHTPAR STR_U STR_C STR_P STR_RIGHT_PARENTHESIS +#define STRING_NO_AUTO_POSSESS_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_A STR_U STR_T STR_O STR_UNDERSCORE STR_P STR_O STR_S STR_S STR_E STR_S STR_S STR_RIGHT_PARENTHESIS +#define STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_D STR_O STR_T STR_S STR_T STR_A STR_R STR_UNDERSCORE STR_A STR_N STR_C STR_H STR_O STR_R STR_RIGHT_PARENTHESIS +#define STRING_NO_JIT_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_J STR_I STR_T STR_RIGHT_PARENTHESIS +#define STRING_NO_START_OPT_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_S STR_T STR_A STR_R STR_T STR_UNDERSCORE STR_O STR_P STR_T STR_RIGHT_PARENTHESIS +#define STRING_NOTEMPTY_RIGHTPAR STR_N STR_O STR_T STR_E STR_M STR_P STR_T STR_Y STR_RIGHT_PARENTHESIS +#define STRING_NOTEMPTY_ATSTART_RIGHTPAR STR_N STR_O STR_T STR_E STR_M STR_P STR_T STR_Y STR_UNDERSCORE STR_A STR_T STR_S STR_T STR_A STR_R STR_T STR_RIGHT_PARENTHESIS +#define STRING_LIMIT_HEAP_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_H STR_E STR_A STR_P STR_EQUALS_SIGN +#define STRING_LIMIT_MATCH_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_M STR_A STR_T STR_C STR_H STR_EQUALS_SIGN +#define STRING_LIMIT_DEPTH_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_D STR_E STR_P STR_T STR_H STR_EQUALS_SIGN +#define STRING_LIMIT_RECURSION_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_R STR_E STR_C STR_U STR_R STR_S STR_I STR_O STR_N STR_EQUALS_SIGN +#define STRING_MARK STR_M STR_A STR_R STR_K + +#define STRING_bc STR_b STR_c +#define STRING_bidiclass STR_b STR_i STR_d STR_i STR_c STR_l STR_a STR_s STR_s +#define STRING_sc STR_s STR_c +#define STRING_script STR_s STR_c STR_r STR_i STR_p STR_t +#define STRING_scriptextensions STR_s STR_c STR_r STR_i STR_p STR_t STR_e STR_x STR_t STR_e STR_n STR_s STR_i STR_o STR_n STR_s +#define STRING_scx STR_s STR_c STR_x + + +#endif /* SUPPORT_UNICODE */ + +/* -------------------- End of character and string names -------------------*/ + +/* -------------------- Definitions for compiled patterns -------------------*/ + +/* Codes for different types of Unicode property. If these definitions are +changed, the autopossessifying table in pcre2_auto_possess.c must be updated to +match. */ + +#define PT_ANY 0 /* Any property - matches all chars */ +#define PT_LAMP 1 /* L& - the union of Lu, Ll, Lt */ +#define PT_GC 2 /* Specified general characteristic (e.g. L) */ +#define PT_PC 3 /* Specified particular characteristic (e.g. Lu) */ +#define PT_SC 4 /* Script only (e.g. Han) */ +#define PT_SCX 5 /* Script extensions (includes SC) */ +#define PT_ALNUM 6 /* Alphanumeric - the union of L and N */ +#define PT_SPACE 7 /* Perl space - general category Z plus 9,10,12,13 */ +#define PT_PXSPACE 8 /* POSIX space - Z plus 9,10,11,12,13 */ +#define PT_WORD 9 /* Word - L plus N plus underscore */ +#define PT_CLIST 10 /* Pseudo-property: match character list */ +#define PT_UCNC 11 /* Universal Character nameable character */ +#define PT_BIDICL 12 /* Specified bidi class */ +#define PT_BOOL 13 /* Boolean property */ +#define PT_TABSIZE 14 /* Size of square table for autopossessify tests */ + +/* The following special properties are used only in XCLASS items, when POSIX +classes are specified and PCRE2_UCP is set - in other words, for Unicode +handling of these classes. They are not available via the \p or \P escapes like +those in the above list, and so they do not take part in the autopossessifying +table. */ + +#define PT_PXGRAPH 14 /* [:graph:] - characters that mark the paper */ +#define PT_PXPRINT 15 /* [:print:] - [:graph:] plus non-control spaces */ +#define PT_PXPUNCT 16 /* [:punct:] - punctuation characters */ + +/* This value is used when parsing \p and \P escapes to indicate that neither +\p{script:...} nor \p{scx:...} has been encountered. */ + +#define PT_NOTSCRIPT 255 + +/* Flag bits and data types for the extended class (OP_XCLASS) for classes that +contain characters with values greater than 255. */ + +#define XCL_NOT 0x01 /* Flag: this is a negative class */ +#define XCL_MAP 0x02 /* Flag: a 32-byte map is present */ +#define XCL_HASPROP 0x04 /* Flag: property checks are present. */ + +#define XCL_END 0 /* Marks end of individual items */ +#define XCL_SINGLE 1 /* Single item (one multibyte char) follows */ +#define XCL_RANGE 2 /* A range (two multibyte chars) follows */ +#define XCL_PROP 3 /* Unicode property (2-byte property code follows) */ +#define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */ + +/* These are escaped items that aren't just an encoding of a particular data +value such as \n. They must have non-zero values, as check_escape() returns 0 +for a data character. In the escapes[] table in pcre2_compile.c their values +are negated in order to distinguish them from data values. + +They must appear here in the same order as in the opcode definitions below, up +to ESC_z. There's a dummy for OP_ALLANY because it corresponds to "." in DOTALL +mode rather than an escape sequence. It is also used for [^] in JavaScript +compatibility mode, and for \C in non-utf mode. In non-DOTALL mode, "." behaves +like \N. + +Negative numbers are used to encode a backreference (\1, \2, \3, etc.) in +check_escape(). There are tests in the code for an escape greater than ESC_b +and less than ESC_Z to detect the types that may be repeated. These are the +types that consume characters. If any new escapes are put in between that don't +consume a character, that code will have to change. */ + +enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, + ESC_W, ESC_w, ESC_N, ESC_dum, ESC_C, ESC_P, ESC_p, ESC_R, ESC_H, + ESC_h, ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z, + ESC_E, ESC_Q, ESC_g, ESC_k }; + + +/********************** Opcode definitions ******************/ + +/****** NOTE NOTE NOTE ****** + +Starting from 1 (i.e. after OP_END), the values up to OP_EOD must correspond in +order to the list of escapes immediately above. Furthermore, values up to +OP_DOLLM must not be changed without adjusting the table called autoposstab in +pcre2_auto_possess.c. + +Whenever this list is updated, the two macro definitions that follow must be +updated to match. The possessification table called "opcode_possessify" in +pcre2_compile.c must also be updated, and also the tables called "coptable" +and "poptable" in pcre2_dfa_match.c. + +****** NOTE NOTE NOTE ******/ + + +/* The values between FIRST_AUTOTAB_OP and LAST_AUTOTAB_RIGHT_OP, inclusive, +are used in a table for deciding whether a repeated character type can be +auto-possessified. */ + +#define FIRST_AUTOTAB_OP OP_NOT_DIGIT +#define LAST_AUTOTAB_LEFT_OP OP_EXTUNI +#define LAST_AUTOTAB_RIGHT_OP OP_DOLLM + +enum { + OP_END, /* 0 End of pattern */ + + /* Values corresponding to backslashed metacharacters */ + + OP_SOD, /* 1 Start of data: \A */ + OP_SOM, /* 2 Start of match (subject + offset): \G */ + OP_SET_SOM, /* 3 Set start of match (\K) */ + OP_NOT_WORD_BOUNDARY, /* 4 \B */ + OP_WORD_BOUNDARY, /* 5 \b */ + OP_NOT_DIGIT, /* 6 \D */ + OP_DIGIT, /* 7 \d */ + OP_NOT_WHITESPACE, /* 8 \S */ + OP_WHITESPACE, /* 9 \s */ + OP_NOT_WORDCHAR, /* 10 \W */ + OP_WORDCHAR, /* 11 \w */ + + OP_ANY, /* 12 Match any character except newline (\N) */ + OP_ALLANY, /* 13 Match any character */ + OP_ANYBYTE, /* 14 Match any byte (\C); different to OP_ANY for UTF-8 */ + OP_NOTPROP, /* 15 \P (not Unicode property) */ + OP_PROP, /* 16 \p (Unicode property) */ + OP_ANYNL, /* 17 \R (any newline sequence) */ + OP_NOT_HSPACE, /* 18 \H (not horizontal whitespace) */ + OP_HSPACE, /* 19 \h (horizontal whitespace) */ + OP_NOT_VSPACE, /* 20 \V (not vertical whitespace) */ + OP_VSPACE, /* 21 \v (vertical whitespace) */ + OP_EXTUNI, /* 22 \X (extended Unicode sequence */ + OP_EODN, /* 23 End of data or \n at end of data (\Z) */ + OP_EOD, /* 24 End of data (\z) */ + + /* Line end assertions */ + + OP_DOLL, /* 25 End of line - not multiline */ + OP_DOLLM, /* 26 End of line - multiline */ + OP_CIRC, /* 27 Start of line - not multiline */ + OP_CIRCM, /* 28 Start of line - multiline */ + + /* Single characters; caseful must precede the caseless ones, and these + must remain in this order, and adjacent. */ + + OP_CHAR, /* 29 Match one character, casefully */ + OP_CHARI, /* 30 Match one character, caselessly */ + OP_NOT, /* 31 Match one character, not the given one, casefully */ + OP_NOTI, /* 32 Match one character, not the given one, caselessly */ + + /* The following sets of 13 opcodes must always be kept in step because + the offset from the first one is used to generate the others. */ + + /* Repeated characters; caseful must precede the caseless ones */ + + OP_STAR, /* 33 The maximizing and minimizing versions of */ + OP_MINSTAR, /* 34 these six opcodes must come in pairs, with */ + OP_PLUS, /* 35 the minimizing one second. */ + OP_MINPLUS, /* 36 */ + OP_QUERY, /* 37 */ + OP_MINQUERY, /* 38 */ + + OP_UPTO, /* 39 From 0 to n matches of one character, caseful*/ + OP_MINUPTO, /* 40 */ + OP_EXACT, /* 41 Exactly n matches */ + + OP_POSSTAR, /* 42 Possessified star, caseful */ + OP_POSPLUS, /* 43 Possessified plus, caseful */ + OP_POSQUERY, /* 44 Posesssified query, caseful */ + OP_POSUPTO, /* 45 Possessified upto, caseful */ + + /* Repeated characters; caseless must follow the caseful ones */ + + OP_STARI, /* 46 */ + OP_MINSTARI, /* 47 */ + OP_PLUSI, /* 48 */ + OP_MINPLUSI, /* 49 */ + OP_QUERYI, /* 50 */ + OP_MINQUERYI, /* 51 */ + + OP_UPTOI, /* 52 From 0 to n matches of one character, caseless */ + OP_MINUPTOI, /* 53 */ + OP_EXACTI, /* 54 */ + + OP_POSSTARI, /* 55 Possessified star, caseless */ + OP_POSPLUSI, /* 56 Possessified plus, caseless */ + OP_POSQUERYI, /* 57 Posesssified query, caseless */ + OP_POSUPTOI, /* 58 Possessified upto, caseless */ + + /* The negated ones must follow the non-negated ones, and match them */ + /* Negated repeated character, caseful; must precede the caseless ones */ + + OP_NOTSTAR, /* 59 The maximizing and minimizing versions of */ + OP_NOTMINSTAR, /* 60 these six opcodes must come in pairs, with */ + OP_NOTPLUS, /* 61 the minimizing one second. They must be in */ + OP_NOTMINPLUS, /* 62 exactly the same order as those above. */ + OP_NOTQUERY, /* 63 */ + OP_NOTMINQUERY, /* 64 */ + + OP_NOTUPTO, /* 65 From 0 to n matches, caseful */ + OP_NOTMINUPTO, /* 66 */ + OP_NOTEXACT, /* 67 Exactly n matches */ + + OP_NOTPOSSTAR, /* 68 Possessified versions, caseful */ + OP_NOTPOSPLUS, /* 69 */ + OP_NOTPOSQUERY, /* 70 */ + OP_NOTPOSUPTO, /* 71 */ + + /* Negated repeated character, caseless; must follow the caseful ones */ + + OP_NOTSTARI, /* 72 */ + OP_NOTMINSTARI, /* 73 */ + OP_NOTPLUSI, /* 74 */ + OP_NOTMINPLUSI, /* 75 */ + OP_NOTQUERYI, /* 76 */ + OP_NOTMINQUERYI, /* 77 */ + + OP_NOTUPTOI, /* 78 From 0 to n matches, caseless */ + OP_NOTMINUPTOI, /* 79 */ + OP_NOTEXACTI, /* 80 Exactly n matches */ + + OP_NOTPOSSTARI, /* 81 Possessified versions, caseless */ + OP_NOTPOSPLUSI, /* 82 */ + OP_NOTPOSQUERYI, /* 83 */ + OP_NOTPOSUPTOI, /* 84 */ + + /* Character types */ + + OP_TYPESTAR, /* 85 The maximizing and minimizing versions of */ + OP_TYPEMINSTAR, /* 86 these six opcodes must come in pairs, with */ + OP_TYPEPLUS, /* 87 the minimizing one second. These codes must */ + OP_TYPEMINPLUS, /* 88 be in exactly the same order as those above. */ + OP_TYPEQUERY, /* 89 */ + OP_TYPEMINQUERY, /* 90 */ + + OP_TYPEUPTO, /* 91 From 0 to n matches */ + OP_TYPEMINUPTO, /* 92 */ + OP_TYPEEXACT, /* 93 Exactly n matches */ + + OP_TYPEPOSSTAR, /* 94 Possessified versions */ + OP_TYPEPOSPLUS, /* 95 */ + OP_TYPEPOSQUERY, /* 96 */ + OP_TYPEPOSUPTO, /* 97 */ + + /* These are used for character classes and back references; only the + first six are the same as the sets above. */ + + OP_CRSTAR, /* 98 The maximizing and minimizing versions of */ + OP_CRMINSTAR, /* 99 all these opcodes must come in pairs, with */ + OP_CRPLUS, /* 100 the minimizing one second. These codes must */ + OP_CRMINPLUS, /* 101 be in exactly the same order as those above. */ + OP_CRQUERY, /* 102 */ + OP_CRMINQUERY, /* 103 */ + + OP_CRRANGE, /* 104 These are different to the three sets above. */ + OP_CRMINRANGE, /* 105 */ + + OP_CRPOSSTAR, /* 106 Possessified versions */ + OP_CRPOSPLUS, /* 107 */ + OP_CRPOSQUERY, /* 108 */ + OP_CRPOSRANGE, /* 109 */ + + /* End of quantifier opcodes */ + + OP_CLASS, /* 110 Match a character class, chars < 256 only */ + OP_NCLASS, /* 111 Same, but the bitmap was created from a negative + class - the difference is relevant only when a + character > 255 is encountered. */ + OP_XCLASS, /* 112 Extended class for handling > 255 chars within the + class. This does both positive and negative. */ + OP_REF, /* 113 Match a back reference, casefully */ + OP_REFI, /* 114 Match a back reference, caselessly */ + OP_DNREF, /* 115 Match a duplicate name backref, casefully */ + OP_DNREFI, /* 116 Match a duplicate name backref, caselessly */ + OP_RECURSE, /* 117 Match a numbered subpattern (possibly recursive) */ + OP_CALLOUT, /* 118 Call out to external function if provided */ + OP_CALLOUT_STR, /* 119 Call out with string argument */ + + OP_ALT, /* 120 Start of alternation */ + OP_KET, /* 121 End of group that doesn't have an unbounded repeat */ + OP_KETRMAX, /* 122 These two must remain together and in this */ + OP_KETRMIN, /* 123 order. They are for groups the repeat for ever. */ + OP_KETRPOS, /* 124 Possessive unlimited repeat. */ + + /* The assertions must come before BRA, CBRA, ONCE, and COND. */ + + OP_REVERSE, /* 125 Move pointer back - used in lookbehind assertions */ + OP_ASSERT, /* 126 Positive lookahead */ + OP_ASSERT_NOT, /* 127 Negative lookahead */ + OP_ASSERTBACK, /* 128 Positive lookbehind */ + OP_ASSERTBACK_NOT, /* 129 Negative lookbehind */ + OP_ASSERT_NA, /* 130 Positive non-atomic lookahead */ + OP_ASSERTBACK_NA, /* 131 Positive non-atomic lookbehind */ + + /* ONCE, SCRIPT_RUN, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come + immediately after the assertions, with ONCE first, as there's a test for >= + ONCE for a subpattern that isn't an assertion. The POS versions must + immediately follow the non-POS versions in each case. */ + + OP_ONCE, /* 132 Atomic group, contains captures */ + OP_SCRIPT_RUN, /* 133 Non-capture, but check characters' scripts */ + OP_BRA, /* 134 Start of non-capturing bracket */ + OP_BRAPOS, /* 135 Ditto, with unlimited, possessive repeat */ + OP_CBRA, /* 136 Start of capturing bracket */ + OP_CBRAPOS, /* 137 Ditto, with unlimited, possessive repeat */ + OP_COND, /* 138 Conditional group */ + + /* These five must follow the previous five, in the same order. There's a + check for >= SBRA to distinguish the two sets. */ + + OP_SBRA, /* 139 Start of non-capturing bracket, check empty */ + OP_SBRAPOS, /* 149 Ditto, with unlimited, possessive repeat */ + OP_SCBRA, /* 141 Start of capturing bracket, check empty */ + OP_SCBRAPOS, /* 142 Ditto, with unlimited, possessive repeat */ + OP_SCOND, /* 143 Conditional group, check empty */ + + /* The next two pairs must (respectively) be kept together. */ + + OP_CREF, /* 144 Used to hold a capture number as condition */ + OP_DNCREF, /* 145 Used to point to duplicate names as a condition */ + OP_RREF, /* 146 Used to hold a recursion number as condition */ + OP_DNRREF, /* 147 Used to point to duplicate names as a condition */ + OP_FALSE, /* 148 Always false (used by DEFINE and VERSION) */ + OP_TRUE, /* 149 Always true (used by VERSION) */ + + OP_BRAZERO, /* 150 These two must remain together and in this */ + OP_BRAMINZERO, /* 151 order. */ + OP_BRAPOSZERO, /* 152 */ + + /* These are backtracking control verbs */ + + OP_MARK, /* 153 always has an argument */ + OP_PRUNE, /* 154 */ + OP_PRUNE_ARG, /* 155 same, but with argument */ + OP_SKIP, /* 156 */ + OP_SKIP_ARG, /* 157 same, but with argument */ + OP_THEN, /* 158 */ + OP_THEN_ARG, /* 159 same, but with argument */ + OP_COMMIT, /* 160 */ + OP_COMMIT_ARG, /* 161 same, but with argument */ + + /* These are forced failure and success verbs. FAIL and ACCEPT do accept an + argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL) + without the need for a special opcode. */ + + OP_FAIL, /* 162 */ + OP_ACCEPT, /* 163 */ + OP_ASSERT_ACCEPT, /* 164 Used inside assertions */ + OP_CLOSE, /* 165 Used before OP_ACCEPT to close open captures */ + + /* This is used to skip a subpattern with a {0} quantifier */ + + OP_SKIPZERO, /* 166 */ + + /* This is used to identify a DEFINE group during compilation so that it can + be checked for having only one branch. It is changed to OP_FALSE before + compilation finishes. */ + + OP_DEFINE, /* 167 */ + + /* This is not an opcode, but is used to check that tables indexed by opcode + are the correct length, in order to catch updating errors - there have been + some in the past. */ + + OP_TABLE_LENGTH + +}; + +/* *** NOTE NOTE NOTE *** Whenever the list above is updated, the two macro +definitions that follow must also be updated to match. There are also tables +called "opcode_possessify" in pcre2_compile.c and "coptable" and "poptable" in +pcre2_dfa_match.c that must be updated. */ + + +/* This macro defines textual names for all the opcodes. These are used only +for debugging, and some of them are only partial names. The macro is referenced +only in pcre2_printint.c, which fills out the full names in many cases (and in +some cases doesn't actually use these names at all). */ + +#define OP_NAME_LIST \ + "End", "\\A", "\\G", "\\K", "\\B", "\\b", "\\D", "\\d", \ + "\\S", "\\s", "\\W", "\\w", "Any", "AllAny", "Anybyte", \ + "notprop", "prop", "\\R", "\\H", "\\h", "\\V", "\\v", \ + "extuni", "\\Z", "\\z", \ + "$", "$", "^", "^", "char", "chari", "not", "noti", \ + "*", "*?", "+", "+?", "?", "??", \ + "{", "{", "{", \ + "*+","++", "?+", "{", \ + "*", "*?", "+", "+?", "?", "??", \ + "{", "{", "{", \ + "*+","++", "?+", "{", \ + "*", "*?", "+", "+?", "?", "??", \ + "{", "{", "{", \ + "*+","++", "?+", "{", \ + "*", "*?", "+", "+?", "?", "??", \ + "{", "{", "{", \ + "*+","++", "?+", "{", \ + "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ + "*+","++", "?+", "{", \ + "*", "*?", "+", "+?", "?", "??", "{", "{", \ + "*+","++", "?+", "{", \ + "class", "nclass", "xclass", "Ref", "Refi", "DnRef", "DnRefi", \ + "Recurse", "Callout", "CalloutStr", \ + "Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \ + "Reverse", "Assert", "Assert not", \ + "Assert back", "Assert back not", \ + "Non-atomic assert", "Non-atomic assert back", \ + "Once", \ + "Script run", \ + "Bra", "BraPos", "CBra", "CBraPos", \ + "Cond", \ + "SBra", "SBraPos", "SCBra", "SCBraPos", \ + "SCond", \ + "Cond ref", "Cond dnref", "Cond rec", "Cond dnrec", \ + "Cond false", "Cond true", \ + "Brazero", "Braminzero", "Braposzero", \ + "*MARK", "*PRUNE", "*PRUNE", "*SKIP", "*SKIP", \ + "*THEN", "*THEN", "*COMMIT", "*COMMIT", "*FAIL", \ + "*ACCEPT", "*ASSERT_ACCEPT", \ + "Close", "Skip zero", "Define" + + +/* This macro defines the length of fixed length operations in the compiled +regex. The lengths are used when searching for specific things, and also in the +debugging printing of a compiled regex. We use a macro so that it can be +defined close to the definitions of the opcodes themselves. + +As things have been extended, some of these are no longer fixed lenths, but are +minima instead. For example, the length of a single-character repeat may vary +in UTF-8 mode. The code that uses this table must know about such things. */ + +#define OP_LENGTHS \ + 1, /* End */ \ + 1, 1, 1, 1, 1, /* \A, \G, \K, \B, \b */ \ + 1, 1, 1, 1, 1, 1, /* \D, \d, \S, \s, \W, \w */ \ + 1, 1, 1, /* Any, AllAny, Anybyte */ \ + 3, 3, /* \P, \p */ \ + 1, 1, 1, 1, 1, /* \R, \H, \h, \V, \v */ \ + 1, /* \X */ \ + 1, 1, 1, 1, 1, 1, /* \Z, \z, $, $M ^, ^M */ \ + 2, /* Char - the minimum length */ \ + 2, /* Chari - the minimum length */ \ + 2, /* not */ \ + 2, /* noti */ \ + /* Positive single-char repeats ** These are */ \ + 2, 2, 2, 2, 2, 2, /* *, *?, +, +?, ?, ?? ** minima in */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* upto, minupto ** mode */ \ + 2+IMM2_SIZE, /* exact */ \ + 2, 2, 2, 2+IMM2_SIZE, /* *+, ++, ?+, upto+ */ \ + 2, 2, 2, 2, 2, 2, /* *I, *?I, +I, +?I, ?I, ??I ** UTF-8 */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* upto I, minupto I */ \ + 2+IMM2_SIZE, /* exact I */ \ + 2, 2, 2, 2+IMM2_SIZE, /* *+I, ++I, ?+I, upto+I */ \ + /* Negative single-char repeats - only for chars < 256 */ \ + 2, 2, 2, 2, 2, 2, /* NOT *, *?, +, +?, ?, ?? */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* NOT upto, minupto */ \ + 2+IMM2_SIZE, /* NOT exact */ \ + 2, 2, 2, 2+IMM2_SIZE, /* Possessive NOT *, +, ?, upto */ \ + 2, 2, 2, 2, 2, 2, /* NOT *I, *?I, +I, +?I, ?I, ??I */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* NOT upto I, minupto I */ \ + 2+IMM2_SIZE, /* NOT exact I */ \ + 2, 2, 2, 2+IMM2_SIZE, /* Possessive NOT *I, +I, ?I, upto I */ \ + /* Positive type repeats */ \ + 2, 2, 2, 2, 2, 2, /* Type *, *?, +, +?, ?, ?? */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* Type upto, minupto */ \ + 2+IMM2_SIZE, /* Type exact */ \ + 2, 2, 2, 2+IMM2_SIZE, /* Possessive *+, ++, ?+, upto+ */ \ + /* Character class & ref repeats */ \ + 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ \ + 1+2*IMM2_SIZE, 1+2*IMM2_SIZE, /* CRRANGE, CRMINRANGE */ \ + 1, 1, 1, 1+2*IMM2_SIZE, /* Possessive *+, ++, ?+, CRPOSRANGE */ \ + 1+(32/sizeof(PCRE2_UCHAR)), /* CLASS */ \ + 1+(32/sizeof(PCRE2_UCHAR)), /* NCLASS */ \ + 0, /* XCLASS - variable length */ \ + 1+IMM2_SIZE, /* REF */ \ + 1+IMM2_SIZE, /* REFI */ \ + 1+2*IMM2_SIZE, /* DNREF */ \ + 1+2*IMM2_SIZE, /* DNREFI */ \ + 1+LINK_SIZE, /* RECURSE */ \ + 1+2*LINK_SIZE+1, /* CALLOUT */ \ + 0, /* CALLOUT_STR - variable length */ \ + 1+LINK_SIZE, /* Alt */ \ + 1+LINK_SIZE, /* Ket */ \ + 1+LINK_SIZE, /* KetRmax */ \ + 1+LINK_SIZE, /* KetRmin */ \ + 1+LINK_SIZE, /* KetRpos */ \ + 1+LINK_SIZE, /* Reverse */ \ + 1+LINK_SIZE, /* Assert */ \ + 1+LINK_SIZE, /* Assert not */ \ + 1+LINK_SIZE, /* Assert behind */ \ + 1+LINK_SIZE, /* Assert behind not */ \ + 1+LINK_SIZE, /* NA Assert */ \ + 1+LINK_SIZE, /* NA Assert behind */ \ + 1+LINK_SIZE, /* ONCE */ \ + 1+LINK_SIZE, /* SCRIPT_RUN */ \ + 1+LINK_SIZE, /* BRA */ \ + 1+LINK_SIZE, /* BRAPOS */ \ + 1+LINK_SIZE+IMM2_SIZE, /* CBRA */ \ + 1+LINK_SIZE+IMM2_SIZE, /* CBRAPOS */ \ + 1+LINK_SIZE, /* COND */ \ + 1+LINK_SIZE, /* SBRA */ \ + 1+LINK_SIZE, /* SBRAPOS */ \ + 1+LINK_SIZE+IMM2_SIZE, /* SCBRA */ \ + 1+LINK_SIZE+IMM2_SIZE, /* SCBRAPOS */ \ + 1+LINK_SIZE, /* SCOND */ \ + 1+IMM2_SIZE, 1+2*IMM2_SIZE, /* CREF, DNCREF */ \ + 1+IMM2_SIZE, 1+2*IMM2_SIZE, /* RREF, DNRREF */ \ + 1, 1, /* FALSE, TRUE */ \ + 1, 1, 1, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ \ + 3, 1, 3, /* MARK, PRUNE, PRUNE_ARG */ \ + 1, 3, /* SKIP, SKIP_ARG */ \ + 1, 3, /* THEN, THEN_ARG */ \ + 1, 3, /* COMMIT, COMMIT_ARG */ \ + 1, 1, 1, /* FAIL, ACCEPT, ASSERT_ACCEPT */ \ + 1+IMM2_SIZE, 1, /* CLOSE, SKIPZERO */ \ + 1 /* DEFINE */ + +/* A magic value for OP_RREF to indicate the "any recursion" condition. */ + +#define RREF_ANY 0xffff + + +/* ---------- Private structures that are mode-independent. ---------- */ + +/* Structure to hold data for custom memory management. */ + +typedef struct pcre2_memctl { + void * (*malloc)(size_t, void *); + void (*free)(void *, void *); + void *memory_data; +} pcre2_memctl; + +/* Structure for building a chain of open capturing subpatterns during +compiling, so that instructions to close them can be compiled when (*ACCEPT) is +encountered. */ + +typedef struct open_capitem { + struct open_capitem *next; /* Chain link */ + uint16_t number; /* Capture number */ + uint16_t assert_depth; /* Assertion depth when opened */ +} open_capitem; + +/* Layout of the UCP type table that translates property names into types and +codes. Each entry used to point directly to a name, but to reduce the number of +relocations in shared libraries, it now has an offset into a single string +instead. */ + +typedef struct { + uint16_t name_offset; + uint16_t type; + uint16_t value; +} ucp_type_table; + +/* Unicode character database (UCD) record format */ + +typedef struct { + uint8_t script; /* ucp_Arabic, etc. */ + uint8_t chartype; /* ucp_Cc, etc. (general categories) */ + uint8_t gbprop; /* ucp_gbControl, etc. (grapheme break property) */ + uint8_t caseset; /* offset to multichar other cases or zero */ + int32_t other_case; /* offset to other case, or zero if none */ + uint16_t scriptx_bidiclass; /* script extension (11 bit) and bidi class (5 bit) values */ + uint16_t bprops; /* binary properties offset */ +} ucd_record; + +/* UCD access macros */ + +#define UCD_BLOCK_SIZE 128 +#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \ + PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \ + UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE]) + +#if PCRE2_CODE_UNIT_WIDTH == 32 +#define GET_UCD(ch) ((ch > MAX_UTF_CODE_POINT)? \ + PRIV(dummy_ucd_record) : REAL_GET_UCD(ch)) +#else +#define GET_UCD(ch) REAL_GET_UCD(ch) +#endif + +#define UCD_SCRIPTX_MASK 0x3ff +#define UCD_BIDICLASS_SHIFT 11 +#define UCD_BPROPS_MASK 0xfff + +#define UCD_SCRIPTX_PROP(prop) ((prop)->scriptx_bidiclass & UCD_SCRIPTX_MASK) +#define UCD_BIDICLASS_PROP(prop) ((prop)->scriptx_bidiclass >> UCD_BIDICLASS_SHIFT) +#define UCD_BPROPS_PROP(prop) ((prop)->bprops & UCD_BPROPS_MASK) + +#define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype +#define UCD_SCRIPT(ch) GET_UCD(ch)->script +#define UCD_CATEGORY(ch) PRIV(ucp_gentype)[UCD_CHARTYPE(ch)] +#define UCD_GRAPHBREAK(ch) GET_UCD(ch)->gbprop +#define UCD_CASESET(ch) GET_UCD(ch)->caseset +#define UCD_OTHERCASE(ch) ((uint32_t)((int)ch + (int)(GET_UCD(ch)->other_case))) +#define UCD_SCRIPTX(ch) UCD_SCRIPTX_PROP(GET_UCD(ch)) +#define UCD_BPROPS(ch) UCD_BPROPS_PROP(GET_UCD(ch)) +#define UCD_BIDICLASS(ch) UCD_BIDICLASS_PROP(GET_UCD(ch)) + +/* The "scriptx" and bprops fields contain offsets into vectors of 32-bit words +that form a bitmap representing a list of scripts or boolean properties. These +macros test or set a bit in the map by number. */ + +#define MAPBIT(map,n) ((map)[(n)/32]&(1u<<((n)%32))) +#define MAPSET(map,n) ((map)[(n)/32]|=(1u<<((n)%32))) + +/* Header for serialized pcre2 codes. */ + +typedef struct pcre2_serialized_data { + uint32_t magic; + uint32_t version; + uint32_t config; + int32_t number_of_codes; +} pcre2_serialized_data; + + + +/* ----------------- Items that need PCRE2_CODE_UNIT_WIDTH ----------------- */ + +/* When this file is included by pcre2test, PCRE2_CODE_UNIT_WIDTH is defined as +0, so the following items are omitted. */ + +#if defined PCRE2_CODE_UNIT_WIDTH && PCRE2_CODE_UNIT_WIDTH != 0 + +/* EBCDIC is supported only for the 8-bit library. */ + +#if defined EBCDIC && PCRE2_CODE_UNIT_WIDTH != 8 +#error EBCDIC is not supported for the 16-bit or 32-bit libraries +#endif + +/* This is the largest non-UTF code point. */ + +#define MAX_NON_UTF_CHAR (0xffffffffU >> (32 - PCRE2_CODE_UNIT_WIDTH)) + +/* Internal shared data tables and variables. These are used by more than one +of the exported public functions. They have to be "external" in the C sense, +but are not part of the PCRE2 public API. Although the data for some of them is +identical in all libraries, they must have different names so that multiple +libraries can be simultaneously linked to a single application. However, UTF-8 +tables are needed only when compiling the 8-bit library. */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 +extern const int PRIV(utf8_table1)[]; +extern const int PRIV(utf8_table1_size); +extern const int PRIV(utf8_table2)[]; +extern const int PRIV(utf8_table3)[]; +extern const uint8_t PRIV(utf8_table4)[]; +#endif + +#define _pcre2_OP_lengths PCRE2_SUFFIX(_pcre2_OP_lengths_) +#define _pcre2_callout_end_delims PCRE2_SUFFIX(_pcre2_callout_end_delims_) +#define _pcre2_callout_start_delims PCRE2_SUFFIX(_pcre2_callout_start_delims_) +#define _pcre2_default_compile_context PCRE2_SUFFIX(_pcre2_default_compile_context_) +#define _pcre2_default_convert_context PCRE2_SUFFIX(_pcre2_default_convert_context_) +#define _pcre2_default_match_context PCRE2_SUFFIX(_pcre2_default_match_context_) +#define _pcre2_default_tables PCRE2_SUFFIX(_pcre2_default_tables_) +#if PCRE2_CODE_UNIT_WIDTH == 32 +#define _pcre2_dummy_ucd_record PCRE2_SUFFIX(_pcre2_dummy_ucd_record_) +#endif +#define _pcre2_hspace_list PCRE2_SUFFIX(_pcre2_hspace_list_) +#define _pcre2_vspace_list PCRE2_SUFFIX(_pcre2_vspace_list_) +#define _pcre2_ucd_boolprop_sets PCRE2_SUFFIX(_pcre2_ucd_boolprop_sets_) +#define _pcre2_ucd_caseless_sets PCRE2_SUFFIX(_pcre2_ucd_caseless_sets_) +#define _pcre2_ucd_digit_sets PCRE2_SUFFIX(_pcre2_ucd_digit_sets_) +#define _pcre2_ucd_script_sets PCRE2_SUFFIX(_pcre2_ucd_script_sets_) +#define _pcre2_ucd_records PCRE2_SUFFIX(_pcre2_ucd_records_) +#define _pcre2_ucd_stage1 PCRE2_SUFFIX(_pcre2_ucd_stage1_) +#define _pcre2_ucd_stage2 PCRE2_SUFFIX(_pcre2_ucd_stage2_) +#define _pcre2_ucp_gbtable PCRE2_SUFFIX(_pcre2_ucp_gbtable_) +#define _pcre2_ucp_gentype PCRE2_SUFFIX(_pcre2_ucp_gentype_) +#define _pcre2_ucp_typerange PCRE2_SUFFIX(_pcre2_ucp_typerange_) +#define _pcre2_unicode_version PCRE2_SUFFIX(_pcre2_unicode_version_) +#define _pcre2_utt PCRE2_SUFFIX(_pcre2_utt_) +#define _pcre2_utt_names PCRE2_SUFFIX(_pcre2_utt_names_) +#define _pcre2_utt_size PCRE2_SUFFIX(_pcre2_utt_size_) + +extern const uint8_t PRIV(OP_lengths)[]; +extern const uint32_t PRIV(callout_end_delims)[]; +extern const uint32_t PRIV(callout_start_delims)[]; +extern const pcre2_compile_context PRIV(default_compile_context); +extern const pcre2_convert_context PRIV(default_convert_context); +extern const pcre2_match_context PRIV(default_match_context); +extern const uint8_t PRIV(default_tables)[]; +extern const uint32_t PRIV(hspace_list)[]; +extern const uint32_t PRIV(vspace_list)[]; +extern const uint32_t PRIV(ucd_boolprop_sets)[]; +extern const uint32_t PRIV(ucd_caseless_sets)[]; +extern const uint32_t PRIV(ucd_digit_sets)[]; +extern const uint32_t PRIV(ucd_script_sets)[]; +extern const ucd_record PRIV(ucd_records)[]; +#if PCRE2_CODE_UNIT_WIDTH == 32 +extern const ucd_record PRIV(dummy_ucd_record)[]; +#endif +extern const uint16_t PRIV(ucd_stage1)[]; +extern const uint16_t PRIV(ucd_stage2)[]; +extern const uint32_t PRIV(ucp_gbtable)[]; +extern const uint32_t PRIV(ucp_gentype)[]; +#ifdef SUPPORT_JIT +extern const int PRIV(ucp_typerange)[]; +#endif +extern const char *PRIV(unicode_version); +extern const ucp_type_table PRIV(utt)[]; +extern const char PRIV(utt_names)[]; +extern const size_t PRIV(utt_size); + +/* Mode-dependent macros and hidden and private structures are defined in a +separate file so that pcre2test can include them at all supported widths. When +compiling the library, PCRE2_CODE_UNIT_WIDTH will be defined, and we can +include them at the appropriate width, after setting up suffix macros for the +private structures. */ + +#define branch_chain PCRE2_SUFFIX(branch_chain_) +#define compile_block PCRE2_SUFFIX(compile_block_) +#define dfa_match_block PCRE2_SUFFIX(dfa_match_block_) +#define match_block PCRE2_SUFFIX(match_block_) +#define named_group PCRE2_SUFFIX(named_group_) + +#include "pcre2_intmodedep.h" + +/* Private "external" functions. These are internal functions that are called +from modules other than the one in which they are defined. They have to be +"external" in the C sense, but are not part of the PCRE2 public API. They are +not referenced from pcre2test, and must not be defined when no code unit width +is available. */ + +#define _pcre2_auto_possessify PCRE2_SUFFIX(_pcre2_auto_possessify_) +#define _pcre2_check_escape PCRE2_SUFFIX(_pcre2_check_escape_) +#define _pcre2_extuni PCRE2_SUFFIX(_pcre2_extuni_) +#define _pcre2_find_bracket PCRE2_SUFFIX(_pcre2_find_bracket_) +#define _pcre2_is_newline PCRE2_SUFFIX(_pcre2_is_newline_) +#define _pcre2_jit_free_rodata PCRE2_SUFFIX(_pcre2_jit_free_rodata_) +#define _pcre2_jit_free PCRE2_SUFFIX(_pcre2_jit_free_) +#define _pcre2_jit_get_size PCRE2_SUFFIX(_pcre2_jit_get_size_) +#define _pcre2_jit_get_target PCRE2_SUFFIX(_pcre2_jit_get_target_) +#define _pcre2_memctl_malloc PCRE2_SUFFIX(_pcre2_memctl_malloc_) +#define _pcre2_ord2utf PCRE2_SUFFIX(_pcre2_ord2utf_) +#define _pcre2_script_run PCRE2_SUFFIX(_pcre2_script_run_) +#define _pcre2_strcmp PCRE2_SUFFIX(_pcre2_strcmp_) +#define _pcre2_strcmp_c8 PCRE2_SUFFIX(_pcre2_strcmp_c8_) +#define _pcre2_strcpy_c8 PCRE2_SUFFIX(_pcre2_strcpy_c8_) +#define _pcre2_strlen PCRE2_SUFFIX(_pcre2_strlen_) +#define _pcre2_strncmp PCRE2_SUFFIX(_pcre2_strncmp_) +#define _pcre2_strncmp_c8 PCRE2_SUFFIX(_pcre2_strncmp_c8_) +#define _pcre2_study PCRE2_SUFFIX(_pcre2_study_) +#define _pcre2_valid_utf PCRE2_SUFFIX(_pcre2_valid_utf_) +#define _pcre2_was_newline PCRE2_SUFFIX(_pcre2_was_newline_) +#define _pcre2_xclass PCRE2_SUFFIX(_pcre2_xclass_) + +extern int _pcre2_auto_possessify(PCRE2_UCHAR *, + const compile_block *); +extern int _pcre2_check_escape(PCRE2_SPTR *, PCRE2_SPTR, uint32_t *, + int *, uint32_t, uint32_t, BOOL, compile_block *); +extern PCRE2_SPTR _pcre2_extuni(uint32_t, PCRE2_SPTR, PCRE2_SPTR, PCRE2_SPTR, + BOOL, int *); +extern PCRE2_SPTR _pcre2_find_bracket(PCRE2_SPTR, BOOL, int); +extern BOOL _pcre2_is_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR, + uint32_t *, BOOL); +extern void _pcre2_jit_free_rodata(void *, void *); +extern void _pcre2_jit_free(void *, pcre2_memctl *); +extern size_t _pcre2_jit_get_size(void *); +const char * _pcre2_jit_get_target(void); +extern void * _pcre2_memctl_malloc(size_t, pcre2_memctl *); +extern unsigned int _pcre2_ord2utf(uint32_t, PCRE2_UCHAR *); +extern BOOL _pcre2_script_run(PCRE2_SPTR, PCRE2_SPTR, BOOL); +extern int _pcre2_strcmp(PCRE2_SPTR, PCRE2_SPTR); +extern int _pcre2_strcmp_c8(PCRE2_SPTR, const char *); +extern PCRE2_SIZE _pcre2_strcpy_c8(PCRE2_UCHAR *, const char *); +extern PCRE2_SIZE _pcre2_strlen(PCRE2_SPTR); +extern int _pcre2_strncmp(PCRE2_SPTR, PCRE2_SPTR, size_t); +extern int _pcre2_strncmp_c8(PCRE2_SPTR, const char *, size_t); +extern int _pcre2_study(pcre2_real_code *); +extern int _pcre2_valid_utf(PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE *); +extern BOOL _pcre2_was_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR, + uint32_t *, BOOL); +extern BOOL _pcre2_xclass(uint32_t, PCRE2_SPTR, BOOL); + +/* This function is needed only when memmove() is not available. */ + +#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE) +#define _pcre2_memmove PCRE2_SUFFIX(_pcre2_memmove) +extern void * _pcre2_memmove(void *, const void *, size_t); +#endif + +#endif /* PCRE2_CODE_UNIT_WIDTH */ +#endif /* PCRE2_INTERNAL_H_IDEMPOTENT_GUARD */ + +/* End of pcre2_internal.h */ diff --git a/include/php/ext/pcre/pcre2lib/pcre2_intmodedep.h b/include/php/ext/pcre/pcre2lib/pcre2_intmodedep.h new file mode 100644 index 0000000..390e737 --- /dev/null +++ b/include/php/ext/pcre/pcre2lib/pcre2_intmodedep.h @@ -0,0 +1,934 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2022 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + + +/* This module contains mode-dependent macro and structure definitions. The +file is #included by pcre2_internal.h if PCRE2_CODE_UNIT_WIDTH is defined. +These mode-dependent items are kept in a separate file so that they can also be +#included multiple times for different code unit widths by pcre2test in order +to have access to the hidden structures at all supported widths. + +Some of the mode-dependent macros are required at different widths for +different parts of the pcre2test code (in particular, the included +pcre_printint.c file). We undefine them here so that they can be re-defined for +multiple inclusions. Not all of these are used in pcre2test, but it's easier +just to undefine them all. */ + +#undef ACROSSCHAR +#undef BACKCHAR +#undef BYTES2CU +#undef CHMAX_255 +#undef CU2BYTES +#undef FORWARDCHAR +#undef FORWARDCHARTEST +#undef GET +#undef GET2 +#undef GETCHAR +#undef GETCHARINC +#undef GETCHARINCTEST +#undef GETCHARLEN +#undef GETCHARLENTEST +#undef GETCHARTEST +#undef GET_EXTRALEN +#undef HAS_EXTRALEN +#undef IMM2_SIZE +#undef MAX_255 +#undef MAX_MARK +#undef MAX_PATTERN_SIZE +#undef MAX_UTF_SINGLE_CU +#undef NOT_FIRSTCU +#undef PUT +#undef PUT2 +#undef PUT2INC +#undef PUTCHAR +#undef PUTINC +#undef TABLE_GET + + + +/* -------------------------- MACROS ----------------------------- */ + +/* PCRE keeps offsets in its compiled code as at least 16-bit quantities +(always stored in big-endian order in 8-bit mode) by default. These are used, +for example, to link from the start of a subpattern to its alternatives and its +end. The use of 16 bits per offset limits the size of an 8-bit compiled regex +to around 64K, which is big enough for almost everybody. However, I received a +request for an even bigger limit. For this reason, and also to make the code +easier to maintain, the storing and loading of offsets from the compiled code +unit string is now handled by the macros that are defined here. + +The macros are controlled by the value of LINK_SIZE. This defaults to 2, but +values of 3 or 4 are also supported. */ + +/* ------------------- 8-bit support ------------------ */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 + +#if LINK_SIZE == 2 +#define PUT(a,n,d) \ + (a[n] = (PCRE2_UCHAR)((d) >> 8)), \ + (a[(n)+1] = (PCRE2_UCHAR)((d) & 255)) +#define GET(a,n) \ + (unsigned int)(((a)[n] << 8) | (a)[(n)+1]) +#define MAX_PATTERN_SIZE (1 << 16) + +#elif LINK_SIZE == 3 +#define PUT(a,n,d) \ + (a[n] = (PCRE2_UCHAR)((d) >> 16)), \ + (a[(n)+1] = (PCRE2_UCHAR)((d) >> 8)), \ + (a[(n)+2] = (PCRE2_UCHAR)((d) & 255)) +#define GET(a,n) \ + (unsigned int)(((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2]) +#define MAX_PATTERN_SIZE (1 << 24) + +#elif LINK_SIZE == 4 +#define PUT(a,n,d) \ + (a[n] = (PCRE2_UCHAR)((d) >> 24)), \ + (a[(n)+1] = (PCRE2_UCHAR)((d) >> 16)), \ + (a[(n)+2] = (PCRE2_UCHAR)((d) >> 8)), \ + (a[(n)+3] = (PCRE2_UCHAR)((d) & 255)) +#define GET(a,n) \ + (unsigned int)(((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3]) +#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */ + +#else +#error LINK_SIZE must be 2, 3, or 4 +#endif + + +/* ------------------- 16-bit support ------------------ */ + +#elif PCRE2_CODE_UNIT_WIDTH == 16 + +#if LINK_SIZE == 2 +#undef LINK_SIZE +#define LINK_SIZE 1 +#define PUT(a,n,d) \ + (a[n] = (PCRE2_UCHAR)(d)) +#define GET(a,n) \ + (a[n]) +#define MAX_PATTERN_SIZE (1 << 16) + +#elif LINK_SIZE == 3 || LINK_SIZE == 4 +#undef LINK_SIZE +#define LINK_SIZE 2 +#define PUT(a,n,d) \ + (a[n] = (PCRE2_UCHAR)((d) >> 16)), \ + (a[(n)+1] = (PCRE2_UCHAR)((d) & 65535)) +#define GET(a,n) \ + (unsigned int)(((a)[n] << 16) | (a)[(n)+1]) +#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */ + +#else +#error LINK_SIZE must be 2, 3, or 4 +#endif + + +/* ------------------- 32-bit support ------------------ */ + +#elif PCRE2_CODE_UNIT_WIDTH == 32 +#undef LINK_SIZE +#define LINK_SIZE 1 +#define PUT(a,n,d) \ + (a[n] = (d)) +#define GET(a,n) \ + (a[n]) +#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */ + +#else +#error Unsupported compiling mode +#endif + + +/* --------------- Other mode-specific macros ----------------- */ + +/* PCRE uses some other (at least) 16-bit quantities that do not change when +the size of offsets changes. There are used for repeat counts and for other +things such as capturing parenthesis numbers in back references. + +Define the number of code units required to hold a 16-bit count/offset, and +macros to load and store such a value. For reasons that I do not understand, +the expression in the 8-bit GET2 macro is treated by gcc as a signed +expression, even when a is declared as unsigned. It seems that any kind of +arithmetic results in a signed value. Hence the cast. */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define IMM2_SIZE 2 +#define GET2(a,n) (unsigned int)(((a)[n] << 8) | (a)[(n)+1]) +#define PUT2(a,n,d) a[n] = (d) >> 8, a[(n)+1] = (d) & 255 + +#else /* Code units are 16 or 32 bits */ +#define IMM2_SIZE 1 +#define GET2(a,n) a[n] +#define PUT2(a,n,d) a[n] = d +#endif + +/* Other macros that are different for 8-bit mode. The MAX_255 macro checks +whether its argument, which is assumed to be one code unit, is less than 256. +The CHMAX_255 macro does not assume one code unit. The maximum length of a MARK +name must fit in one code unit; currently it is set to 255 or 65535. The +TABLE_GET macro is used to access elements of tables containing exactly 256 +items. Its argument is a code unit. When code points can be greater than 255, a +check is needed before accessing these tables. */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define MAX_255(c) TRUE +#define MAX_MARK ((1u << 8) - 1) +#define TABLE_GET(c, table, default) ((table)[c]) +#ifdef SUPPORT_UNICODE +#define SUPPORT_WIDE_CHARS +#define CHMAX_255(c) ((c) <= 255u) +#else +#define CHMAX_255(c) TRUE +#endif /* SUPPORT_UNICODE */ + +#else /* Code units are 16 or 32 bits */ +#define CHMAX_255(c) ((c) <= 255u) +#define MAX_255(c) ((c) <= 255u) +#define MAX_MARK ((1u << 16) - 1) +#define SUPPORT_WIDE_CHARS +#define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default)) +#endif + + +/* ----------------- Character-handling macros ----------------- */ + +/* There is a proposed future special "UTF-21" mode, in which only the lowest +21 bits of a 32-bit character are interpreted as UTF, with the remaining 11 +high-order bits available to the application for other uses. In preparation for +the future implementation of this mode, there are macros that load a data item +and, if in this special mode, mask it to 21 bits. These macros all have names +starting with UCHAR21. In all other modes, including the normal 32-bit +library, the macros all have the same simple definitions. When the new mode is +implemented, it is expected that these definitions will be varied appropriately +using #ifdef when compiling the library that supports the special mode. */ + +#define UCHAR21(eptr) (*(eptr)) +#define UCHAR21TEST(eptr) (*(eptr)) +#define UCHAR21INC(eptr) (*(eptr)++) +#define UCHAR21INCTEST(eptr) (*(eptr)++) + +/* When UTF encoding is being used, a character is no longer just a single +byte in 8-bit mode or a single short in 16-bit mode. The macros for character +handling generate simple sequences when used in the basic mode, and more +complicated ones for UTF characters. GETCHARLENTEST and other macros are not +used when UTF is not supported. To make sure they can never even appear when +UTF support is omitted, we don't even define them. */ + +#ifndef SUPPORT_UNICODE + +/* #define MAX_UTF_SINGLE_CU */ +/* #define HAS_EXTRALEN(c) */ +/* #define GET_EXTRALEN(c) */ +/* #define NOT_FIRSTCU(c) */ +#define GETCHAR(c, eptr) c = *eptr; +#define GETCHARTEST(c, eptr) c = *eptr; +#define GETCHARINC(c, eptr) c = *eptr++; +#define GETCHARINCTEST(c, eptr) c = *eptr++; +#define GETCHARLEN(c, eptr, len) c = *eptr; +#define PUTCHAR(c, p) (*p = c, 1) +/* #define GETCHARLENTEST(c, eptr, len) */ +/* #define BACKCHAR(eptr) */ +/* #define FORWARDCHAR(eptr) */ +/* #define FORWARCCHARTEST(eptr,end) */ +/* #define ACROSSCHAR(condition, eptr, action) */ + +#else /* SUPPORT_UNICODE */ + +/* ------------------- 8-bit support ------------------ */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define MAYBE_UTF_MULTI /* UTF chars may use multiple code units */ + +/* The largest UTF code point that can be encoded as a single code unit. */ + +#define MAX_UTF_SINGLE_CU 127 + +/* Tests whether the code point needs extra characters to decode. */ + +#define HAS_EXTRALEN(c) HASUTF8EXTRALEN(c) + +/* Returns with the additional number of characters if IS_MULTICHAR(c) is TRUE. +Otherwise it has an undefined behaviour. */ + +#define GET_EXTRALEN(c) (PRIV(utf8_table4)[(c) & 0x3fu]) + +/* Returns TRUE, if the given value is not the first code unit of a UTF +sequence. */ + +#define NOT_FIRSTCU(c) (((c) & 0xc0u) == 0x80u) + +/* Get the next UTF-8 character, not advancing the pointer. This is called when +we know we are in UTF-8 mode. */ + +#define GETCHAR(c, eptr) \ + c = *eptr; \ + if (c >= 0xc0u) GETUTF8(c, eptr); + +/* Get the next UTF-8 character, testing for UTF-8 mode, and not advancing the +pointer. */ + +#define GETCHARTEST(c, eptr) \ + c = *eptr; \ + if (utf && c >= 0xc0u) GETUTF8(c, eptr); + +/* Get the next UTF-8 character, advancing the pointer. This is called when we +know we are in UTF-8 mode. */ + +#define GETCHARINC(c, eptr) \ + c = *eptr++; \ + if (c >= 0xc0u) GETUTF8INC(c, eptr); + +/* Get the next character, testing for UTF-8 mode, and advancing the pointer. +This is called when we don't know if we are in UTF-8 mode. */ + +#define GETCHARINCTEST(c, eptr) \ + c = *eptr++; \ + if (utf && c >= 0xc0u) GETUTF8INC(c, eptr); + +/* Get the next UTF-8 character, not advancing the pointer, incrementing length +if there are extra bytes. This is called when we know we are in UTF-8 mode. */ + +#define GETCHARLEN(c, eptr, len) \ + c = *eptr; \ + if (c >= 0xc0u) GETUTF8LEN(c, eptr, len); + +/* Get the next UTF-8 character, testing for UTF-8 mode, not advancing the +pointer, incrementing length if there are extra bytes. This is called when we +do not know if we are in UTF-8 mode. */ + +#define GETCHARLENTEST(c, eptr, len) \ + c = *eptr; \ + if (utf && c >= 0xc0u) GETUTF8LEN(c, eptr, len); + +/* If the pointer is not at the start of a character, move it back until +it is. This is called only in UTF-8 mode - we don't put a test within the macro +because almost all calls are already within a block of UTF-8 only code. */ + +#define BACKCHAR(eptr) while((*eptr & 0xc0u) == 0x80u) eptr-- + +/* Same as above, just in the other direction. */ +#define FORWARDCHAR(eptr) while((*eptr & 0xc0u) == 0x80u) eptr++ +#define FORWARDCHARTEST(eptr,end) while(eptr < end && (*eptr & 0xc0u) == 0x80u) eptr++ + +/* Same as above, but it allows a fully customizable form. */ +#define ACROSSCHAR(condition, eptr, action) \ + while((condition) && ((*eptr) & 0xc0u) == 0x80u) action + +/* Deposit a character into memory, returning the number of code units. */ + +#define PUTCHAR(c, p) ((utf && c > MAX_UTF_SINGLE_CU)? \ + PRIV(ord2utf)(c,p) : (*p = c, 1)) + + +/* ------------------- 16-bit support ------------------ */ + +#elif PCRE2_CODE_UNIT_WIDTH == 16 +#define MAYBE_UTF_MULTI /* UTF chars may use multiple code units */ + +/* The largest UTF code point that can be encoded as a single code unit. */ + +#define MAX_UTF_SINGLE_CU 65535 + +/* Tests whether the code point needs extra characters to decode. */ + +#define HAS_EXTRALEN(c) (((c) & 0xfc00u) == 0xd800u) + +/* Returns with the additional number of characters if IS_MULTICHAR(c) is TRUE. +Otherwise it has an undefined behaviour. */ + +#define GET_EXTRALEN(c) 1 + +/* Returns TRUE, if the given value is not the first code unit of a UTF +sequence. */ + +#define NOT_FIRSTCU(c) (((c) & 0xfc00u) == 0xdc00u) + +/* Base macro to pick up the low surrogate of a UTF-16 character, not +advancing the pointer. */ + +#define GETUTF16(c, eptr) \ + { c = (((c & 0x3ffu) << 10) | (eptr[1] & 0x3ffu)) + 0x10000u; } + +/* Get the next UTF-16 character, not advancing the pointer. This is called when +we know we are in UTF-16 mode. */ + +#define GETCHAR(c, eptr) \ + c = *eptr; \ + if ((c & 0xfc00u) == 0xd800u) GETUTF16(c, eptr); + +/* Get the next UTF-16 character, testing for UTF-16 mode, and not advancing the +pointer. */ + +#define GETCHARTEST(c, eptr) \ + c = *eptr; \ + if (utf && (c & 0xfc00u) == 0xd800u) GETUTF16(c, eptr); + +/* Base macro to pick up the low surrogate of a UTF-16 character, advancing +the pointer. */ + +#define GETUTF16INC(c, eptr) \ + { c = (((c & 0x3ffu) << 10) | (*eptr++ & 0x3ffu)) + 0x10000u; } + +/* Get the next UTF-16 character, advancing the pointer. This is called when we +know we are in UTF-16 mode. */ + +#define GETCHARINC(c, eptr) \ + c = *eptr++; \ + if ((c & 0xfc00u) == 0xd800u) GETUTF16INC(c, eptr); + +/* Get the next character, testing for UTF-16 mode, and advancing the pointer. +This is called when we don't know if we are in UTF-16 mode. */ + +#define GETCHARINCTEST(c, eptr) \ + c = *eptr++; \ + if (utf && (c & 0xfc00u) == 0xd800u) GETUTF16INC(c, eptr); + +/* Base macro to pick up the low surrogate of a UTF-16 character, not +advancing the pointer, incrementing the length. */ + +#define GETUTF16LEN(c, eptr, len) \ + { c = (((c & 0x3ffu) << 10) | (eptr[1] & 0x3ffu)) + 0x10000u; len++; } + +/* Get the next UTF-16 character, not advancing the pointer, incrementing +length if there is a low surrogate. This is called when we know we are in +UTF-16 mode. */ + +#define GETCHARLEN(c, eptr, len) \ + c = *eptr; \ + if ((c & 0xfc00u) == 0xd800u) GETUTF16LEN(c, eptr, len); + +/* Get the next UTF-816character, testing for UTF-16 mode, not advancing the +pointer, incrementing length if there is a low surrogate. This is called when +we do not know if we are in UTF-16 mode. */ + +#define GETCHARLENTEST(c, eptr, len) \ + c = *eptr; \ + if (utf && (c & 0xfc00u) == 0xd800u) GETUTF16LEN(c, eptr, len); + +/* If the pointer is not at the start of a character, move it back until +it is. This is called only in UTF-16 mode - we don't put a test within the +macro because almost all calls are already within a block of UTF-16 only +code. */ + +#define BACKCHAR(eptr) if ((*eptr & 0xfc00u) == 0xdc00u) eptr-- + +/* Same as above, just in the other direction. */ +#define FORWARDCHAR(eptr) if ((*eptr & 0xfc00u) == 0xdc00u) eptr++ +#define FORWARDCHARTEST(eptr,end) if (eptr < end && (*eptr & 0xfc00u) == 0xdc00u) eptr++ + +/* Same as above, but it allows a fully customizable form. */ +#define ACROSSCHAR(condition, eptr, action) \ + if ((condition) && ((*eptr) & 0xfc00u) == 0xdc00u) action + +/* Deposit a character into memory, returning the number of code units. */ + +#define PUTCHAR(c, p) ((utf && c > MAX_UTF_SINGLE_CU)? \ + PRIV(ord2utf)(c,p) : (*p = c, 1)) + + +/* ------------------- 32-bit support ------------------ */ + +#else + +/* These are trivial for the 32-bit library, since all UTF-32 characters fit +into one PCRE2_UCHAR unit. */ + +#define MAX_UTF_SINGLE_CU (0x10ffffu) +#define HAS_EXTRALEN(c) (0) +#define GET_EXTRALEN(c) (0) +#define NOT_FIRSTCU(c) (0) + +/* Get the next UTF-32 character, not advancing the pointer. This is called when +we know we are in UTF-32 mode. */ + +#define GETCHAR(c, eptr) \ + c = *(eptr); + +/* Get the next UTF-32 character, testing for UTF-32 mode, and not advancing the +pointer. */ + +#define GETCHARTEST(c, eptr) \ + c = *(eptr); + +/* Get the next UTF-32 character, advancing the pointer. This is called when we +know we are in UTF-32 mode. */ + +#define GETCHARINC(c, eptr) \ + c = *((eptr)++); + +/* Get the next character, testing for UTF-32 mode, and advancing the pointer. +This is called when we don't know if we are in UTF-32 mode. */ + +#define GETCHARINCTEST(c, eptr) \ + c = *((eptr)++); + +/* Get the next UTF-32 character, not advancing the pointer, not incrementing +length (since all UTF-32 is of length 1). This is called when we know we are in +UTF-32 mode. */ + +#define GETCHARLEN(c, eptr, len) \ + GETCHAR(c, eptr) + +/* Get the next UTF-32character, testing for UTF-32 mode, not advancing the +pointer, not incrementing the length (since all UTF-32 is of length 1). +This is called when we do not know if we are in UTF-32 mode. */ + +#define GETCHARLENTEST(c, eptr, len) \ + GETCHARTEST(c, eptr) + +/* If the pointer is not at the start of a character, move it back until +it is. This is called only in UTF-32 mode - we don't put a test within the +macro because almost all calls are already within a block of UTF-32 only +code. + +These are all no-ops since all UTF-32 characters fit into one PCRE2_UCHAR. */ + +#define BACKCHAR(eptr) do { } while (0) + +/* Same as above, just in the other direction. */ + +#define FORWARDCHAR(eptr) do { } while (0) +#define FORWARDCHARTEST(eptr,end) do { } while (0) + +/* Same as above, but it allows a fully customizable form. */ + +#define ACROSSCHAR(condition, eptr, action) do { } while (0) + +/* Deposit a character into memory, returning the number of code units. */ + +#define PUTCHAR(c, p) (*p = c, 1) + +#endif /* UTF-32 character handling */ +#endif /* SUPPORT_UNICODE */ + + +/* Mode-dependent macros that have the same definition in all modes. */ + +#define CU2BYTES(x) ((x)*((PCRE2_CODE_UNIT_WIDTH/8))) +#define BYTES2CU(x) ((x)/((PCRE2_CODE_UNIT_WIDTH/8))) +#define PUTINC(a,n,d) PUT(a,n,d), a += LINK_SIZE +#define PUT2INC(a,n,d) PUT2(a,n,d), a += IMM2_SIZE + + +/* ----------------------- HIDDEN STRUCTURES ----------------------------- */ + +/* NOTE: All these structures *must* start with a pcre2_memctl structure. The +code that uses them is simpler because it assumes this. */ + +/* The real general context structure. At present it holds only data for custom +memory control. */ + +typedef struct pcre2_real_general_context { + pcre2_memctl memctl; +} pcre2_real_general_context; + +/* The real compile context structure */ + +typedef struct pcre2_real_compile_context { + pcre2_memctl memctl; + int (*stack_guard)(uint32_t, void *); + void *stack_guard_data; + const uint8_t *tables; + PCRE2_SIZE max_pattern_length; + uint16_t bsr_convention; + uint16_t newline_convention; + uint32_t parens_nest_limit; + uint32_t extra_options; +} pcre2_real_compile_context; + +/* The real match context structure. */ + +typedef struct pcre2_real_match_context { + pcre2_memctl memctl; +#ifdef SUPPORT_JIT + pcre2_jit_callback jit_callback; + void *jit_callback_data; +#endif + int (*callout)(pcre2_callout_block *, void *); + void *callout_data; + int (*substitute_callout)(pcre2_substitute_callout_block *, void *); + void *substitute_callout_data; + PCRE2_SIZE offset_limit; + uint32_t heap_limit; + uint32_t match_limit; + uint32_t depth_limit; +} pcre2_real_match_context; + +/* The real convert context structure. */ + +typedef struct pcre2_real_convert_context { + pcre2_memctl memctl; + uint32_t glob_separator; + uint32_t glob_escape; +} pcre2_real_convert_context; + +/* The real compiled code structure. The type for the blocksize field is +defined specially because it is required in pcre2_serialize_decode() when +copying the size from possibly unaligned memory into a variable of the same +type. Use a macro rather than a typedef to avoid compiler warnings when this +file is included multiple times by pcre2test. LOOKBEHIND_MAX specifies the +largest lookbehind that is supported. (OP_REVERSE in a pattern has a 16-bit +argument in 8-bit and 16-bit modes, so we need no more than a 16-bit field +here.) */ + +#undef CODE_BLOCKSIZE_TYPE +#define CODE_BLOCKSIZE_TYPE size_t + +#undef LOOKBEHIND_MAX +#define LOOKBEHIND_MAX UINT16_MAX + +typedef struct pcre2_real_code { + pcre2_memctl memctl; /* Memory control fields */ + const uint8_t *tables; /* The character tables */ + void *executable_jit; /* Pointer to JIT code */ + uint8_t start_bitmap[32]; /* Bitmap for starting code unit < 256 */ + CODE_BLOCKSIZE_TYPE blocksize; /* Total (bytes) that was malloc-ed */ + uint32_t magic_number; /* Paranoid and endianness check */ + uint32_t compile_options; /* Options passed to pcre2_compile() */ + uint32_t overall_options; /* Options after processing the pattern */ + uint32_t extra_options; /* Taken from compile_context */ + uint32_t flags; /* Various state flags */ + uint32_t limit_heap; /* Limit set in the pattern */ + uint32_t limit_match; /* Limit set in the pattern */ + uint32_t limit_depth; /* Limit set in the pattern */ + uint32_t first_codeunit; /* Starting code unit */ + uint32_t last_codeunit; /* This codeunit must be seen */ + uint16_t bsr_convention; /* What \R matches */ + uint16_t newline_convention; /* What is a newline? */ + uint16_t max_lookbehind; /* Longest lookbehind (characters) */ + uint16_t minlength; /* Minimum length of match */ + uint16_t top_bracket; /* Highest numbered group */ + uint16_t top_backref; /* Highest numbered back reference */ + uint16_t name_entry_size; /* Size (code units) of table entries */ + uint16_t name_count; /* Number of name entries in the table */ +} pcre2_real_code; + +/* The real match data structure. Define ovector as large as it can ever +actually be so that array bound checkers don't grumble. Memory for this +structure is obtained by calling pcre2_match_data_create(), which sets the size +as the offset of ovector plus a pair of elements for each capturable string, so +the size varies from call to call. As the maximum number of capturing +subpatterns is 65535 we must allow for 65536 strings to include the overall +match. (See also the heapframe structure below.) */ + +struct heapframe; /* Forward reference */ + +typedef struct pcre2_real_match_data { + pcre2_memctl memctl; /* Memory control fields */ + const pcre2_real_code *code; /* The pattern used for the match */ + PCRE2_SPTR subject; /* The subject that was matched */ + PCRE2_SPTR mark; /* Pointer to last mark */ + struct heapframe *heapframes; /* Backtracking frames heap memory */ + PCRE2_SIZE heapframes_size; /* Malloc-ed size */ + PCRE2_SIZE leftchar; /* Offset to leftmost code unit */ + PCRE2_SIZE rightchar; /* Offset to rightmost code unit */ + PCRE2_SIZE startchar; /* Offset to starting code unit */ + uint8_t matchedby; /* Type of match (normal, JIT, DFA) */ + uint8_t flags; /* Various flags */ + uint16_t oveccount; /* Number of pairs */ + int rc; /* The return code from the match */ + PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ +} pcre2_real_match_data; + + +/* ----------------------- PRIVATE STRUCTURES ----------------------------- */ + +/* These structures are not needed for pcre2test. */ + +#ifndef PCRE2_PCRE2TEST + +/* Structures for checking for mutual recursion when scanning compiled or +parsed code. */ + +typedef struct recurse_check { + struct recurse_check *prev; + PCRE2_SPTR group; +} recurse_check; + +typedef struct parsed_recurse_check { + struct parsed_recurse_check *prev; + uint32_t *groupptr; +} parsed_recurse_check; + +/* Structure for building a cache when filling in recursion offsets. */ + +typedef struct recurse_cache { + PCRE2_SPTR group; + int groupnumber; +} recurse_cache; + +/* Structure for maintaining a chain of pointers to the currently incomplete +branches, for testing for left recursion while compiling. */ + +typedef struct branch_chain { + struct branch_chain *outer; + PCRE2_UCHAR *current_branch; +} branch_chain; + +/* Structure for building a list of named groups during the first pass of +compiling. */ + +typedef struct named_group { + PCRE2_SPTR name; /* Points to the name in the pattern */ + uint32_t number; /* Group number */ + uint16_t length; /* Length of the name */ + uint16_t isdup; /* TRUE if a duplicate */ +} named_group; + +/* Structure for passing "static" information around between the functions +doing the compiling, so that they are thread-safe. */ + +typedef struct compile_block { + pcre2_real_compile_context *cx; /* Points to the compile context */ + const uint8_t *lcc; /* Points to lower casing table */ + const uint8_t *fcc; /* Points to case-flipping table */ + const uint8_t *cbits; /* Points to character type table */ + const uint8_t *ctypes; /* Points to table of type maps */ + PCRE2_SPTR start_workspace; /* The start of working space */ + PCRE2_SPTR start_code; /* The start of the compiled code */ + PCRE2_SPTR start_pattern; /* The start of the pattern */ + PCRE2_SPTR end_pattern; /* The end of the pattern */ + PCRE2_UCHAR *name_table; /* The name/number table */ + PCRE2_SIZE workspace_size; /* Size of workspace */ + PCRE2_SIZE small_ref_offset[10]; /* Offsets for \1 to \9 */ + PCRE2_SIZE erroroffset; /* Offset of error in pattern */ + uint16_t names_found; /* Number of entries so far */ + uint16_t name_entry_size; /* Size of each entry */ + uint16_t parens_depth; /* Depth of nested parentheses */ + uint16_t assert_depth; /* Depth of nested assertions */ + open_capitem *open_caps; /* Chain of open capture items */ + named_group *named_groups; /* Points to vector in pre-compile */ + uint32_t named_group_list_size; /* Number of entries in the list */ + uint32_t external_options; /* External (initial) options */ + uint32_t external_flags; /* External flag bits to be set */ + uint32_t bracount; /* Count of capturing parentheses */ + uint32_t lastcapture; /* Last capture encountered */ + uint32_t *parsed_pattern; /* Parsed pattern buffer */ + uint32_t *parsed_pattern_end; /* Parsed pattern should not get here */ + uint32_t *groupinfo; /* Group info vector */ + uint32_t top_backref; /* Maximum back reference */ + uint32_t backref_map; /* Bitmap of low back refs */ + uint32_t nltype; /* Newline type */ + uint32_t nllen; /* Newline string length */ + uint32_t class_range_start; /* Overall class range start */ + uint32_t class_range_end; /* Overall class range end */ + PCRE2_UCHAR nl[4]; /* Newline string when fixed length */ + uint32_t req_varyopt; /* "After variable item" flag for reqbyte */ + int max_lookbehind; /* Maximum lookbehind (characters) */ + BOOL had_accept; /* (*ACCEPT) encountered */ + BOOL had_pruneorskip; /* (*PRUNE) or (*SKIP) encountered */ + BOOL had_recurse; /* Had a recursion or subroutine call */ + BOOL dupnames; /* Duplicate names exist */ +} compile_block; + +/* Structure for keeping the properties of the in-memory stack used +by the JIT matcher. */ + +typedef struct pcre2_real_jit_stack { + pcre2_memctl memctl; + void* stack; +} pcre2_real_jit_stack; + +/* Structure for items in a linked list that represents an explicit recursive +call within the pattern when running pcre2_dfa_match(). */ + +typedef struct dfa_recursion_info { + struct dfa_recursion_info *prevrec; + PCRE2_SPTR subject_position; + uint32_t group_num; +} dfa_recursion_info; + +/* Structure for "stack" frames that are used for remembering backtracking +positions during matching. As these are used in a vector, with the ovector item +being extended, the size of the structure must be a multiple of PCRE2_SIZE. The +only way to check this at compile time is to force an error by generating an +array with a negative size. By putting this in a typedef (which is never used), +we don't generate any code when all is well. */ + +typedef struct heapframe { + + /* The first set of fields are variables that have to be preserved over calls + to RRMATCH(), but which do not need to be copied to new frames. */ + + PCRE2_SPTR ecode; /* The current position in the pattern */ + PCRE2_SPTR temp_sptr[2]; /* Used for short-term PCRE_SPTR values */ + PCRE2_SIZE length; /* Used for character, string, or code lengths */ + PCRE2_SIZE back_frame; /* Amount to subtract on RRETURN */ + PCRE2_SIZE temp_size; /* Used for short-term PCRE2_SIZE values */ + uint32_t rdepth; /* "Recursion" depth */ + uint32_t group_frame_type; /* Type information for group frames */ + uint32_t temp_32[4]; /* Used for short-term 32-bit or BOOL values */ + uint8_t return_id; /* Where to go on in internal "return" */ + uint8_t op; /* Processing opcode */ + + /* At this point, the structure is 16-bit aligned. On most architectures + the alignment requirement for a pointer will ensure that the eptr field below + is 32-bit or 64-bit aligned. However, on m68k it is fine to have a pointer + that is 16-bit aligned. We must therefore ensure that what comes between here + and eptr is an odd multiple of 16 bits so as to get back into 32-bit + alignment. This happens naturally when PCRE2_UCHAR is 8 bits wide, but needs + fudges in the other cases. In the 32-bit case the padding comes first so that + the occu field itself is 32-bit aligned. Without the padding, this structure + is no longer a multiple of PCRE2_SIZE on m68k, and the check below fails. */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 + PCRE2_UCHAR occu[6]; /* Used for other case code units */ +#elif PCRE2_CODE_UNIT_WIDTH == 16 + PCRE2_UCHAR occu[2]; /* Used for other case code units */ + uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ +#else + uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ + PCRE2_UCHAR occu[1]; /* Used for other case code units */ +#endif + + /* The rest have to be copied from the previous frame whenever a new frame + becomes current. The final field is specified as a large vector so that + runtime array bound checks don't catch references to it. However, for any + specific call to pcre2_match() the memory allocated for each frame structure + allows for exactly the right size ovector for the number of capturing + parentheses. (See also the comment for pcre2_real_match_data above.) */ + + PCRE2_SPTR eptr; /* MUST BE FIRST */ + PCRE2_SPTR start_match; /* Can be adjusted by \K */ + PCRE2_SPTR mark; /* Most recent mark on the success path */ + uint32_t current_recurse; /* Current (deepest) recursion number */ + uint32_t capture_last; /* Most recent capture */ + PCRE2_SIZE last_group_offset; /* Saved offset to most recent group frame */ + PCRE2_SIZE offset_top; /* Offset after highest capture */ + PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ +} heapframe; + +/* This typedef is a check that the size of the heapframe structure is a +multiple of PCRE2_SIZE. See various comments above. */ + +typedef char check_heapframe_size[ + ((sizeof(heapframe) % sizeof(PCRE2_SIZE)) == 0)? (+1):(-1)]; + +/* Structure for computing the alignment of heapframe. */ + +typedef struct heapframe_align { + char unalign; /* Completely unalign the current offset */ + heapframe frame; /* Offset is its alignment */ +} heapframe_align; + +/* This define is the minimum alignment required for a heapframe, in bytes. */ + +#define HEAPFRAME_ALIGNMENT offsetof(heapframe_align, frame) + +/* Structure for passing "static" information around between the functions +doing traditional NFA matching (pcre2_match() and friends). */ + +typedef struct match_block { + pcre2_memctl memctl; /* For general use */ + PCRE2_SIZE heap_limit; /* As it says */ + uint32_t match_limit; /* As it says */ + uint32_t match_limit_depth; /* As it says */ + uint32_t match_call_count; /* Number of times a new frame is created */ + BOOL hitend; /* Hit the end of the subject at some point */ + BOOL hasthen; /* Pattern contains (*THEN) */ + BOOL allowemptypartial; /* Allow empty hard partial */ + const uint8_t *lcc; /* Points to lower casing table */ + const uint8_t *fcc; /* Points to case-flipping table */ + const uint8_t *ctypes; /* Points to table of type maps */ + PCRE2_SIZE start_offset; /* The start offset value */ + PCRE2_SIZE end_offset_top; /* Highwater mark at end of match */ + uint16_t partial; /* PARTIAL options */ + uint16_t bsr_convention; /* \R interpretation */ + uint16_t name_count; /* Number of names in name table */ + uint16_t name_entry_size; /* Size of entry in names table */ + PCRE2_SPTR name_table; /* Table of group names */ + PCRE2_SPTR start_code; /* For use when recursing */ + PCRE2_SPTR start_subject; /* Start of the subject string */ + PCRE2_SPTR check_subject; /* Where UTF-checked from */ + PCRE2_SPTR end_subject; /* End of the subject string */ + PCRE2_SPTR end_match_ptr; /* Subject position at end match */ + PCRE2_SPTR start_used_ptr; /* Earliest consulted character */ + PCRE2_SPTR last_used_ptr; /* Latest consulted character */ + PCRE2_SPTR mark; /* Mark pointer to pass back on success */ + PCRE2_SPTR nomatch_mark; /* Mark pointer to pass back on failure */ + PCRE2_SPTR verb_ecode_ptr; /* For passing back info */ + PCRE2_SPTR verb_skip_ptr; /* For passing back a (*SKIP) name */ + uint32_t verb_current_recurse; /* Current recurse when (*VERB) happens */ + uint32_t moptions; /* Match options */ + uint32_t poptions; /* Pattern options */ + uint32_t skip_arg_count; /* For counting SKIP_ARGs */ + uint32_t ignore_skip_arg; /* For re-run when SKIP arg name not found */ + uint32_t nltype; /* Newline type */ + uint32_t nllen; /* Newline string length */ + PCRE2_UCHAR nl[4]; /* Newline string when fixed */ + pcre2_callout_block *cb; /* Points to a callout block */ + void *callout_data; /* To pass back to callouts */ + int (*callout)(pcre2_callout_block *,void *); /* Callout function or NULL */ +} match_block; + +/* A similar structure is used for the same purpose by the DFA matching +functions. */ + +typedef struct dfa_match_block { + pcre2_memctl memctl; /* For general use */ + PCRE2_SPTR start_code; /* Start of the compiled pattern */ + PCRE2_SPTR start_subject ; /* Start of the subject string */ + PCRE2_SPTR end_subject; /* End of subject string */ + PCRE2_SPTR start_used_ptr; /* Earliest consulted character */ + PCRE2_SPTR last_used_ptr; /* Latest consulted character */ + const uint8_t *tables; /* Character tables */ + PCRE2_SIZE start_offset; /* The start offset value */ + PCRE2_SIZE heap_limit; /* As it says */ + PCRE2_SIZE heap_used; /* As it says */ + uint32_t match_limit; /* As it says */ + uint32_t match_limit_depth; /* As it says */ + uint32_t match_call_count; /* Number of calls of internal function */ + uint32_t moptions; /* Match options */ + uint32_t poptions; /* Pattern options */ + uint32_t nltype; /* Newline type */ + uint32_t nllen; /* Newline string length */ + BOOL allowemptypartial; /* Allow empty hard partial */ + PCRE2_UCHAR nl[4]; /* Newline string when fixed */ + uint16_t bsr_convention; /* \R interpretation */ + pcre2_callout_block *cb; /* Points to a callout block */ + void *callout_data; /* To pass back to callouts */ + int (*callout)(pcre2_callout_block *,void *); /* Callout function or NULL */ + dfa_recursion_info *recursive; /* Linked list of recursion data */ +} dfa_match_block; + +#endif /* PCRE2_PCRE2TEST */ + +/* End of pcre2_intmodedep.h */ diff --git a/include/php/ext/pcre/pcre2lib/pcre2_jit_neon_inc.h b/include/php/ext/pcre/pcre2lib/pcre2_jit_neon_inc.h new file mode 100644 index 0000000..165602e --- /dev/null +++ b/include/php/ext/pcre/pcre2lib/pcre2_jit_neon_inc.h @@ -0,0 +1,349 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + This module by Zoltan Herczeg and Sebastian Pop + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +# if defined(FFCS) +# if defined(FF_UTF) +# define FF_FUN ffcs_utf +# else +# define FF_FUN ffcs +# endif + +# elif defined(FFCS_2) +# if defined(FF_UTF) +# define FF_FUN ffcs_2_utf +# else +# define FF_FUN ffcs_2 +# endif + +# elif defined(FFCS_MASK) +# if defined(FF_UTF) +# define FF_FUN ffcs_mask_utf +# else +# define FF_FUN ffcs_mask +# endif + +# elif defined(FFCPS_0) +# if defined (FF_UTF) +# define FF_FUN ffcps_0_utf +# else +# define FF_FUN ffcps_0 +# endif + +# elif defined (FFCPS_1) +# if defined (FF_UTF) +# define FF_FUN ffcps_1_utf +# else +# define FF_FUN ffcps_1 +# endif + +# elif defined (FFCPS_DEFAULT) +# if defined (FF_UTF) +# define FF_FUN ffcps_default_utf +# else +# define FF_FUN ffcps_default +# endif +# endif + +static sljit_u8* SLJIT_FUNC FF_FUN(sljit_u8 *str_end, sljit_u8 *str_ptr, sljit_uw offs1, sljit_uw offs2, sljit_uw chars) +#undef FF_FUN +{ +quad_word qw; +int_char ic; + +SLJIT_UNUSED_ARG(offs1); +SLJIT_UNUSED_ARG(offs2); + +ic.x = chars; + +#if defined(FFCS) +sljit_u8 c1 = ic.c.c1; +vect_t vc1 = VDUPQ(c1); + +#elif defined(FFCS_2) +sljit_u8 c1 = ic.c.c1; +vect_t vc1 = VDUPQ(c1); +sljit_u8 c2 = ic.c.c2; +vect_t vc2 = VDUPQ(c2); + +#elif defined(FFCS_MASK) +sljit_u8 c1 = ic.c.c1; +vect_t vc1 = VDUPQ(c1); +sljit_u8 mask = ic.c.c2; +vect_t vmask = VDUPQ(mask); +#endif + +#if defined(FFCPS) +compare_type compare1_type = compare_match1; +compare_type compare2_type = compare_match1; +vect_t cmp1a, cmp1b, cmp2a, cmp2b; +const sljit_u32 diff = IN_UCHARS(offs1 - offs2); +PCRE2_UCHAR char1a = ic.c.c1; +PCRE2_UCHAR char2a = ic.c.c3; + +# ifdef FFCPS_CHAR1A2A +cmp1a = VDUPQ(char1a); +cmp2a = VDUPQ(char2a); +cmp1b = VDUPQ(0); /* to avoid errors on older compilers -Werror=maybe-uninitialized */ +cmp2b = VDUPQ(0); /* to avoid errors on older compilers -Werror=maybe-uninitialized */ +# else +PCRE2_UCHAR char1b = ic.c.c2; +PCRE2_UCHAR char2b = ic.c.c4; +if (char1a == char1b) + { + cmp1a = VDUPQ(char1a); + cmp1b = VDUPQ(0); /* to avoid errors on older compilers -Werror=maybe-uninitialized */ + } +else + { + sljit_u32 bit1 = char1a ^ char1b; + if (is_powerof2(bit1)) + { + compare1_type = compare_match1i; + cmp1a = VDUPQ(char1a | bit1); + cmp1b = VDUPQ(bit1); + } + else + { + compare1_type = compare_match2; + cmp1a = VDUPQ(char1a); + cmp1b = VDUPQ(char1b); + } + } + +if (char2a == char2b) + { + cmp2a = VDUPQ(char2a); + cmp2b = VDUPQ(0); /* to avoid errors on older compilers -Werror=maybe-uninitialized */ + } +else + { + sljit_u32 bit2 = char2a ^ char2b; + if (is_powerof2(bit2)) + { + compare2_type = compare_match1i; + cmp2a = VDUPQ(char2a | bit2); + cmp2b = VDUPQ(bit2); + } + else + { + compare2_type = compare_match2; + cmp2a = VDUPQ(char2a); + cmp2b = VDUPQ(char2b); + } + } +# endif + +str_ptr += IN_UCHARS(offs1); +#endif + +#if PCRE2_CODE_UNIT_WIDTH != 8 +vect_t char_mask = VDUPQ(0xff); +#endif + +#if defined(FF_UTF) +restart:; +#endif + +#if defined(FFCPS) +if (str_ptr >= str_end) + return NULL; +sljit_u8 *p1 = str_ptr - diff; +#endif +sljit_s32 align_offset = ((uint64_t)str_ptr & 0xf); +str_ptr = (sljit_u8 *) ((uint64_t)str_ptr & ~0xf); +vect_t data = VLD1Q(str_ptr); +#if PCRE2_CODE_UNIT_WIDTH != 8 +data = VANDQ(data, char_mask); +#endif + +#if defined(FFCS) +vect_t eq = VCEQQ(data, vc1); + +#elif defined(FFCS_2) +vect_t eq1 = VCEQQ(data, vc1); +vect_t eq2 = VCEQQ(data, vc2); +vect_t eq = VORRQ(eq1, eq2); + +#elif defined(FFCS_MASK) +vect_t eq = VORRQ(data, vmask); +eq = VCEQQ(eq, vc1); + +#elif defined(FFCPS) +# if defined(FFCPS_DIFF1) +vect_t prev_data = data; +# endif + +vect_t data2; +if (p1 < str_ptr) + { + data2 = VLD1Q(str_ptr - diff); +#if PCRE2_CODE_UNIT_WIDTH != 8 + data2 = VANDQ(data2, char_mask); +#endif + } +else + data2 = shift_left_n_lanes(data, offs1 - offs2); + +if (compare1_type == compare_match1) + data = VCEQQ(data, cmp1a); +else + data = fast_forward_char_pair_compare(compare1_type, data, cmp1a, cmp1b); + +if (compare2_type == compare_match1) + data2 = VCEQQ(data2, cmp2a); +else + data2 = fast_forward_char_pair_compare(compare2_type, data2, cmp2a, cmp2b); + +vect_t eq = VANDQ(data, data2); +#endif + +VST1Q(qw.mem, eq); +/* Ignore matches before the first STR_PTR. */ +if (align_offset < 8) + { + qw.dw[0] >>= align_offset * 8; + if (qw.dw[0]) + { + str_ptr += align_offset + __builtin_ctzll(qw.dw[0]) / 8; + goto match; + } + if (qw.dw[1]) + { + str_ptr += 8 + __builtin_ctzll(qw.dw[1]) / 8; + goto match; + } + } +else + { + qw.dw[1] >>= (align_offset - 8) * 8; + if (qw.dw[1]) + { + str_ptr += align_offset + __builtin_ctzll(qw.dw[1]) / 8; + goto match; + } + } +str_ptr += 16; + +while (str_ptr < str_end) + { + vect_t orig_data = VLD1Q(str_ptr); +#if PCRE2_CODE_UNIT_WIDTH != 8 + orig_data = VANDQ(orig_data, char_mask); +#endif + data = orig_data; + +#if defined(FFCS) + eq = VCEQQ(data, vc1); + +#elif defined(FFCS_2) + eq1 = VCEQQ(data, vc1); + eq2 = VCEQQ(data, vc2); + eq = VORRQ(eq1, eq2); + +#elif defined(FFCS_MASK) + eq = VORRQ(data, vmask); + eq = VCEQQ(eq, vc1); +#endif + +#if defined(FFCPS) +# if defined (FFCPS_DIFF1) + data2 = VEXTQ(prev_data, data, VECTOR_FACTOR - 1); +# else + data2 = VLD1Q(str_ptr - diff); +# if PCRE2_CODE_UNIT_WIDTH != 8 + data2 = VANDQ(data2, char_mask); +# endif +# endif + +# ifdef FFCPS_CHAR1A2A + data = VCEQQ(data, cmp1a); + data2 = VCEQQ(data2, cmp2a); +# else + if (compare1_type == compare_match1) + data = VCEQQ(data, cmp1a); + else + data = fast_forward_char_pair_compare(compare1_type, data, cmp1a, cmp1b); + if (compare2_type == compare_match1) + data2 = VCEQQ(data2, cmp2a); + else + data2 = fast_forward_char_pair_compare(compare2_type, data2, cmp2a, cmp2b); +# endif + + eq = VANDQ(data, data2); +#endif + + VST1Q(qw.mem, eq); + if (qw.dw[0]) + str_ptr += __builtin_ctzll(qw.dw[0]) / 8; + else if (qw.dw[1]) + str_ptr += 8 + __builtin_ctzll(qw.dw[1]) / 8; + else { + str_ptr += 16; +#if defined (FFCPS_DIFF1) + prev_data = orig_data; +#endif + continue; + } + +match:; + if (str_ptr >= str_end) + /* Failed match. */ + return NULL; + +#if defined(FF_UTF) + if (utf_continue((PCRE2_SPTR)str_ptr - offs1)) + { + /* Not a match. */ + str_ptr += IN_UCHARS(1); + goto restart; + } +#endif + + /* Match. */ +#if defined (FFCPS) + str_ptr -= IN_UCHARS(offs1); +#endif + return str_ptr; + } + +/* Failed match. */ +return NULL; +} diff --git a/include/php/ext/pcre/pcre2lib/pcre2_jit_simd_inc.h b/include/php/ext/pcre/pcre2lib/pcre2_jit_simd_inc.h new file mode 100644 index 0000000..1a5ce4e --- /dev/null +++ b/include/php/ext/pcre/pcre2lib/pcre2_jit_simd_inc.h @@ -0,0 +1,1858 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + This module by Zoltan Herczeg + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +#if !(defined SUPPORT_VALGRIND) + +#if ((defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \ + || (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X)) + +typedef enum { + vector_compare_match1, + vector_compare_match1i, + vector_compare_match2, +} vector_compare_type; + +static SLJIT_INLINE sljit_u32 max_fast_forward_char_pair_offset(void) +{ +#if PCRE2_CODE_UNIT_WIDTH == 8 +return 15; +#elif PCRE2_CODE_UNIT_WIDTH == 16 +return 7; +#elif PCRE2_CODE_UNIT_WIDTH == 32 +return 3; +#else +#error "Unsupported unit width" +#endif +} + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +static struct sljit_jump *jump_if_utf_char_start(struct sljit_compiler *compiler, sljit_s32 reg) +{ +#if PCRE2_CODE_UNIT_WIDTH == 8 +OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xc0); +return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0x80); +#elif PCRE2_CODE_UNIT_WIDTH == 16 +OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xfc00); +return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00); +#else +#error "Unknown code width" +#endif +} +#endif + +#endif /* SLJIT_CONFIG_X86 || SLJIT_CONFIG_S390X */ + +#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) + +static sljit_s32 character_to_int32(PCRE2_UCHAR chr) +{ +sljit_u32 value = chr; +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define SSE2_COMPARE_TYPE_INDEX 0 +return (sljit_s32)((value << 24) | (value << 16) | (value << 8) | value); +#elif PCRE2_CODE_UNIT_WIDTH == 16 +#define SSE2_COMPARE_TYPE_INDEX 1 +return (sljit_s32)((value << 16) | value); +#elif PCRE2_CODE_UNIT_WIDTH == 32 +#define SSE2_COMPARE_TYPE_INDEX 2 +return (sljit_s32)(value); +#else +#error "Unsupported unit width" +#endif +} + +static void load_from_mem_sse2(struct sljit_compiler *compiler, sljit_s32 dst_xmm_reg, sljit_s32 src_general_reg, sljit_s8 offset) +{ +sljit_u8 instruction[5]; + +SLJIT_ASSERT(dst_xmm_reg < 8); +SLJIT_ASSERT(src_general_reg < 8); + +/* MOVDQA xmm1, xmm2/m128 */ +instruction[0] = ((sljit_u8)offset & 0xf) == 0 ? 0x66 : 0xf3; +instruction[1] = 0x0f; +instruction[2] = 0x6f; + +if (offset == 0) + { + instruction[3] = (dst_xmm_reg << 3) | src_general_reg; + sljit_emit_op_custom(compiler, instruction, 4); + return; + } + +instruction[3] = 0x40 | (dst_xmm_reg << 3) | src_general_reg; +instruction[4] = (sljit_u8)offset; +sljit_emit_op_custom(compiler, instruction, 5); +} + +static void fast_forward_char_pair_sse2_compare(struct sljit_compiler *compiler, vector_compare_type compare_type, + int step, sljit_s32 dst_ind, sljit_s32 cmp1_ind, sljit_s32 cmp2_ind, sljit_s32 tmp_ind) +{ +sljit_u8 instruction[4]; +instruction[0] = 0x66; +instruction[1] = 0x0f; + +SLJIT_ASSERT(step >= 0 && step <= 3); + +if (compare_type != vector_compare_match2) + { + if (step == 0) + { + if (compare_type == vector_compare_match1i) + { + /* POR xmm1, xmm2/m128 */ + /* instruction[0] = 0x66; */ + /* instruction[1] = 0x0f; */ + instruction[2] = 0xeb; + instruction[3] = 0xc0 | (dst_ind << 3) | cmp2_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + return; + } + + if (step != 2) + return; + + /* PCMPEQB/W/D xmm1, xmm2/m128 */ + /* instruction[0] = 0x66; */ + /* instruction[1] = 0x0f; */ + instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX; + instruction[3] = 0xc0 | (dst_ind << 3) | cmp1_ind; + sljit_emit_op_custom(compiler, instruction, 4); + return; + } + +switch (step) + { + case 0: + /* MOVDQA xmm1, xmm2/m128 */ + /* instruction[0] = 0x66; */ + /* instruction[1] = 0x0f; */ + instruction[2] = 0x6f; + instruction[3] = 0xc0 | (tmp_ind << 3) | dst_ind; + sljit_emit_op_custom(compiler, instruction, 4); + return; + + case 1: + /* PCMPEQB/W/D xmm1, xmm2/m128 */ + /* instruction[0] = 0x66; */ + /* instruction[1] = 0x0f; */ + instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX; + instruction[3] = 0xc0 | (dst_ind << 3) | cmp1_ind; + sljit_emit_op_custom(compiler, instruction, 4); + return; + + case 2: + /* PCMPEQB/W/D xmm1, xmm2/m128 */ + /* instruction[0] = 0x66; */ + /* instruction[1] = 0x0f; */ + instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX; + instruction[3] = 0xc0 | (tmp_ind << 3) | cmp2_ind; + sljit_emit_op_custom(compiler, instruction, 4); + return; + + case 3: + /* POR xmm1, xmm2/m128 */ + /* instruction[0] = 0x66; */ + /* instruction[1] = 0x0f; */ + instruction[2] = 0xeb; + instruction[3] = 0xc0 | (dst_ind << 3) | tmp_ind; + sljit_emit_op_custom(compiler, instruction, 4); + return; + } +} + +#define JIT_HAS_FAST_FORWARD_CHAR_SIMD (sljit_has_cpu_feature(SLJIT_HAS_SSE2)) + +static void fast_forward_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset) +{ +DEFINE_COMPILER; +sljit_u8 instruction[8]; +struct sljit_label *start; +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +struct sljit_label *restart; +#endif +struct sljit_jump *quit; +struct sljit_jump *partial_quit[2]; +vector_compare_type compare_type = vector_compare_match1; +sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1); +sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR); +sljit_s32 data_ind = 0; +sljit_s32 tmp_ind = 1; +sljit_s32 cmp1_ind = 2; +sljit_s32 cmp2_ind = 3; +sljit_u32 bit = 0; +int i; + +SLJIT_UNUSED_ARG(offset); + +if (char1 != char2) + { + bit = char1 ^ char2; + compare_type = vector_compare_match1i; + + if (!is_powerof2(bit)) + { + bit = 0; + compare_type = vector_compare_match2; + } + } + +partial_quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); +if (common->mode == PCRE2_JIT_COMPLETE) + add_jump(compiler, &common->failed_match, partial_quit[0]); + +/* First part (unaligned start) */ + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1 | bit)); + +SLJIT_ASSERT(tmp1_reg_ind < 8); + +/* MOVD xmm, r/m32 */ +instruction[0] = 0x66; +instruction[1] = 0x0f; +instruction[2] = 0x6e; +instruction[3] = 0xc0 | (cmp1_ind << 3) | tmp1_reg_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +if (char1 != char2) + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(bit != 0 ? bit : char2)); + + /* MOVD xmm, r/m32 */ + instruction[3] = 0xc0 | (cmp2_ind << 3) | tmp1_reg_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + +OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0); + +/* PSHUFD xmm1, xmm2/m128, imm8 */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0x70; +instruction[3] = 0xc0 | (cmp1_ind << 3) | cmp1_ind; +instruction[4] = 0; +sljit_emit_op_custom(compiler, instruction, 5); + +if (char1 != char2) + { + /* PSHUFD xmm1, xmm2/m128, imm8 */ + instruction[3] = 0xc0 | (cmp2_ind << 3) | cmp2_ind; + sljit_emit_op_custom(compiler, instruction, 5); + } + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +restart = LABEL(); +#endif +OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf); +OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf); + +load_from_mem_sse2(compiler, data_ind, str_ptr_reg_ind, 0); +for (i = 0; i < 4; i++) + fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + +/* PMOVMSKB reg, xmm */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0xd7; +instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | data_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); +OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, TMP2, 0); + +quit = CMP(SLJIT_NOT_ZERO, TMP1, 0, SLJIT_IMM, 0); + +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0); + +/* Second part (aligned) */ +start = LABEL(); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16); + +partial_quit[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); +if (common->mode == PCRE2_JIT_COMPLETE) + add_jump(compiler, &common->failed_match, partial_quit[1]); + +load_from_mem_sse2(compiler, data_ind, str_ptr_reg_ind, 0); +for (i = 0; i < 4; i++) + fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + +/* PMOVMSKB reg, xmm */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0xd7; +instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | data_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +CMPTO(SLJIT_ZERO, TMP1, 0, SLJIT_IMM, 0, start); + +JUMPHERE(quit); + +/* BSF r32, r/m32 */ +instruction[0] = 0x0f; +instruction[1] = 0xbc; +instruction[2] = 0xc0 | (tmp1_reg_ind << 3) | tmp1_reg_ind; +sljit_emit_op_custom(compiler, instruction, 3); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); + +if (common->mode != PCRE2_JIT_COMPLETE) + { + JUMPHERE(partial_quit[0]); + JUMPHERE(partial_quit[1]); + OP2U(SLJIT_SUB | SLJIT_SET_GREATER, STR_PTR, 0, STR_END, 0); + CMOV(SLJIT_GREATER, STR_PTR, STR_END, 0); + } +else + add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +if (common->utf && offset > 0) + { + SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE); + + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset)); + + quit = jump_if_utf_char_start(compiler, TMP1); + + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0); + JUMPTO(SLJIT_JUMP, restart); + + JUMPHERE(quit); + } +#endif +} + +#define JIT_HAS_FAST_REQUESTED_CHAR_SIMD (sljit_has_cpu_feature(SLJIT_HAS_SSE2)) + +static jump_list *fast_requested_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2) +{ +DEFINE_COMPILER; +sljit_u8 instruction[8]; +struct sljit_label *start; +struct sljit_jump *quit; +jump_list *not_found = NULL; +vector_compare_type compare_type = vector_compare_match1; +sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1); +sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR); +sljit_s32 data_ind = 0; +sljit_s32 tmp_ind = 1; +sljit_s32 cmp1_ind = 2; +sljit_s32 cmp2_ind = 3; +sljit_u32 bit = 0; +int i; + +if (char1 != char2) + { + bit = char1 ^ char2; + compare_type = vector_compare_match1i; + + if (!is_powerof2(bit)) + { + bit = 0; + compare_type = vector_compare_match2; + } + } + +add_jump(compiler, ¬_found, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_END, 0)); +OP1(SLJIT_MOV, TMP2, 0, TMP1, 0); +OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); + +/* First part (unaligned start) */ + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1 | bit)); + +SLJIT_ASSERT(tmp1_reg_ind < 8); + +/* MOVD xmm, r/m32 */ +instruction[0] = 0x66; +instruction[1] = 0x0f; +instruction[2] = 0x6e; +instruction[3] = 0xc0 | (cmp1_ind << 3) | tmp1_reg_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +if (char1 != char2) + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(bit != 0 ? bit : char2)); + + /* MOVD xmm, r/m32 */ + instruction[3] = 0xc0 | (cmp2_ind << 3) | tmp1_reg_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + +OP1(SLJIT_MOV, STR_PTR, 0, TMP2, 0); + +/* PSHUFD xmm1, xmm2/m128, imm8 */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0x70; +instruction[3] = 0xc0 | (cmp1_ind << 3) | cmp1_ind; +instruction[4] = 0; +sljit_emit_op_custom(compiler, instruction, 5); + +if (char1 != char2) + { + /* PSHUFD xmm1, xmm2/m128, imm8 */ + instruction[3] = 0xc0 | (cmp2_ind << 3) | cmp2_ind; + sljit_emit_op_custom(compiler, instruction, 5); + } + +OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf); +OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf); + +load_from_mem_sse2(compiler, data_ind, str_ptr_reg_ind, 0); +for (i = 0; i < 4; i++) + fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + +/* PMOVMSKB reg, xmm */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0xd7; +instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | data_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); +OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, TMP2, 0); + +quit = CMP(SLJIT_NOT_ZERO, TMP1, 0, SLJIT_IMM, 0); + +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0); + +/* Second part (aligned) */ +start = LABEL(); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16); + +add_jump(compiler, ¬_found, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +load_from_mem_sse2(compiler, data_ind, str_ptr_reg_ind, 0); +for (i = 0; i < 4; i++) + fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + +/* PMOVMSKB reg, xmm */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0xd7; +instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | data_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +CMPTO(SLJIT_ZERO, TMP1, 0, SLJIT_IMM, 0, start); + +JUMPHERE(quit); + +/* BSF r32, r/m32 */ +instruction[0] = 0x0f; +instruction[1] = 0xbc; +instruction[2] = 0xc0 | (tmp1_reg_ind << 3) | tmp1_reg_ind; +sljit_emit_op_custom(compiler, instruction, 3); + +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, STR_PTR, 0); +add_jump(compiler, ¬_found, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_END, 0)); + +OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); +return not_found; +} + +#ifndef _WIN64 + +#define JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD (sljit_has_cpu_feature(SLJIT_HAS_SSE2)) + +static void fast_forward_char_pair_simd(compiler_common *common, sljit_s32 offs1, + PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b) +{ +DEFINE_COMPILER; +sljit_u8 instruction[8]; +vector_compare_type compare1_type = vector_compare_match1; +vector_compare_type compare2_type = vector_compare_match1; +sljit_u32 bit1 = 0; +sljit_u32 bit2 = 0; +sljit_u32 diff = IN_UCHARS(offs1 - offs2); +sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1); +sljit_s32 tmp2_reg_ind = sljit_get_register_index(TMP2); +sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR); +sljit_s32 data1_ind = 0; +sljit_s32 data2_ind = 1; +sljit_s32 tmp1_ind = 2; +sljit_s32 tmp2_ind = 3; +sljit_s32 cmp1a_ind = 4; +sljit_s32 cmp1b_ind = 5; +sljit_s32 cmp2a_ind = 6; +sljit_s32 cmp2b_ind = 7; +struct sljit_label *start; +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +struct sljit_label *restart; +#endif +struct sljit_jump *jump[2]; +int i; + +SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2); +SLJIT_ASSERT(diff <= IN_UCHARS(max_fast_forward_char_pair_offset())); +SLJIT_ASSERT(tmp1_reg_ind < 8 && tmp2_reg_ind == 1); + +/* Initialize. */ +if (common->match_end_ptr != 0) + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); + OP1(SLJIT_MOV, TMP3, 0, STR_END, 0); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(offs1 + 1)); + + OP2U(SLJIT_SUB | SLJIT_SET_LESS, TMP1, 0, STR_END, 0); + CMOV(SLJIT_LESS, STR_END, TMP1, 0); + } + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1)); +add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +/* MOVD xmm, r/m32 */ +instruction[0] = 0x66; +instruction[1] = 0x0f; +instruction[2] = 0x6e; + +if (char1a == char1b) + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a)); +else + { + bit1 = char1a ^ char1b; + if (is_powerof2(bit1)) + { + compare1_type = vector_compare_match1i; + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a | bit1)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit1)); + } + else + { + compare1_type = vector_compare_match2; + bit1 = 0; + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char1b)); + } + } + +instruction[3] = 0xc0 | (cmp1a_ind << 3) | tmp1_reg_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +if (char1a != char1b) + { + instruction[3] = 0xc0 | (cmp1b_ind << 3) | tmp2_reg_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + +if (char2a == char2b) + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a)); +else + { + bit2 = char2a ^ char2b; + if (is_powerof2(bit2)) + { + compare2_type = vector_compare_match1i; + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a | bit2)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit2)); + } + else + { + compare2_type = vector_compare_match2; + bit2 = 0; + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char2b)); + } + } + +instruction[3] = 0xc0 | (cmp2a_ind << 3) | tmp1_reg_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +if (char2a != char2b) + { + instruction[3] = 0xc0 | (cmp2b_ind << 3) | tmp2_reg_ind; + sljit_emit_op_custom(compiler, instruction, 4); + } + +/* PSHUFD xmm1, xmm2/m128, imm8 */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0x70; +instruction[4] = 0; + +instruction[3] = 0xc0 | (cmp1a_ind << 3) | cmp1a_ind; +sljit_emit_op_custom(compiler, instruction, 5); + +if (char1a != char1b) + { + instruction[3] = 0xc0 | (cmp1b_ind << 3) | cmp1b_ind; + sljit_emit_op_custom(compiler, instruction, 5); + } + +instruction[3] = 0xc0 | (cmp2a_ind << 3) | cmp2a_ind; +sljit_emit_op_custom(compiler, instruction, 5); + +if (char2a != char2b) + { + instruction[3] = 0xc0 | (cmp2b_ind << 3) | cmp2b_ind; + sljit_emit_op_custom(compiler, instruction, 5); + } + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +restart = LABEL(); +#endif + +OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, diff); +OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0); +OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf); + +load_from_mem_sse2(compiler, data1_ind, str_ptr_reg_ind, 0); + +jump[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_PTR, 0); + +load_from_mem_sse2(compiler, data2_ind, str_ptr_reg_ind, -(sljit_s8)diff); +jump[1] = JUMP(SLJIT_JUMP); + +JUMPHERE(jump[0]); + +/* MOVDQA xmm1, xmm2/m128 */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0x6f; +instruction[3] = 0xc0 | (data2_ind << 3) | data1_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +/* PSLLDQ xmm1, imm8 */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0x73; +instruction[3] = 0xc0 | (7 << 3) | data2_ind; +instruction[4] = diff; +sljit_emit_op_custom(compiler, instruction, 5); + +JUMPHERE(jump[1]); + +OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf); + +for (i = 0; i < 4; i++) + { + fast_forward_char_pair_sse2_compare(compiler, compare2_type, i, data2_ind, cmp2a_ind, cmp2b_ind, tmp2_ind); + fast_forward_char_pair_sse2_compare(compiler, compare1_type, i, data1_ind, cmp1a_ind, cmp1b_ind, tmp1_ind); + } + +/* PAND xmm1, xmm2/m128 */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0xdb; +instruction[3] = 0xc0 | (data1_ind << 3) | data2_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +/* PMOVMSKB reg, xmm */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0xd7; +instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | 0; +sljit_emit_op_custom(compiler, instruction, 4); + +/* Ignore matches before the first STR_PTR. */ +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); +OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, TMP2, 0); + +jump[0] = CMP(SLJIT_NOT_ZERO, TMP1, 0, SLJIT_IMM, 0); + +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0); + +/* Main loop. */ +start = LABEL(); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16); +add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +load_from_mem_sse2(compiler, data1_ind, str_ptr_reg_ind, 0); +load_from_mem_sse2(compiler, data2_ind, str_ptr_reg_ind, -(sljit_s8)diff); + +for (i = 0; i < 4; i++) + { + fast_forward_char_pair_sse2_compare(compiler, compare1_type, i, data1_ind, cmp1a_ind, cmp1b_ind, tmp2_ind); + fast_forward_char_pair_sse2_compare(compiler, compare2_type, i, data2_ind, cmp2a_ind, cmp2b_ind, tmp1_ind); + } + +/* PAND xmm1, xmm2/m128 */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0xdb; +instruction[3] = 0xc0 | (data1_ind << 3) | data2_ind; +sljit_emit_op_custom(compiler, instruction, 4); + +/* PMOVMSKB reg, xmm */ +/* instruction[0] = 0x66; */ +/* instruction[1] = 0x0f; */ +instruction[2] = 0xd7; +instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | 0; +sljit_emit_op_custom(compiler, instruction, 4); + +CMPTO(SLJIT_ZERO, TMP1, 0, SLJIT_IMM, 0, start); + +JUMPHERE(jump[0]); + +/* BSF r32, r/m32 */ +instruction[0] = 0x0f; +instruction[1] = 0xbc; +instruction[2] = 0xc0 | (tmp1_reg_ind << 3) | tmp1_reg_ind; +sljit_emit_op_custom(compiler, instruction, 3); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); + +add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +if (common->utf) + { + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offs1)); + + jump[0] = jump_if_utf_char_start(compiler, TMP1); + + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, restart); + + add_jump(compiler, &common->failed_match, JUMP(SLJIT_JUMP)); + + JUMPHERE(jump[0]); + } +#endif + +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1)); + +if (common->match_end_ptr != 0) + OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); +} + +#endif /* !_WIN64 */ + +#undef SSE2_COMPARE_TYPE_INDEX + +#endif /* SLJIT_CONFIG_X86 */ + +#if (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64 && (defined __ARM_NEON || defined __ARM_NEON__)) + +#include + +typedef union { + unsigned int x; + struct { unsigned char c1, c2, c3, c4; } c; +} int_char; + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +static SLJIT_INLINE int utf_continue(PCRE2_SPTR s) +{ +#if PCRE2_CODE_UNIT_WIDTH == 8 +return (*s & 0xc0) == 0x80; +#elif PCRE2_CODE_UNIT_WIDTH == 16 +return (*s & 0xfc00) == 0xdc00; +#else +#error "Unknown code width" +#endif +} +#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 +# define VECTOR_FACTOR 16 +# define vect_t uint8x16_t +# define VLD1Q(X) vld1q_u8((sljit_u8 *)(X)) +# define VCEQQ vceqq_u8 +# define VORRQ vorrq_u8 +# define VST1Q vst1q_u8 +# define VDUPQ vdupq_n_u8 +# define VEXTQ vextq_u8 +# define VANDQ vandq_u8 +typedef union { + uint8_t mem[16]; + uint64_t dw[2]; +} quad_word; +#elif PCRE2_CODE_UNIT_WIDTH == 16 +# define VECTOR_FACTOR 8 +# define vect_t uint16x8_t +# define VLD1Q(X) vld1q_u16((sljit_u16 *)(X)) +# define VCEQQ vceqq_u16 +# define VORRQ vorrq_u16 +# define VST1Q vst1q_u16 +# define VDUPQ vdupq_n_u16 +# define VEXTQ vextq_u16 +# define VANDQ vandq_u16 +typedef union { + uint16_t mem[8]; + uint64_t dw[2]; +} quad_word; +#else +# define VECTOR_FACTOR 4 +# define vect_t uint32x4_t +# define VLD1Q(X) vld1q_u32((sljit_u32 *)(X)) +# define VCEQQ vceqq_u32 +# define VORRQ vorrq_u32 +# define VST1Q vst1q_u32 +# define VDUPQ vdupq_n_u32 +# define VEXTQ vextq_u32 +# define VANDQ vandq_u32 +typedef union { + uint32_t mem[4]; + uint64_t dw[2]; +} quad_word; +#endif + +#define FFCS +#include "pcre2_jit_neon_inc.h" +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +# define FF_UTF +# include "pcre2_jit_neon_inc.h" +# undef FF_UTF +#endif +#undef FFCS + +#define FFCS_2 +#include "pcre2_jit_neon_inc.h" +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +# define FF_UTF +# include "pcre2_jit_neon_inc.h" +# undef FF_UTF +#endif +#undef FFCS_2 + +#define FFCS_MASK +#include "pcre2_jit_neon_inc.h" +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +# define FF_UTF +# include "pcre2_jit_neon_inc.h" +# undef FF_UTF +#endif +#undef FFCS_MASK + +#define JIT_HAS_FAST_FORWARD_CHAR_SIMD 1 + +static void fast_forward_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset) +{ +DEFINE_COMPILER; +int_char ic; +struct sljit_jump *partial_quit; +/* Save temporary registers. */ +OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STR_PTR, 0); +OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP3, 0); + +/* Prepare function arguments */ +OP1(SLJIT_MOV, SLJIT_R0, 0, STR_END, 0); +OP1(SLJIT_MOV, SLJIT_R1, 0, STR_PTR, 0); +OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_IMM, offset); + +if (char1 == char2) + { + ic.c.c1 = char1; + ic.c.c2 = char2; + OP1(SLJIT_MOV, SLJIT_R4, 0, SLJIT_IMM, ic.x); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + if (common->utf && offset > 0) + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs_utf)); + else + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs)); +#else + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs)); +#endif + } +else + { + PCRE2_UCHAR mask = char1 ^ char2; + if (is_powerof2(mask)) + { + ic.c.c1 = char1 | mask; + ic.c.c2 = mask; + OP1(SLJIT_MOV, SLJIT_R4, 0, SLJIT_IMM, ic.x); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + if (common->utf && offset > 0) + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs_mask_utf)); + else + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs_mask)); +#else + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs_mask)); +#endif + } + else + { + ic.c.c1 = char1; + ic.c.c2 = char2; + OP1(SLJIT_MOV, SLJIT_R4, 0, SLJIT_IMM, ic.x); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + if (common->utf && offset > 0) + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs_2_utf)); + else + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs_2)); +#else + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcs_2)); +#endif + } + } +/* Restore registers. */ +OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); +OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1); + +/* Check return value. */ +partial_quit = CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0); +if (common->mode == PCRE2_JIT_COMPLETE) + add_jump(compiler, &common->failed_match, partial_quit); + +/* Fast forward STR_PTR to the result of memchr. */ +OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0); + +if (common->mode != PCRE2_JIT_COMPLETE) + JUMPHERE(partial_quit); +} + +typedef enum { + compare_match1, + compare_match1i, + compare_match2, +} compare_type; + +static inline vect_t fast_forward_char_pair_compare(compare_type ctype, vect_t dst, vect_t cmp1, vect_t cmp2) +{ +if (ctype == compare_match2) + { + vect_t tmp = dst; + dst = VCEQQ(dst, cmp1); + tmp = VCEQQ(tmp, cmp2); + dst = VORRQ(dst, tmp); + return dst; + } + +if (ctype == compare_match1i) + dst = VORRQ(dst, cmp2); +dst = VCEQQ(dst, cmp1); +return dst; +} + +static SLJIT_INLINE sljit_u32 max_fast_forward_char_pair_offset(void) +{ +#if PCRE2_CODE_UNIT_WIDTH == 8 +return 15; +#elif PCRE2_CODE_UNIT_WIDTH == 16 +return 7; +#elif PCRE2_CODE_UNIT_WIDTH == 32 +return 3; +#else +#error "Unsupported unit width" +#endif +} + +/* ARM doesn't have a shift left across lanes. */ +static SLJIT_INLINE vect_t shift_left_n_lanes(vect_t a, sljit_u8 n) +{ +vect_t zero = VDUPQ(0); +SLJIT_ASSERT(0 < n && n < VECTOR_FACTOR); +/* VEXTQ takes an immediate as last argument. */ +#define C(X) case X: return VEXTQ(zero, a, VECTOR_FACTOR - X); +switch (n) + { + C(1); C(2); C(3); +#if PCRE2_CODE_UNIT_WIDTH != 32 + C(4); C(5); C(6); C(7); +# if PCRE2_CODE_UNIT_WIDTH != 16 + C(8); C(9); C(10); C(11); C(12); C(13); C(14); C(15); +# endif +#endif + default: + /* Based on the ASSERT(0 < n && n < VECTOR_FACTOR) above, this won't + happen. The return is still here for compilers to not warn. */ + return a; + } +} + +#define FFCPS +#define FFCPS_DIFF1 +#define FFCPS_CHAR1A2A + +#define FFCPS_0 +#include "pcre2_jit_neon_inc.h" +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +# define FF_UTF +# include "pcre2_jit_neon_inc.h" +# undef FF_UTF +#endif +#undef FFCPS_0 + +#undef FFCPS_CHAR1A2A + +#define FFCPS_1 +#include "pcre2_jit_neon_inc.h" +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +# define FF_UTF +# include "pcre2_jit_neon_inc.h" +# undef FF_UTF +#endif +#undef FFCPS_1 + +#undef FFCPS_DIFF1 + +#define FFCPS_DEFAULT +#include "pcre2_jit_neon_inc.h" +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +# define FF_UTF +# include "pcre2_jit_neon_inc.h" +# undef FF_UTF +#endif +#undef FFCPS + +#define JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD 1 + +static void fast_forward_char_pair_simd(compiler_common *common, sljit_s32 offs1, + PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b) +{ +DEFINE_COMPILER; +sljit_u32 diff = IN_UCHARS(offs1 - offs2); +struct sljit_jump *partial_quit; +int_char ic; +SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2); +SLJIT_ASSERT(diff <= IN_UCHARS(max_fast_forward_char_pair_offset())); +SLJIT_ASSERT(compiler->scratches == 5); + +/* Save temporary register STR_PTR. */ +OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STR_PTR, 0); + +/* Prepare arguments for the function call. */ +if (common->match_end_ptr == 0) + OP1(SLJIT_MOV, SLJIT_R0, 0, STR_END, 0); +else + { + OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); + OP2(SLJIT_ADD, SLJIT_R0, 0, SLJIT_R0, 0, SLJIT_IMM, IN_UCHARS(offs1 + 1)); + + OP2U(SLJIT_SUB | SLJIT_SET_LESS, STR_END, 0, SLJIT_R0, 0); + CMOV(SLJIT_LESS, SLJIT_R0, STR_END, 0); + } + +OP1(SLJIT_MOV, SLJIT_R1, 0, STR_PTR, 0); +OP1(SLJIT_MOV_S32, SLJIT_R2, 0, SLJIT_IMM, offs1); +OP1(SLJIT_MOV_S32, SLJIT_R3, 0, SLJIT_IMM, offs2); +ic.c.c1 = char1a; +ic.c.c2 = char1b; +ic.c.c3 = char2a; +ic.c.c4 = char2b; +OP1(SLJIT_MOV_U32, SLJIT_R4, 0, SLJIT_IMM, ic.x); + +if (diff == 1) { + if (char1a == char1b && char2a == char2b) { +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + if (common->utf) + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcps_0_utf)); + else +#endif + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcps_0)); + } else { +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + if (common->utf) + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcps_1_utf)); + else +#endif + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcps_1)); + } +} else { +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + if (common->utf) + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcps_default_utf)); + else +#endif + sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS4(W, W, W, W, W), + SLJIT_IMM, SLJIT_FUNC_ADDR(ffcps_default)); +} + +/* Restore STR_PTR register. */ +OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); + +/* Check return value. */ +partial_quit = CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0); +add_jump(compiler, &common->failed_match, partial_quit); + +/* Fast forward STR_PTR to the result of memchr. */ +OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0); + +JUMPHERE(partial_quit); +} + +#endif /* SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64 */ + +#if (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X) + +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define VECTOR_ELEMENT_SIZE 0 +#elif PCRE2_CODE_UNIT_WIDTH == 16 +#define VECTOR_ELEMENT_SIZE 1 +#elif PCRE2_CODE_UNIT_WIDTH == 32 +#define VECTOR_ELEMENT_SIZE 2 +#else +#error "Unsupported unit width" +#endif + +static void load_from_mem_vector(struct sljit_compiler *compiler, BOOL vlbb, sljit_s32 dst_vreg, + sljit_s32 base_reg, sljit_s32 index_reg) +{ +sljit_u16 instruction[3]; + +instruction[0] = (sljit_u16)(0xe700 | (dst_vreg << 4) | index_reg); +instruction[1] = (sljit_u16)(base_reg << 12); +instruction[2] = (sljit_u16)((0x8 << 8) | (vlbb ? 0x07 : 0x06)); + +sljit_emit_op_custom(compiler, instruction, 6); +} + +#if PCRE2_CODE_UNIT_WIDTH == 32 + +static void replicate_imm_vector(struct sljit_compiler *compiler, int step, sljit_s32 dst_vreg, + PCRE2_UCHAR chr, sljit_s32 tmp_general_reg) +{ +sljit_u16 instruction[3]; + +SLJIT_ASSERT(step >= 0 && step <= 1); + +if (chr < 0x7fff) + { + if (step == 1) + return; + + /* VREPI */ + instruction[0] = (sljit_u16)(0xe700 | (dst_vreg << 4)); + instruction[1] = (sljit_u16)chr; + instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); + sljit_emit_op_custom(compiler, instruction, 6); + return; + } + +if (step == 0) + { + OP1(SLJIT_MOV, tmp_general_reg, 0, SLJIT_IMM, chr); + + /* VLVG */ + instruction[0] = (sljit_u16)(0xe700 | (dst_vreg << 4) | sljit_get_register_index(tmp_general_reg)); + instruction[1] = 0; + instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x22); + sljit_emit_op_custom(compiler, instruction, 6); + return; + } + +/* VREP */ +instruction[0] = (sljit_u16)(0xe700 | (dst_vreg << 4) | dst_vreg); +instruction[1] = 0; +instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xc << 8) | 0x4d); +sljit_emit_op_custom(compiler, instruction, 6); +} + +#endif + +static void fast_forward_char_pair_sse2_compare(struct sljit_compiler *compiler, vector_compare_type compare_type, + int step, sljit_s32 dst_ind, sljit_s32 cmp1_ind, sljit_s32 cmp2_ind, sljit_s32 tmp_ind) +{ +sljit_u16 instruction[3]; + +SLJIT_ASSERT(step >= 0 && step <= 2); + +if (step == 1) + { + /* VCEQ */ + instruction[0] = (sljit_u16)(0xe700 | (dst_ind << 4) | dst_ind); + instruction[1] = (sljit_u16)(cmp1_ind << 12); + instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0xf8); + sljit_emit_op_custom(compiler, instruction, 6); + return; + } + +if (compare_type != vector_compare_match2) + { + if (step == 0 && compare_type == vector_compare_match1i) + { + /* VO */ + instruction[0] = (sljit_u16)(0xe700 | (dst_ind << 4) | dst_ind); + instruction[1] = (sljit_u16)(cmp2_ind << 12); + instruction[2] = (sljit_u16)((0xe << 8) | 0x6a); + sljit_emit_op_custom(compiler, instruction, 6); + } + return; + } + +switch (step) + { + case 0: + /* VCEQ */ + instruction[0] = (sljit_u16)(0xe700 | (tmp_ind << 4) | dst_ind); + instruction[1] = (sljit_u16)(cmp2_ind << 12); + instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0xf8); + sljit_emit_op_custom(compiler, instruction, 6); + return; + + case 2: + /* VO */ + instruction[0] = (sljit_u16)(0xe700 | (dst_ind << 4) | dst_ind); + instruction[1] = (sljit_u16)(tmp_ind << 12); + instruction[2] = (sljit_u16)((0xe << 8) | 0x6a); + sljit_emit_op_custom(compiler, instruction, 6); + return; + } +} + +#define JIT_HAS_FAST_FORWARD_CHAR_SIMD 1 + +static void fast_forward_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset) +{ +DEFINE_COMPILER; +sljit_u16 instruction[3]; +struct sljit_label *start; +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +struct sljit_label *restart; +#endif +struct sljit_jump *quit; +struct sljit_jump *partial_quit[2]; +vector_compare_type compare_type = vector_compare_match1; +sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1); +sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR); +sljit_s32 data_ind = 0; +sljit_s32 tmp_ind = 1; +sljit_s32 cmp1_ind = 2; +sljit_s32 cmp2_ind = 3; +sljit_s32 zero_ind = 4; +sljit_u32 bit = 0; +int i; + +SLJIT_UNUSED_ARG(offset); + +if (char1 != char2) + { + bit = char1 ^ char2; + compare_type = vector_compare_match1i; + + if (!is_powerof2(bit)) + { + bit = 0; + compare_type = vector_compare_match2; + } + } + +partial_quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); +if (common->mode == PCRE2_JIT_COMPLETE) + add_jump(compiler, &common->failed_match, partial_quit[0]); + +/* First part (unaligned start) */ + +OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, 16); + +#if PCRE2_CODE_UNIT_WIDTH != 32 + +/* VREPI */ +instruction[0] = (sljit_u16)(0xe700 | (cmp1_ind << 4)); +instruction[1] = (sljit_u16)(char1 | bit); +instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); +sljit_emit_op_custom(compiler, instruction, 6); + +if (char1 != char2) + { + /* VREPI */ + instruction[0] = (sljit_u16)(0xe700 | (cmp2_ind << 4)); + instruction[1] = (sljit_u16)(bit != 0 ? bit : char2); + /* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */ + sljit_emit_op_custom(compiler, instruction, 6); + } + +#else /* PCRE2_CODE_UNIT_WIDTH == 32 */ + +for (int i = 0; i < 2; i++) + { + replicate_imm_vector(compiler, i, cmp1_ind, char1 | bit, TMP1); + + if (char1 != char2) + replicate_imm_vector(compiler, i, cmp2_ind, bit != 0 ? bit : char2, TMP1); + } + +#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */ + +if (compare_type == vector_compare_match2) + { + /* VREPI */ + instruction[0] = (sljit_u16)(0xe700 | (zero_ind << 4)); + instruction[1] = 0; + instruction[2] = (sljit_u16)((0x8 << 8) | 0x45); + sljit_emit_op_custom(compiler, instruction, 6); + } + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +restart = LABEL(); +#endif + +load_from_mem_vector(compiler, TRUE, data_ind, str_ptr_reg_ind, 0); +OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, ~15); + +if (compare_type != vector_compare_match2) + { + if (compare_type == vector_compare_match1i) + fast_forward_char_pair_sse2_compare(compiler, compare_type, 0, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + + /* VFEE */ + instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind); + instruction[1] = (sljit_u16)((cmp1_ind << 12) | (1 << 4)); + instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0x80); + sljit_emit_op_custom(compiler, instruction, 6); + } +else + { + for (i = 0; i < 3; i++) + fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + + /* VFENE */ + instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind); + instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4)); + instruction[2] = (sljit_u16)((0xe << 8) | 0x81); + sljit_emit_op_custom(compiler, instruction, 6); + } + +/* VLGVB */ +instruction[0] = (sljit_u16)(0xe700 | (tmp1_reg_ind << 4) | data_ind); +instruction[1] = 7; +instruction[2] = (sljit_u16)((0x4 << 8) | 0x21); +sljit_emit_op_custom(compiler, instruction, 6); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); +quit = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0); + +OP2(SLJIT_SUB, STR_PTR, 0, TMP2, 0, SLJIT_IMM, 16); + +/* Second part (aligned) */ +start = LABEL(); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16); + +partial_quit[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); +if (common->mode == PCRE2_JIT_COMPLETE) + add_jump(compiler, &common->failed_match, partial_quit[1]); + +load_from_mem_vector(compiler, TRUE, data_ind, str_ptr_reg_ind, 0); + +if (compare_type != vector_compare_match2) + { + if (compare_type == vector_compare_match1i) + fast_forward_char_pair_sse2_compare(compiler, compare_type, 0, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + + /* VFEE */ + instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind); + instruction[1] = (sljit_u16)((cmp1_ind << 12) | (1 << 4)); + instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0x80); + sljit_emit_op_custom(compiler, instruction, 6); + } +else + { + for (i = 0; i < 3; i++) + fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + + /* VFENE */ + instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind); + instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4)); + instruction[2] = (sljit_u16)((0xe << 8) | 0x81); + sljit_emit_op_custom(compiler, instruction, 6); + } + +sljit_set_current_flags(compiler, SLJIT_SET_OVERFLOW); +JUMPTO(SLJIT_OVERFLOW, start); + +/* VLGVB */ +instruction[0] = (sljit_u16)(0xe700 | (tmp1_reg_ind << 4) | data_ind); +instruction[1] = 7; +instruction[2] = (sljit_u16)((0x4 << 8) | 0x21); +sljit_emit_op_custom(compiler, instruction, 6); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); + +JUMPHERE(quit); + +if (common->mode != PCRE2_JIT_COMPLETE) + { + JUMPHERE(partial_quit[0]); + JUMPHERE(partial_quit[1]); + OP2U(SLJIT_SUB | SLJIT_SET_GREATER, STR_PTR, 0, STR_END, 0); + CMOV(SLJIT_GREATER, STR_PTR, STR_END, 0); + } +else + add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +if (common->utf && offset > 0) + { + SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE); + + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offset)); + + quit = jump_if_utf_char_start(compiler, TMP1); + + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + + OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, 16); + JUMPTO(SLJIT_JUMP, restart); + + JUMPHERE(quit); + } +#endif +} + +#define JIT_HAS_FAST_REQUESTED_CHAR_SIMD 1 + +static jump_list *fast_requested_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2) +{ +DEFINE_COMPILER; +sljit_u16 instruction[3]; +struct sljit_label *start; +struct sljit_jump *quit; +jump_list *not_found = NULL; +vector_compare_type compare_type = vector_compare_match1; +sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1); +sljit_s32 tmp3_reg_ind = sljit_get_register_index(TMP3); +sljit_s32 data_ind = 0; +sljit_s32 tmp_ind = 1; +sljit_s32 cmp1_ind = 2; +sljit_s32 cmp2_ind = 3; +sljit_s32 zero_ind = 4; +sljit_u32 bit = 0; +int i; + +if (char1 != char2) + { + bit = char1 ^ char2; + compare_type = vector_compare_match1i; + + if (!is_powerof2(bit)) + { + bit = 0; + compare_type = vector_compare_match2; + } + } + +add_jump(compiler, ¬_found, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_END, 0)); + +/* First part (unaligned start) */ + +OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, 16); + +#if PCRE2_CODE_UNIT_WIDTH != 32 + +/* VREPI */ +instruction[0] = (sljit_u16)(0xe700 | (cmp1_ind << 4)); +instruction[1] = (sljit_u16)(char1 | bit); +instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); +sljit_emit_op_custom(compiler, instruction, 6); + +if (char1 != char2) + { + /* VREPI */ + instruction[0] = (sljit_u16)(0xe700 | (cmp2_ind << 4)); + instruction[1] = (sljit_u16)(bit != 0 ? bit : char2); + /* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */ + sljit_emit_op_custom(compiler, instruction, 6); + } + +#else /* PCRE2_CODE_UNIT_WIDTH == 32 */ + +for (int i = 0; i < 2; i++) + { + replicate_imm_vector(compiler, i, cmp1_ind, char1 | bit, TMP3); + + if (char1 != char2) + replicate_imm_vector(compiler, i, cmp2_ind, bit != 0 ? bit : char2, TMP3); + } + +#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */ + +if (compare_type == vector_compare_match2) + { + /* VREPI */ + instruction[0] = (sljit_u16)(0xe700 | (zero_ind << 4)); + instruction[1] = 0; + instruction[2] = (sljit_u16)((0x8 << 8) | 0x45); + sljit_emit_op_custom(compiler, instruction, 6); + } + +load_from_mem_vector(compiler, TRUE, data_ind, tmp1_reg_ind, 0); +OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, ~15); + +if (compare_type != vector_compare_match2) + { + if (compare_type == vector_compare_match1i) + fast_forward_char_pair_sse2_compare(compiler, compare_type, 0, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + + /* VFEE */ + instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind); + instruction[1] = (sljit_u16)((cmp1_ind << 12) | (1 << 4)); + instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0x80); + sljit_emit_op_custom(compiler, instruction, 6); + } +else + { + for (i = 0; i < 3; i++) + fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + + /* VFENE */ + instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind); + instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4)); + instruction[2] = (sljit_u16)((0xe << 8) | 0x81); + sljit_emit_op_custom(compiler, instruction, 6); + } + +/* VLGVB */ +instruction[0] = (sljit_u16)(0xe700 | (tmp3_reg_ind << 4) | data_ind); +instruction[1] = 7; +instruction[2] = (sljit_u16)((0x4 << 8) | 0x21); +sljit_emit_op_custom(compiler, instruction, 6); + +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP3, 0); +quit = CMP(SLJIT_LESS, TMP1, 0, TMP2, 0); + +OP2(SLJIT_SUB, TMP1, 0, TMP2, 0, SLJIT_IMM, 16); + +/* Second part (aligned) */ +start = LABEL(); + +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 16); + +add_jump(compiler, ¬_found, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_END, 0)); + +load_from_mem_vector(compiler, TRUE, data_ind, tmp1_reg_ind, 0); + +if (compare_type != vector_compare_match2) + { + if (compare_type == vector_compare_match1i) + fast_forward_char_pair_sse2_compare(compiler, compare_type, 0, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + + /* VFEE */ + instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind); + instruction[1] = (sljit_u16)((cmp1_ind << 12) | (1 << 4)); + instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0xe << 8) | 0x80); + sljit_emit_op_custom(compiler, instruction, 6); + } +else + { + for (i = 0; i < 3; i++) + fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind); + + /* VFENE */ + instruction[0] = (sljit_u16)(0xe700 | (data_ind << 4) | data_ind); + instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4)); + instruction[2] = (sljit_u16)((0xe << 8) | 0x81); + sljit_emit_op_custom(compiler, instruction, 6); + } + +sljit_set_current_flags(compiler, SLJIT_SET_OVERFLOW); +JUMPTO(SLJIT_OVERFLOW, start); + +/* VLGVB */ +instruction[0] = (sljit_u16)(0xe700 | (tmp3_reg_ind << 4) | data_ind); +instruction[1] = 7; +instruction[2] = (sljit_u16)((0x4 << 8) | 0x21); +sljit_emit_op_custom(compiler, instruction, 6); + +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP3, 0); + +JUMPHERE(quit); +add_jump(compiler, ¬_found, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_END, 0)); + +return not_found; +} + +#define JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD 1 + +static void fast_forward_char_pair_simd(compiler_common *common, sljit_s32 offs1, + PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b) +{ +DEFINE_COMPILER; +sljit_u16 instruction[3]; +struct sljit_label *start; +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +struct sljit_label *restart; +#endif +struct sljit_jump *quit; +struct sljit_jump *jump[2]; +vector_compare_type compare1_type = vector_compare_match1; +vector_compare_type compare2_type = vector_compare_match1; +sljit_u32 bit1 = 0; +sljit_u32 bit2 = 0; +sljit_s32 diff = IN_UCHARS(offs2 - offs1); +sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1); +sljit_s32 tmp2_reg_ind = sljit_get_register_index(TMP2); +sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR); +sljit_s32 data1_ind = 0; +sljit_s32 data2_ind = 1; +sljit_s32 tmp1_ind = 2; +sljit_s32 tmp2_ind = 3; +sljit_s32 cmp1a_ind = 4; +sljit_s32 cmp1b_ind = 5; +sljit_s32 cmp2a_ind = 6; +sljit_s32 cmp2b_ind = 7; +sljit_s32 zero_ind = 8; +int i; + +SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2); +SLJIT_ASSERT(-diff <= (sljit_s32)IN_UCHARS(max_fast_forward_char_pair_offset())); +SLJIT_ASSERT(tmp1_reg_ind != 0 && tmp2_reg_ind != 0); + +if (char1a != char1b) + { + bit1 = char1a ^ char1b; + compare1_type = vector_compare_match1i; + + if (!is_powerof2(bit1)) + { + bit1 = 0; + compare1_type = vector_compare_match2; + } + } + +if (char2a != char2b) + { + bit2 = char2a ^ char2b; + compare2_type = vector_compare_match1i; + + if (!is_powerof2(bit2)) + { + bit2 = 0; + compare2_type = vector_compare_match2; + } + } + +/* Initialize. */ +if (common->match_end_ptr != 0) + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); + OP1(SLJIT_MOV, TMP3, 0, STR_END, 0); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(offs1 + 1)); + + OP2U(SLJIT_SUB | SLJIT_SET_LESS, TMP1, 0, STR_END, 0); + CMOV(SLJIT_LESS, STR_END, TMP1, 0); + } + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1)); +add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); +OP2(SLJIT_AND, TMP2, 0, STR_PTR, 0, SLJIT_IMM, ~15); + +#if PCRE2_CODE_UNIT_WIDTH != 32 + +OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, -diff); + +/* VREPI */ +instruction[0] = (sljit_u16)(0xe700 | (cmp1a_ind << 4)); +instruction[1] = (sljit_u16)(char1a | bit1); +instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); +sljit_emit_op_custom(compiler, instruction, 6); + +if (char1a != char1b) + { + /* VREPI */ + instruction[0] = (sljit_u16)(0xe700 | (cmp1b_ind << 4)); + instruction[1] = (sljit_u16)(bit1 != 0 ? bit1 : char1b); + /* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */ + sljit_emit_op_custom(compiler, instruction, 6); + } + +/* VREPI */ +instruction[0] = (sljit_u16)(0xe700 | (cmp2a_ind << 4)); +instruction[1] = (sljit_u16)(char2a | bit2); +/* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */ +sljit_emit_op_custom(compiler, instruction, 6); + +if (char2a != char2b) + { + /* VREPI */ + instruction[0] = (sljit_u16)(0xe700 | (cmp2b_ind << 4)); + instruction[1] = (sljit_u16)(bit2 != 0 ? bit2 : char2b); + /* instruction[2] = (sljit_u16)((VECTOR_ELEMENT_SIZE << 12) | (0x8 << 8) | 0x45); */ + sljit_emit_op_custom(compiler, instruction, 6); + } + +#else /* PCRE2_CODE_UNIT_WIDTH == 32 */ + +for (int i = 0; i < 2; i++) + { + replicate_imm_vector(compiler, i, cmp1a_ind, char1a | bit1, TMP1); + + if (char1a != char1b) + replicate_imm_vector(compiler, i, cmp1b_ind, bit1 != 0 ? bit1 : char1b, TMP1); + + replicate_imm_vector(compiler, i, cmp2a_ind, char2a | bit2, TMP1); + + if (char2a != char2b) + replicate_imm_vector(compiler, i, cmp2b_ind, bit2 != 0 ? bit2 : char2b, TMP1); + } + +OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, -diff); + +#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */ + +/* VREPI */ +instruction[0] = (sljit_u16)(0xe700 | (zero_ind << 4)); +instruction[1] = 0; +instruction[2] = (sljit_u16)((0x8 << 8) | 0x45); +sljit_emit_op_custom(compiler, instruction, 6); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +restart = LABEL(); +#endif + +jump[0] = CMP(SLJIT_LESS, TMP1, 0, TMP2, 0); +load_from_mem_vector(compiler, TRUE, data2_ind, tmp1_reg_ind, 0); +jump[1] = JUMP(SLJIT_JUMP); +JUMPHERE(jump[0]); +load_from_mem_vector(compiler, FALSE, data2_ind, tmp1_reg_ind, 0); +JUMPHERE(jump[1]); + +load_from_mem_vector(compiler, TRUE, data1_ind, str_ptr_reg_ind, 0); +OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 16); + +for (i = 0; i < 3; i++) + { + fast_forward_char_pair_sse2_compare(compiler, compare1_type, i, data1_ind, cmp1a_ind, cmp1b_ind, tmp1_ind); + fast_forward_char_pair_sse2_compare(compiler, compare2_type, i, data2_ind, cmp2a_ind, cmp2b_ind, tmp2_ind); + } + +/* VN */ +instruction[0] = (sljit_u16)(0xe700 | (data1_ind << 4) | data1_ind); +instruction[1] = (sljit_u16)(data2_ind << 12); +instruction[2] = (sljit_u16)((0xe << 8) | 0x68); +sljit_emit_op_custom(compiler, instruction, 6); + +/* VFENE */ +instruction[0] = (sljit_u16)(0xe700 | (data1_ind << 4) | data1_ind); +instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4)); +instruction[2] = (sljit_u16)((0xe << 8) | 0x81); +sljit_emit_op_custom(compiler, instruction, 6); + +/* VLGVB */ +instruction[0] = (sljit_u16)(0xe700 | (tmp1_reg_ind << 4) | data1_ind); +instruction[1] = 7; +instruction[2] = (sljit_u16)((0x4 << 8) | 0x21); +sljit_emit_op_custom(compiler, instruction, 6); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); +quit = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0); + +OP2(SLJIT_SUB, STR_PTR, 0, TMP2, 0, SLJIT_IMM, 16); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, diff); + +/* Main loop. */ +start = LABEL(); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16); +add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +load_from_mem_vector(compiler, FALSE, data1_ind, str_ptr_reg_ind, 0); +load_from_mem_vector(compiler, FALSE, data2_ind, str_ptr_reg_ind, tmp1_reg_ind); + +for (i = 0; i < 3; i++) + { + fast_forward_char_pair_sse2_compare(compiler, compare1_type, i, data1_ind, cmp1a_ind, cmp1b_ind, tmp1_ind); + fast_forward_char_pair_sse2_compare(compiler, compare2_type, i, data2_ind, cmp2a_ind, cmp2b_ind, tmp2_ind); + } + +/* VN */ +instruction[0] = (sljit_u16)(0xe700 | (data1_ind << 4) | data1_ind); +instruction[1] = (sljit_u16)(data2_ind << 12); +instruction[2] = (sljit_u16)((0xe << 8) | 0x68); +sljit_emit_op_custom(compiler, instruction, 6); + +/* VFENE */ +instruction[0] = (sljit_u16)(0xe700 | (data1_ind << 4) | data1_ind); +instruction[1] = (sljit_u16)((zero_ind << 12) | (1 << 4)); +instruction[2] = (sljit_u16)((0xe << 8) | 0x81); +sljit_emit_op_custom(compiler, instruction, 6); + +sljit_set_current_flags(compiler, SLJIT_SET_OVERFLOW); +JUMPTO(SLJIT_OVERFLOW, start); + +/* VLGVB */ +instruction[0] = (sljit_u16)(0xe700 | (tmp2_reg_ind << 4) | data1_ind); +instruction[1] = 7; +instruction[2] = (sljit_u16)((0x4 << 8) | 0x21); +sljit_emit_op_custom(compiler, instruction, 6); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); + +JUMPHERE(quit); + +add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +if (common->utf) + { + SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE); + + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offs1)); + + quit = jump_if_utf_char_start(compiler, TMP1); + + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + + /* TMP1 contains diff. */ + OP2(SLJIT_AND, TMP2, 0, STR_PTR, 0, SLJIT_IMM, ~15); + OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, -diff); + JUMPTO(SLJIT_JUMP, restart); + + JUMPHERE(quit); + } +#endif + +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1)); + +if (common->match_end_ptr != 0) + OP1(SLJIT_MOV, STR_END, 0, TMP3, 0); +} + +#endif /* SLJIT_CONFIG_S390X */ + +#endif /* !SUPPORT_VALGRIND */ diff --git a/include/php/ext/pcre/pcre2lib/pcre2_ucp.h b/include/php/ext/pcre/pcre2lib/pcre2_ucp.h new file mode 100644 index 0000000..2822389 --- /dev/null +++ b/include/php/ext/pcre/pcre2lib/pcre2_ucp.h @@ -0,0 +1,394 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2022 University of Cambridge + +This module is auto-generated from Unicode data files. DO NOT EDIT MANUALLY! +Instead, modify the maint/GenerateUcpHeader.py script and run it to generate +a new version of this code. + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +#ifndef PCRE2_UCP_H_IDEMPOTENT_GUARD +#define PCRE2_UCP_H_IDEMPOTENT_GUARD + +/* This file contains definitions of the Unicode property values that are +returned by the UCD access macros and used throughout PCRE2. + +IMPORTANT: The specific values of the first two enums (general and particular +character categories) are assumed by the table called catposstab in the file +pcre2_auto_possess.c. They are unlikely to change, but should be checked after +an update. */ + +/* These are the general character categories. */ + +enum { + ucp_C, + ucp_L, + ucp_M, + ucp_N, + ucp_P, + ucp_S, + ucp_Z, +}; + +/* These are the particular character categories. */ + +enum { + ucp_Cc, /* Control */ + ucp_Cf, /* Format */ + ucp_Cn, /* Unassigned */ + ucp_Co, /* Private use */ + ucp_Cs, /* Surrogate */ + ucp_Ll, /* Lower case letter */ + ucp_Lm, /* Modifier letter */ + ucp_Lo, /* Other letter */ + ucp_Lt, /* Title case letter */ + ucp_Lu, /* Upper case letter */ + ucp_Mc, /* Spacing mark */ + ucp_Me, /* Enclosing mark */ + ucp_Mn, /* Non-spacing mark */ + ucp_Nd, /* Decimal number */ + ucp_Nl, /* Letter number */ + ucp_No, /* Other number */ + ucp_Pc, /* Connector punctuation */ + ucp_Pd, /* Dash punctuation */ + ucp_Pe, /* Close punctuation */ + ucp_Pf, /* Final punctuation */ + ucp_Pi, /* Initial punctuation */ + ucp_Po, /* Other punctuation */ + ucp_Ps, /* Open punctuation */ + ucp_Sc, /* Currency symbol */ + ucp_Sk, /* Modifier symbol */ + ucp_Sm, /* Mathematical symbol */ + ucp_So, /* Other symbol */ + ucp_Zl, /* Line separator */ + ucp_Zp, /* Paragraph separator */ + ucp_Zs, /* Space separator */ +}; + +/* These are Boolean properties. */ + +enum { + ucp_ASCII, + ucp_ASCII_Hex_Digit, + ucp_Alphabetic, + ucp_Bidi_Control, + ucp_Bidi_Mirrored, + ucp_Case_Ignorable, + ucp_Cased, + ucp_Changes_When_Casefolded, + ucp_Changes_When_Casemapped, + ucp_Changes_When_Lowercased, + ucp_Changes_When_Titlecased, + ucp_Changes_When_Uppercased, + ucp_Dash, + ucp_Default_Ignorable_Code_Point, + ucp_Deprecated, + ucp_Diacritic, + ucp_Emoji, + ucp_Emoji_Component, + ucp_Emoji_Modifier, + ucp_Emoji_Modifier_Base, + ucp_Emoji_Presentation, + ucp_Extended_Pictographic, + ucp_Extender, + ucp_Grapheme_Base, + ucp_Grapheme_Extend, + ucp_Grapheme_Link, + ucp_Hex_Digit, + ucp_IDS_Binary_Operator, + ucp_IDS_Trinary_Operator, + ucp_ID_Continue, + ucp_ID_Start, + ucp_Ideographic, + ucp_Join_Control, + ucp_Logical_Order_Exception, + ucp_Lowercase, + ucp_Math, + ucp_Noncharacter_Code_Point, + ucp_Pattern_Syntax, + ucp_Pattern_White_Space, + ucp_Prepended_Concatenation_Mark, + ucp_Quotation_Mark, + ucp_Radical, + ucp_Regional_Indicator, + ucp_Sentence_Terminal, + ucp_Soft_Dotted, + ucp_Terminal_Punctuation, + ucp_Unified_Ideograph, + ucp_Uppercase, + ucp_Variation_Selector, + ucp_White_Space, + ucp_XID_Continue, + ucp_XID_Start, + /* This must be last */ + ucp_Bprop_Count +}; + +/* Size of entries in ucd_boolprop_sets[] */ + +#define ucd_boolprop_sets_item_size 2 + +/* These are the bidi class values. */ + +enum { + ucp_bidiAL, /* Arabic letter */ + ucp_bidiAN, /* Arabic number */ + ucp_bidiB, /* Paragraph separator */ + ucp_bidiBN, /* Boundary neutral */ + ucp_bidiCS, /* Common separator */ + ucp_bidiEN, /* European number */ + ucp_bidiES, /* European separator */ + ucp_bidiET, /* European terminator */ + ucp_bidiFSI, /* First strong isolate */ + ucp_bidiL, /* Left to right */ + ucp_bidiLRE, /* Left to right embedding */ + ucp_bidiLRI, /* Left to right isolate */ + ucp_bidiLRO, /* Left to right override */ + ucp_bidiNSM, /* Non-spacing mark */ + ucp_bidiON, /* Other neutral */ + ucp_bidiPDF, /* Pop directional format */ + ucp_bidiPDI, /* Pop directional isolate */ + ucp_bidiR, /* Right to left */ + ucp_bidiRLE, /* Right to left embedding */ + ucp_bidiRLI, /* Right to left isolate */ + ucp_bidiRLO, /* Right to left override */ + ucp_bidiS, /* Segment separator */ + ucp_bidiWS, /* White space */ +}; + +/* These are grapheme break properties. The Extended Pictographic property +comes from the emoji-data.txt file. */ + +enum { + ucp_gbCR, /* 0 */ + ucp_gbLF, /* 1 */ + ucp_gbControl, /* 2 */ + ucp_gbExtend, /* 3 */ + ucp_gbPrepend, /* 4 */ + ucp_gbSpacingMark, /* 5 */ + ucp_gbL, /* 6 Hangul syllable type L */ + ucp_gbV, /* 7 Hangul syllable type V */ + ucp_gbT, /* 8 Hangul syllable type T */ + ucp_gbLV, /* 9 Hangul syllable type LV */ + ucp_gbLVT, /* 10 Hangul syllable type LVT */ + ucp_gbRegional_Indicator, /* 11 */ + ucp_gbOther, /* 12 */ + ucp_gbZWJ, /* 13 */ + ucp_gbExtended_Pictographic, /* 14 */ +}; + +/* These are the script identifications. */ + +enum { + /* Scripts which has characters in other scripts. */ + ucp_Latin, + ucp_Greek, + ucp_Cyrillic, + ucp_Arabic, + ucp_Syriac, + ucp_Thaana, + ucp_Devanagari, + ucp_Bengali, + ucp_Gurmukhi, + ucp_Gujarati, + ucp_Oriya, + ucp_Tamil, + ucp_Telugu, + ucp_Kannada, + ucp_Malayalam, + ucp_Sinhala, + ucp_Myanmar, + ucp_Georgian, + ucp_Hangul, + ucp_Mongolian, + ucp_Hiragana, + ucp_Katakana, + ucp_Bopomofo, + ucp_Han, + ucp_Yi, + ucp_Tagalog, + ucp_Hanunoo, + ucp_Buhid, + ucp_Tagbanwa, + ucp_Limbu, + ucp_Tai_Le, + ucp_Linear_B, + ucp_Cypriot, + ucp_Buginese, + ucp_Coptic, + ucp_Glagolitic, + ucp_Syloti_Nagri, + ucp_Phags_Pa, + ucp_Nko, + ucp_Kayah_Li, + ucp_Javanese, + ucp_Kaithi, + ucp_Mandaic, + ucp_Chakma, + ucp_Sharada, + ucp_Takri, + ucp_Duployan, + ucp_Grantha, + ucp_Khojki, + ucp_Linear_A, + ucp_Mahajani, + ucp_Manichaean, + ucp_Modi, + ucp_Old_Permic, + ucp_Psalter_Pahlavi, + ucp_Khudawadi, + ucp_Tirhuta, + ucp_Multani, + ucp_Adlam, + ucp_Masaram_Gondi, + ucp_Dogra, + ucp_Gunjala_Gondi, + ucp_Hanifi_Rohingya, + ucp_Sogdian, + ucp_Nandinagari, + ucp_Yezidi, + ucp_Cypro_Minoan, + ucp_Old_Uyghur, + + /* Scripts which has no characters in other scripts. */ + ucp_Unknown, + ucp_Common, + ucp_Armenian, + ucp_Hebrew, + ucp_Thai, + ucp_Lao, + ucp_Tibetan, + ucp_Ethiopic, + ucp_Cherokee, + ucp_Canadian_Aboriginal, + ucp_Ogham, + ucp_Runic, + ucp_Khmer, + ucp_Old_Italic, + ucp_Gothic, + ucp_Deseret, + ucp_Inherited, + ucp_Ugaritic, + ucp_Shavian, + ucp_Osmanya, + ucp_Braille, + ucp_New_Tai_Lue, + ucp_Tifinagh, + ucp_Old_Persian, + ucp_Kharoshthi, + ucp_Balinese, + ucp_Cuneiform, + ucp_Phoenician, + ucp_Sundanese, + ucp_Lepcha, + ucp_Ol_Chiki, + ucp_Vai, + ucp_Saurashtra, + ucp_Rejang, + ucp_Lycian, + ucp_Carian, + ucp_Lydian, + ucp_Cham, + ucp_Tai_Tham, + ucp_Tai_Viet, + ucp_Avestan, + ucp_Egyptian_Hieroglyphs, + ucp_Samaritan, + ucp_Lisu, + ucp_Bamum, + ucp_Meetei_Mayek, + ucp_Imperial_Aramaic, + ucp_Old_South_Arabian, + ucp_Inscriptional_Parthian, + ucp_Inscriptional_Pahlavi, + ucp_Old_Turkic, + ucp_Batak, + ucp_Brahmi, + ucp_Meroitic_Cursive, + ucp_Meroitic_Hieroglyphs, + ucp_Miao, + ucp_Sora_Sompeng, + ucp_Caucasian_Albanian, + ucp_Bassa_Vah, + ucp_Elbasan, + ucp_Pahawh_Hmong, + ucp_Mende_Kikakui, + ucp_Mro, + ucp_Old_North_Arabian, + ucp_Nabataean, + ucp_Palmyrene, + ucp_Pau_Cin_Hau, + ucp_Siddham, + ucp_Warang_Citi, + ucp_Ahom, + ucp_Anatolian_Hieroglyphs, + ucp_Hatran, + ucp_Old_Hungarian, + ucp_SignWriting, + ucp_Bhaiksuki, + ucp_Marchen, + ucp_Newa, + ucp_Osage, + ucp_Tangut, + ucp_Nushu, + ucp_Soyombo, + ucp_Zanabazar_Square, + ucp_Makasar, + ucp_Medefaidrin, + ucp_Old_Sogdian, + ucp_Elymaic, + ucp_Nyiakeng_Puachue_Hmong, + ucp_Wancho, + ucp_Chorasmian, + ucp_Dives_Akuru, + ucp_Khitan_Small_Script, + ucp_Tangsa, + ucp_Toto, + ucp_Vithkuqi, + + /* This must be last */ + ucp_Script_Count +}; + +/* Size of entries in ucd_script_sets[] */ + +#define ucd_script_sets_item_size 3 + +#endif /* PCRE2_UCP_H_IDEMPOTENT_GUARD */ + +/* End of pcre2_ucp.h */ diff --git a/include/php/ext/pcre/php_pcre.h b/include/php/ext/pcre/php_pcre.h new file mode 100644 index 0000000..a7c4b9c --- /dev/null +++ b/include/php/ext/pcre/php_pcre.h @@ -0,0 +1,95 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Andrei Zmievski | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_PCRE_H +#define PHP_PCRE_H + +#ifdef HAVE_BUNDLED_PCRE +#include "pcre2lib/pcre2.h" +#else +#include "pcre2.h" +#endif + +#include + +PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, const char *subject, size_t subject_len, zend_string *replace_str, size_t limit, size_t *replace_count); +PHPAPI pcre2_code* pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count); + +extern zend_module_entry pcre_module_entry; +#define pcre_module_ptr &pcre_module_entry + +#include "php_version.h" +#define PHP_PCRE_VERSION PHP_VERSION + +typedef struct _pcre_cache_entry pcre_cache_entry; + +typedef enum { + PHP_PCRE_NO_ERROR = 0, + PHP_PCRE_INTERNAL_ERROR, + PHP_PCRE_BACKTRACK_LIMIT_ERROR, + PHP_PCRE_RECURSION_LIMIT_ERROR, + PHP_PCRE_BAD_UTF8_ERROR, + PHP_PCRE_BAD_UTF8_OFFSET_ERROR, + PHP_PCRE_JIT_STACKLIMIT_ERROR +} php_pcre_error_code; + +PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex); +PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, int locale_aware); + +PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, + zval *subpats, int global, int use_flags, zend_long flags, zend_off_t start_offset); + +PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, const char *subject, size_t subject_len, zend_string *replace_str, + size_t limit, size_t *replace_count); + +PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, + zend_long limit_val, zend_long flags); + +PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value, + zend_long flags); + +PHPAPI pcre2_match_context *php_pcre_mctx(void); +PHPAPI pcre2_general_context *php_pcre_gctx(void); +PHPAPI pcre2_compile_context *php_pcre_cctx(void); +PHPAPI void php_pcre_pce_incref(pcre_cache_entry *); +PHPAPI void php_pcre_pce_decref(pcre_cache_entry *); +PHPAPI pcre2_code *php_pcre_pce_re(pcre_cache_entry *); +/* capture_count can be ignored, re is required. */ +PHPAPI pcre2_match_data *php_pcre_create_match_data(uint32_t, pcre2_code *); +PHPAPI void php_pcre_free_match_data(pcre2_match_data *); + +ZEND_BEGIN_MODULE_GLOBALS(pcre) + HashTable pcre_cache; + zend_long backtrack_limit; + zend_long recursion_limit; +#ifdef HAVE_PCRE_JIT_SUPPORT + bool jit; +#endif + bool per_request_cache; + php_pcre_error_code error_code; + /* Used for unmatched subpatterns in OFFSET_CAPTURE mode */ + zval unmatched_null_pair; + zval unmatched_empty_pair; + /* General context using per-request allocator (ZMM). */ + pcre2_general_context *gctx_zmm; +ZEND_END_MODULE_GLOBALS(pcre) + +PHPAPI ZEND_EXTERN_MODULE_GLOBALS(pcre) +#define PCRE_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(pcre, v) + +#define phpext_pcre_ptr pcre_module_ptr + +#endif /* PHP_PCRE_H */ diff --git a/include/php/ext/pdo/php_pdo.h b/include/php/ext/pdo/php_pdo.h new file mode 100644 index 0000000..023372e --- /dev/null +++ b/include/php/ext/pdo/php_pdo.h @@ -0,0 +1,65 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_PDO_H +#define PHP_PDO_H + +#include "zend.h" + +extern zend_module_entry pdo_module_entry; +#define phpext_pdo_ptr &pdo_module_entry + +#include "php_version.h" +#define PHP_PDO_VERSION PHP_VERSION + +#ifdef PHP_WIN32 +# if defined(PDO_EXPORTS) || (!defined(COMPILE_DL_PDO)) +# define PDO_API __declspec(dllexport) +# elif defined(COMPILE_DL_PDO) +# define PDO_API __declspec(dllimport) +# else +# define PDO_API /* nothing special */ +# endif +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PDO_API __attribute__ ((visibility("default"))) +#else +# define PDO_API /* nothing special */ +#endif + +#ifdef ZTS +# include "TSRM.h" +#endif + +PHP_MINIT_FUNCTION(pdo); +PHP_MSHUTDOWN_FUNCTION(pdo); +PHP_MINFO_FUNCTION(pdo); + +#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \ + zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (zend_long)value); + +#define REGISTER_PDO_CLASS_CONST_STRING(const_name, value) \ + zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1); + +#define LONG_CONST(c) (zend_long) c + +#define PDO_CONSTRUCT_CHECK \ + if (!dbh->driver) { \ + zend_throw_error(NULL, "PDO object is not initialized, constructor was not called"); \ + RETURN_THROWS(); \ + } \ + + +#endif /* PHP_PDO_H */ diff --git a/include/php/ext/pdo/php_pdo_driver.h b/include/php/ext/pdo/php_pdo_driver.h new file mode 100644 index 0000000..c832284 --- /dev/null +++ b/include/php/ext/pdo/php_pdo_driver.h @@ -0,0 +1,688 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_PDO_DRIVER_H +#define PHP_PDO_DRIVER_H + +#include "php_pdo.h" + +/* forward declarations */ +typedef struct _pdo_dbh_t pdo_dbh_t; +typedef struct _pdo_dbh_object_t pdo_dbh_object_t; +typedef struct _pdo_stmt_t pdo_stmt_t; +typedef struct _pdo_row_t pdo_row_t; +struct pdo_bound_param_data; + +#ifndef TRUE +# define TRUE 1 +#endif +#ifndef FALSE +# define FALSE 0 +#endif + +#define PDO_DRIVER_API 20170320 + +/* Doctrine hardcodes these constants, avoid changing their values. */ +enum pdo_param_type { + PDO_PARAM_NULL = 0, + PDO_PARAM_BOOL = 5, + PDO_PARAM_INT = 1, + PDO_PARAM_STR = 2, + PDO_PARAM_LOB = 3, + + /* get_col: Not supported (yet?) */ + PDO_PARAM_STMT = 4, /* hierarchical result set */ + + /* magic flag to denote a parameter as being input/output */ + PDO_PARAM_INPUT_OUTPUT = 0x80000000, + + /* magic flag to denote a string that uses the national character set + see section 4.2.1 of SQL-92: http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt + */ + PDO_PARAM_STR_NATL = 0x40000000, + + /* magic flag to denote a string that uses the regular character set */ + PDO_PARAM_STR_CHAR = 0x20000000, +}; + +#define PDO_PARAM_FLAGS 0xFFFF0000 + +#define PDO_PARAM_TYPE(x) ((x) & ~PDO_PARAM_FLAGS) + +enum pdo_fetch_type { + PDO_FETCH_USE_DEFAULT, + PDO_FETCH_LAZY, + PDO_FETCH_ASSOC, + PDO_FETCH_NUM, + PDO_FETCH_BOTH, + PDO_FETCH_OBJ, + PDO_FETCH_BOUND, /* return true/false only; rely on bound columns */ + PDO_FETCH_COLUMN, /* fetch a numbered column only */ + PDO_FETCH_CLASS, /* create an instance of named class, call ctor and set properties */ + PDO_FETCH_INTO, /* fetch row into an existing object */ + PDO_FETCH_FUNC, /* fetch into function and return its result */ + PDO_FETCH_NAMED, /* like PDO_FETCH_ASSOC, but can handle duplicate names */ + PDO_FETCH_KEY_PAIR, /* fetch into an array where the 1st column is a key and all subsequent columns are values */ + PDO_FETCH__MAX /* must be last */ +}; + +#define PDO_FETCH_FLAGS 0xFFFF0000 /* fetchAll() modes or'd to PDO_FETCH_XYZ */ +#define PDO_FETCH_GROUP 0x00010000 /* fetch into groups */ +#define PDO_FETCH_UNIQUE 0x00030000 /* fetch into groups assuming first col is unique */ +#define PDO_FETCH_CLASSTYPE 0x00040000 /* fetch class gets its class name from 1st column */ +#define PDO_FETCH_SERIALIZE 0x00080000 /* fetch class instances by calling serialize */ +#define PDO_FETCH_PROPS_LATE 0x00100000 /* fetch props after calling ctor */ + +/* fetch orientation for scrollable cursors */ +enum pdo_fetch_orientation { + PDO_FETCH_ORI_NEXT, /* default: fetch the next available row */ + PDO_FETCH_ORI_PRIOR, /* scroll back to prior row and fetch that */ + PDO_FETCH_ORI_FIRST, /* scroll to the first row and fetch that */ + PDO_FETCH_ORI_LAST, /* scroll to the last row and fetch that */ + PDO_FETCH_ORI_ABS, /* scroll to an absolute numbered row and fetch that */ + PDO_FETCH_ORI_REL /* scroll relative to the current row, and fetch that */ +}; + +enum pdo_attribute_type { + PDO_ATTR_AUTOCOMMIT, /* use to turn on or off auto-commit mode */ + PDO_ATTR_PREFETCH, /* configure the prefetch size for drivers that support it. Size is in KB */ + PDO_ATTR_TIMEOUT, /* connection timeout in seconds */ + PDO_ATTR_ERRMODE, /* control how errors are handled */ + PDO_ATTR_SERVER_VERSION, /* database server version */ + PDO_ATTR_CLIENT_VERSION, /* client library version */ + PDO_ATTR_SERVER_INFO, /* server information */ + PDO_ATTR_CONNECTION_STATUS, /* connection status */ + PDO_ATTR_CASE, /* control case folding for portability */ + PDO_ATTR_CURSOR_NAME, /* name a cursor for use in "WHERE CURRENT OF " */ + PDO_ATTR_CURSOR, /* cursor type */ + PDO_ATTR_ORACLE_NULLS, /* convert empty strings to NULL */ + PDO_ATTR_PERSISTENT, /* pconnect style connection */ + PDO_ATTR_STATEMENT_CLASS, /* array(classname, array(ctor_args)) to specify the class of the constructed statement */ + PDO_ATTR_FETCH_TABLE_NAMES, /* include table names in the column names, where available */ + PDO_ATTR_FETCH_CATALOG_NAMES, /* include the catalog/db name names in the column names, where available */ + PDO_ATTR_DRIVER_NAME, /* name of the driver (as used in the constructor) */ + PDO_ATTR_STRINGIFY_FETCHES, /* converts integer/float types to strings during fetch */ + PDO_ATTR_MAX_COLUMN_LEN, /* make database calculate maximum length of data found in a column */ + PDO_ATTR_DEFAULT_FETCH_MODE, /* Set the default fetch mode */ + PDO_ATTR_EMULATE_PREPARES, /* use query emulation rather than native */ + PDO_ATTR_DEFAULT_STR_PARAM, /* set the default string parameter type (see the PDO::PARAM_STR_* magic flags) */ + + /* this defines the start of the range for driver specific options. + * Drivers should define their own attribute constants beginning with this + * value. */ + PDO_ATTR_DRIVER_SPECIFIC = 1000 +}; + +enum pdo_cursor_type { + PDO_CURSOR_FWDONLY, /* forward only cursor (default) */ + PDO_CURSOR_SCROLL /* scrollable cursor */ +}; + +/* SQL-92 SQLSTATE error codes. + +The character string value returned for an SQLSTATE consists of a two-character +class value followed by a three-character subclass value. A class value of 01 +indicates a warning and is accompanied by a return code of +SQL_SUCCESS_WITH_INFO. + +Class values other than '01', except for the class 'IM', +indicate an error and are accompanied by a return code of SQL_ERROR. The class +'IM' is specific to warnings and errors that derive from the implementation of +ODBC itself. + +The subclass value '000' in any class indicates that there is no +subclass for that SQLSTATE. The assignment of class and subclass values is +defined by SQL-92. +*/ + +typedef char pdo_error_type[6]; /* SQLSTATE */ + + +#define PDO_ERR_NONE "00000" + +enum pdo_error_mode { + PDO_ERRMODE_SILENT, /* just set error codes */ + PDO_ERRMODE_WARNING, /* raise E_WARNING */ + PDO_ERRMODE_EXCEPTION /* throw exceptions */ +}; + +enum pdo_case_conversion { + PDO_CASE_NATURAL, + PDO_CASE_UPPER, + PDO_CASE_LOWER +}; + +/* oracle interop settings */ +enum pdo_null_handling { + PDO_NULL_NATURAL = 0, + PDO_NULL_EMPTY_STRING = 1, + PDO_NULL_TO_STRING = 2 +}; + +/* {{{ utils for reading attributes set as driver_options */ +static inline zend_long pdo_attr_lval(zval *options, unsigned option_name, zend_long defval) +{ + zval *v; + + if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) { + return zval_get_long(v); + } + return defval; +} +static inline zend_string *pdo_attr_strval(zval *options, unsigned option_name, zend_string *defval) +{ + zval *v; + + if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) { + return zval_try_get_string(v); + } + return defval ? zend_string_copy(defval) : NULL; +} +/* }}} */ + +/* This structure is registered with PDO when a PDO driver extension is + * initialized */ +typedef struct { + const char *driver_name; + size_t driver_name_len; + zend_ulong api_version; /* needs to be compatible with PDO */ + +#define PDO_DRIVER_HEADER(name) \ + #name, sizeof(#name)-1, \ + PDO_DRIVER_API + + /* create driver specific portion of the database handle and stash it into + * the dbh. dbh contains the data source string and flags for this + * instance. You MUST respect dbh->is_persistent and pass that flag to + * pemalloc() for all allocations that are stored in the dbh or your instance + * data in the db, otherwise you will crash PHP when persistent connections + * are used. + */ + int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options); + +} pdo_driver_t; + +/* {{{ methods for a database handle */ + +/* close or otherwise disconnect the database */ +typedef void (*pdo_dbh_close_func)(pdo_dbh_t *dbh); + +/* prepare a statement and stash driver specific portion into stmt + * return true on success, false otherwise */ +typedef bool (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options); + +/* execute a statement (that does not return a result set) + * Return -1 on failure, otherwise the number of affected rows */ +typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const zend_string *sql); + +/* quote a string */ +typedef zend_string* (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype); + +/* transaction related (beingTransaction(), commit, rollBack, inTransaction) + * Return true if currently inside a transaction, false otherwise. */ +typedef bool (*pdo_dbh_txn_func)(pdo_dbh_t *dbh); + +/* setting of attributes + * Return true on success and false in case of failure */ +typedef bool (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val); + +/* return last insert id. NULL indicates error condition. + * name MIGHT be NULL */ +typedef zend_string *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const zend_string *name); + +/* Fetch error information. + * If stmt is not null, fetch information pertaining to the statement, + * otherwise fetch global error information. + * info is an initialized PHP array, if there are no messages leave it empty. + * The driver should add the following information to the array "info" in this order: + * - native error code + * - string representation of the error code ... any other optional driver + * specific data ... + * PDO takes care of normalizing the array. */ +typedef void (*pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info); + +/* fetching of attributes + * There are 3 return states: + * * -1 for errors while retrieving a valid attribute + * * 0 for attempting to retrieve an attribute which is not supported by the driver + * * any other value for success, *val must be set to the attribute value */ +typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val); + +/* checking/pinging persistent connections; return SUCCESS if the connection + * is still alive and ready to be used, FAILURE otherwise. + * You may set this handler to NULL, which is equivalent to returning SUCCESS. */ +typedef zend_result (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh); + +/* called at request end for each persistent dbh; this gives the driver + * the opportunity to safely release resources that only have per-request + * scope */ +typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh); + +/* Called when the PDO handle is scanned for GC. Should populate the get_gc buffer + * with any zvals in the driver_data that would be freed if the handle is destroyed. */ +typedef void (*pdo_dbh_get_gc_func)(pdo_dbh_t *dbh, zend_get_gc_buffer *buffer); + +/* for adding methods to the dbh or stmt objects +pointer to a list of driver specific functions. The convention is +to prefix the function names using the PDO driver name; this will +reduce the chance of collisions with future functionality in the +PDO class or in user code (they can extend the PDO object). +*/ +enum { + PDO_DBH_DRIVER_METHOD_KIND_DBH = 0, + PDO_DBH_DRIVER_METHOD_KIND_STMT, + PDO_DBH_DRIVER_METHOD_KIND__MAX +}; + +typedef const zend_function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind); + +struct pdo_dbh_methods { + pdo_dbh_close_func closer; + pdo_dbh_prepare_func preparer; + pdo_dbh_do_func doer; + pdo_dbh_quote_func quoter; + pdo_dbh_txn_func begin; + pdo_dbh_txn_func commit; + pdo_dbh_txn_func rollback; + pdo_dbh_set_attr_func set_attribute; + pdo_dbh_last_id_func last_id; + pdo_dbh_fetch_error_func fetch_err; + pdo_dbh_get_attr_func get_attribute; + pdo_dbh_check_liveness_func check_liveness; + pdo_dbh_get_driver_methods_func get_driver_methods; + pdo_dbh_request_shutdown persistent_shutdown; + /* if defined to NULL, PDO will use its internal transaction tracking state */ + pdo_dbh_txn_func in_transaction; + pdo_dbh_get_gc_func get_gc; +}; + +/* }}} */ + +/* {{{ methods for a statement handle */ + +/* free the statement handle */ +typedef int (*pdo_stmt_dtor_func)(pdo_stmt_t *stmt); + +/* start the query */ +typedef int (*pdo_stmt_execute_func)(pdo_stmt_t *stmt); + +/* causes the next row in the set to be fetched; indicates if there are no + * more rows. The ori and offset params modify which row should be returned, + * if the stmt represents a scrollable cursor */ +typedef int (*pdo_stmt_fetch_func)(pdo_stmt_t *stmt, + enum pdo_fetch_orientation ori, zend_long offset); + +/* queries information about the type of a column, by index (0 based). + * Driver should populate stmt->columns[colno] with appropriate info */ +typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno); + +/* Retrieves zval value of a column. If type is non-NULL, then this specifies the type which + * the user requested through bindColumn(). The driver does not need to check this argument, + * as PDO will perform any necessary conversions itself. However, it might be used to fetch + * a value more efficiently into the final type, or make the behavior dependent on the requested + * type. */ +typedef int (*pdo_stmt_get_col_data_func)( + pdo_stmt_t *stmt, int colno, zval *result, enum pdo_param_type *type); + +/* hook for bound params */ +enum pdo_param_event { + PDO_PARAM_EVT_ALLOC, + PDO_PARAM_EVT_FREE, + PDO_PARAM_EVT_EXEC_PRE, + PDO_PARAM_EVT_EXEC_POST, + PDO_PARAM_EVT_FETCH_PRE, + PDO_PARAM_EVT_FETCH_POST, + PDO_PARAM_EVT_NORMALIZE +}; + +typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type); + +/* setting of attributes */ +typedef int (*pdo_stmt_set_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val); + +/* fetching of attributes */ +typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val); + +/* retrieves meta data for a numbered column. + * Returns SUCCESS/FAILURE. + * On SUCCESS, fill in return_value with an array with the following fields. + * If a particular field is not supported, then the driver simply does not add it to + * the array, so that scripts can use isset() to check for it. + * + * ### this is just a rough first cut, and subject to change ### + * + * these are added by PDO itself, based on data from the describe handler: + * name => the column name + * len => the length/size of the column + * precision => precision of the column + * + * pdo_type => an integer, one of the PDO_PARAM_XXX values + * scale => the floating point scale + * table => the table for that column + * type => a string representation of the type, mapped to the PHP equivalent type name + * native_type => a string representation of the type, native style, if different from + * the mapped name. + * flags => an array of flags including zero or more of the following: + * primary_key, not_null, unique_key, multiple_key, unsigned, auto_increment, blob + * + * Any driver specific data should be returned using a prefixed key or value. + * Eg: custom data for the mysql driver would use either + * 'mysql:foobar' => 'some data' // to add a new key to the array + * or + * 'flags' => array('not_null', 'mysql:some_flag'); // to add data to an existing key + */ +typedef int (*pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, zend_long colno, zval *return_value); + +/* advances the statement to the next rowset of the batch. + * If it returns 1, PDO will tear down its idea of columns + * and meta data. If it returns 0, PDO will indicate an error + * to the caller. */ +typedef int (*pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt); + +/* closes the active cursor on a statement, leaving the prepared + * statement ready for re-execution. Useful to explicitly state + * that you are done with a given rowset, without having to explicitly + * fetch all the rows. */ +typedef int (*pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt); + +struct pdo_stmt_methods { + pdo_stmt_dtor_func dtor; + pdo_stmt_execute_func executer; + pdo_stmt_fetch_func fetcher; + pdo_stmt_describe_col_func describer; + pdo_stmt_get_col_data_func get_col; + pdo_stmt_param_hook_func param_hook; + pdo_stmt_set_attr_func set_attribute; + pdo_stmt_get_attr_func get_attribute; + pdo_stmt_get_column_meta_func get_column_meta; + pdo_stmt_next_rowset_func next_rowset; + pdo_stmt_cursor_closer_func cursor_closer; +}; + +/* }}} */ + +enum pdo_placeholder_support { + PDO_PLACEHOLDER_NONE=0, + PDO_PLACEHOLDER_NAMED=1, + PDO_PLACEHOLDER_POSITIONAL=2 +}; + +struct _pdo_dbh_t { + /* driver specific methods */ + const struct pdo_dbh_methods *methods; + /* driver specific data */ + void *driver_data; + + /* credentials */ + char *username, *password; + + /* if true, then data stored and pointed at by this handle must all be + * persistently allocated */ + unsigned is_persistent:1; + + /* if true, driver should act as though a COMMIT were executed between + * each executed statement; otherwise, COMMIT must be carried out manually + * */ + unsigned auto_commit:1; + + /* if true, the handle has been closed and will not function anymore */ + unsigned is_closed:1; + + /* if true, the driver requires that memory be allocated explicitly for + * the columns that are returned */ + unsigned alloc_own_columns:1; + + /* if true, commit or rollBack is allowed to be called */ + bool in_txn:1; + + /* max length a single character can become after correct quoting */ + unsigned max_escaped_char_length:3; + + /* oracle compat; see enum pdo_null_handling */ + unsigned oracle_nulls:2; + + /* when set, convert int/floats to strings */ + unsigned stringify:1; + + /* bitmap for pdo_param_event(s) to skip in dispatch_param_event */ + unsigned skip_param_evt:7; + + /* the sum of the number of bits here and the bit fields preceding should + * equal 32 */ + unsigned _reserved_flags:14; + + /* data source string used to open this handle */ + const char *data_source; + size_t data_source_len; + + /* the global error code. */ + pdo_error_type error_code; + + enum pdo_error_mode error_mode; + + enum pdo_case_conversion native_case, desired_case; + + /* persistent hash key associated with this handle */ + const char *persistent_id; + size_t persistent_id_len; + unsigned int refcount; + + /* driver specific "class" methods for the dbh and stmt */ + HashTable *cls_methods[PDO_DBH_DRIVER_METHOD_KIND__MAX]; + + pdo_driver_t *driver; + + zend_class_entry *def_stmt_ce; + + zval def_stmt_ctor_args; + + /* when calling PDO::query(), we need to keep the error + * context from the statement around until we next clear it. + * This will allow us to report the correct error message + * when PDO::query() fails */ + pdo_stmt_t *query_stmt; + zval query_stmt_zval; + + /* defaults for fetches */ + enum pdo_fetch_type default_fetch_type; +}; + +/* represents a connection to a database */ +struct _pdo_dbh_object_t { + pdo_dbh_t *inner; + /* these items must appear in this order at the beginning of the + struct so that this can be cast as a zend_object. we need this + to allow the extending class to escape all the custom handlers + that PDO declares. + */ + zend_object std; +}; + +static inline pdo_dbh_t *php_pdo_dbh_fetch_inner(zend_object *obj) { + return (pdo_dbh_t *)(((pdo_dbh_object_t *)((char*)(obj) - XtOffsetOf(pdo_dbh_object_t, std)))->inner); +} + +static inline pdo_dbh_object_t *php_pdo_dbh_fetch_object(zend_object *obj) { + return (pdo_dbh_object_t *)((char*)(obj) - XtOffsetOf(pdo_dbh_object_t, std)); +} + +#define Z_PDO_DBH_P(zv) php_pdo_dbh_fetch_inner(Z_OBJ_P((zv))) +#define Z_PDO_OBJECT_P(zv) php_pdo_dbh_fetch_object(Z_OBJ_P((zv))) + +/* describes a column */ +struct pdo_column_data { + zend_string *name; + size_t maxlen; + zend_ulong precision; +}; + +/* describes a bound parameter */ +struct pdo_bound_param_data { + zval parameter; /* the variable itself */ + + zval driver_params; /* optional parameter(s) for the driver */ + + zend_long paramno; /* if -1, then it has a name, and we don't know the index *yet* */ + zend_string *name; + + zend_long max_value_len; /* as a hint for pre-allocation */ + + void *driver_data; + + pdo_stmt_t *stmt; /* for convenience in dtor */ + + enum pdo_param_type param_type; /* desired or suggested variable type */ + + int is_param; /* parameter or column ? */ +}; + +/* represents a prepared statement */ +struct _pdo_stmt_t { + /* driver specifics */ + const struct pdo_stmt_methods *methods; + void *driver_data; + + /* if true, we've already successfully executed this statement at least + * once */ + unsigned executed:1; + /* if true, the statement supports placeholders and can implement + * bindParam() for its prepared statements, if false, PDO should + * emulate prepare and bind on its behalf */ + unsigned supports_placeholders:2; + + unsigned _reserved:29; + + /* the number of columns in the result set; not valid until after + * the statement has been executed at least once. In some cases, might + * not be valid until fetch (at the driver level) has been called at least once. + * */ + int column_count; + struct pdo_column_data *columns; + + /* we want to keep the dbh alive while we live, so we own a reference */ + zval database_object_handle; + pdo_dbh_t *dbh; + + /* keep track of bound input parameters. Some drivers support + * input/output parameters, but you can't rely on that working */ + HashTable *bound_params; + /* When rewriting from named to positional, this maps positions to names */ + HashTable *bound_param_map; + /* keep track of PHP variables bound to named (or positional) columns + * in the result set */ + HashTable *bound_columns; + + /* not always meaningful */ + zend_long row_count; + + /* used to hold the statement's current query */ + zend_string *query_string; + + /* the copy of the query with expanded binds ONLY for emulated-prepare drivers */ + zend_string *active_query_string; + + /* the cursor specific error code. */ + pdo_error_type error_code; + + /* for lazy fetches, we always return the same lazy object handle. + * Let's keep it here. */ + zval lazy_object_ref; + zend_ulong refcount; + + /* defaults for fetches */ + enum pdo_fetch_type default_fetch_type; + union { + int column; + struct { + zval ctor_args; /* freed */ + zend_fcall_info fci; + zend_fcall_info_cache fcc; + zval retval; + zend_class_entry *ce; + } cls; + struct { + zval fetch_args; /* freed */ + zend_fcall_info fci; + zend_fcall_info_cache fcc; + zval object; + zval function; + zval *values; /* freed */ + } func; + zval into; + } fetch; + + /* used by the query parser for driver specific + * parameter naming (see pgsql driver for example) */ + const char *named_rewrite_template; + + /* these items must appear in this order at the beginning of the + struct so that this can be cast as a zend_object. we need this + to allow the extending class to escape all the custom handlers + that PDO declares. + */ + zend_object std; +}; + +static inline pdo_stmt_t *php_pdo_stmt_fetch_object(zend_object *obj) { + return (pdo_stmt_t *)((char*)(obj) - XtOffsetOf(pdo_stmt_t, std)); +} + +#define Z_PDO_STMT_P(zv) php_pdo_stmt_fetch_object(Z_OBJ_P((zv))) + +struct _pdo_row_t { + zend_object std; + pdo_stmt_t *stmt; +}; + +/* Call this in MINIT to register the PDO driver. + * Registering the driver might fail and should be reported accordingly in MINIT. */ +PDO_API zend_result php_pdo_register_driver(const pdo_driver_t *driver); +/* call this in MSHUTDOWN to unregister your PDO driver */ +PDO_API void php_pdo_unregister_driver(const pdo_driver_t *driver); + +/* For the convenience of drivers, this function will parse a data source + * string, of the form "name=value; name2=value2" and populate variables + * according to the data you pass in and array of pdo_data_src_parser structures */ +struct pdo_data_src_parser { + const char *optname; + char *optval; + int freeme; +}; + +PDO_API int php_pdo_parse_data_source(const char *data_source, + zend_ulong data_source_len, struct pdo_data_src_parser *parsed, + int nparams); + +PDO_API zend_class_entry *php_pdo_get_dbh_ce(void); +PDO_API zend_class_entry *php_pdo_get_exception(void); + +PDO_API int pdo_parse_params(pdo_stmt_t *stmt, zend_string *inquery, zend_string **outquery); + +PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, + pdo_error_type sqlstate, const char *supp); + +PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh); +PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh); + +PDO_API void php_pdo_free_statement(pdo_stmt_t *stmt); +PDO_API void php_pdo_stmt_set_column_count(pdo_stmt_t *stmt, int new_count); + +/* Normalization for fetching long param for driver attributes */ +PDO_API bool pdo_get_long_param(zend_long *lval, zval *value); +PDO_API bool pdo_get_bool_param(bool *bval, zval *value); + +PDO_API void pdo_throw_exception(unsigned int driver_errcode, char *driver_errmsg, pdo_error_type *pdo_error); +#endif /* PHP_PDO_DRIVER_H */ diff --git a/include/php/ext/pdo/php_pdo_error.h b/include/php/ext/pdo/php_pdo_error.h new file mode 100644 index 0000000..33cc305 --- /dev/null +++ b/include/php/ext/pdo/php_pdo_error.h @@ -0,0 +1,35 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_PDO_ERROR_H +#define PHP_PDO_ERROR_H + +#include "php_pdo_driver.h" + +PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt); + +#define PDO_DBH_CLEAR_ERR() do { \ + strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \ + if (dbh->query_stmt) { \ + dbh->query_stmt = NULL; \ + zval_ptr_dtor(&dbh->query_stmt_zval); \ + } \ +} while (0) +#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE) +#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL); } +#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt); } + +#endif /* PHP_PDO_ERROR_H */ diff --git a/include/php/ext/phar/php_phar.h b/include/php/ext/phar/php_phar.h new file mode 100644 index 0000000..9825909 --- /dev/null +++ b/include/php/ext/phar/php_phar.h @@ -0,0 +1,37 @@ +/* + +----------------------------------------------------------------------+ + | phar php single-file executable PHP extension | + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Gregory Beaver | + | Marcus Boerger | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_PHAR_H +#define PHP_PHAR_H + +#define PHP_PHAR_VERSION PHP_VERSION + +#include "ext/standard/basic_functions.h" +extern zend_module_entry phar_module_entry; +#define phpext_phar_ptr &phar_module_entry + +#ifdef PHP_WIN32 +#define PHP_PHAR_API __declspec(dllexport) +#else +#define PHP_PHAR_API PHPAPI +#endif + +PHP_PHAR_API int phar_resolve_alias(char *alias, size_t alias_len, char **filename, size_t *filename_len); + +#endif /* PHP_PHAR_H */ diff --git a/include/php/ext/random/php_random.h b/include/php/ext/random/php_random.h new file mode 100644 index 0000000..c970148 --- /dev/null +++ b/include/php/ext/random/php_random.h @@ -0,0 +1,355 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rasmus Lerdorf | + | Zeev Suraski | + | Sascha Schumann | + | Pedro Melo | + | Sterling Hughes | + | Sammy Kaye Powers | + | Go Kudo | + | | + | Based on code from: Richard J. Wagner | + | Makoto Matsumoto | + | Takuji Nishimura | + | Shawn Cokus | + | David Blackman | + | Sebastiano Vigna | + | Melissa O'Neill | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_RANDOM_H +# define PHP_RANDOM_H + +# include "php.h" + +PHPAPI double php_combined_lcg(void); + +/* + * A bit of tricky math here. We want to avoid using a modulus because + * that simply tosses the high-order bits and might skew the distribution + * of random values over the range. Instead we map the range directly. + * + * We need to map the range from 0...M evenly to the range a...b + * Let n = the random number and n' = the mapped random number + * + * Then we have: n' = a + n(b-a)/M + * + * We have a problem here in that only n==M will get mapped to b which + * means the chances of getting b is much much less than getting any of + * the other values in the range. We can fix this by increasing our range + * artificially and using: + * + * n' = a + n(b-a+1)/M + * + * Now we only have a problem if n==M which would cause us to produce a + * number of b+1 which would be bad. So we bump M up by one to make sure + * this will never happen, and the final algorithm looks like this: + * + * n' = a + n(b-a+1)/(M+1) + * + * -RL + */ +# define RAND_RANGE_BADSCALING(__n, __min, __max, __tmax) \ + (__n) = (__min) + (zend_long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / ((__tmax) + 1.0))) + +# ifdef PHP_WIN32 +# define GENERATE_SEED() (((zend_long) ((zend_ulong) time(NULL) * (zend_ulong) GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg()))) +# else +# define GENERATE_SEED() (((zend_long) ((zend_ulong) time(NULL) * (zend_ulong) getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg()))) +# endif + +# define PHP_MT_RAND_MAX ((zend_long) (0x7FFFFFFF)) /* (1<<31) - 1 */ + +# define MT_RAND_MT19937 0 +# define MT_RAND_PHP 1 + +# define MT_N (624) + +#define PHP_RANDOM_RANGE_ATTEMPTS (50) + +PHPAPI void php_mt_srand(uint32_t seed); +PHPAPI uint32_t php_mt_rand(void); +PHPAPI zend_long php_mt_rand_range(zend_long min, zend_long max); +PHPAPI zend_long php_mt_rand_common(zend_long min, zend_long max); + +# ifndef RAND_MAX +# define RAND_MAX PHP_MT_RAND_MAX +# endif + +# define PHP_RAND_MAX PHP_MT_RAND_MAX + +PHPAPI void php_srand(zend_long seed); +PHPAPI zend_long php_rand(void); + +# if !defined(__SIZEOF_INT128__) || defined(PHP_RANDOM_FORCE_EMULATE_128) +typedef struct _php_random_uint128_t { + uint64_t hi; + uint64_t lo; +} php_random_uint128_t; + +static inline uint64_t php_random_uint128_hi(php_random_uint128_t num) +{ + return num.hi; +} + +static inline uint64_t php_random_uint128_lo(php_random_uint128_t num) +{ + return num.lo; +} + +static inline php_random_uint128_t php_random_uint128_constant(uint64_t hi, uint64_t lo) +{ + php_random_uint128_t r; + + r.hi = hi; + r.lo = lo; + + return r; +} + +static inline php_random_uint128_t php_random_uint128_add(php_random_uint128_t num1, php_random_uint128_t num2) +{ + php_random_uint128_t r; + + r.lo = (num1.lo + num2.lo); + r.hi = (num1.hi + num2.hi + (r.lo < num1.lo)); + + return r; +} + +static inline php_random_uint128_t php_random_uint128_multiply(php_random_uint128_t num1, php_random_uint128_t num2) +{ + php_random_uint128_t r; + const uint64_t + x0 = num1.lo & 0xffffffffULL, + x1 = num1.lo >> 32, + y0 = num2.lo & 0xffffffffULL, + y1 = num2.lo >> 32, + z0 = (((x1 * y0) + (x0 * y0 >> 32)) & 0xffffffffULL) + x0 * y1; + + r.hi = num1.hi * num2.lo + num1.lo * num2.hi; + r.lo = num1.lo * num2.lo; + r.hi += x1 * y1 + ((x1 * y0 + (x0 * y0 >> 32)) >> 32) + (z0 >> 32); + + return r; +} + +static inline uint64_t php_random_pcgoneseq128xslrr64_rotr64(php_random_uint128_t num) +{ + const uint64_t + v = (num.hi ^ num.lo), + s = num.hi >> 58U; + + return (v >> s) | (v << ((-s) & 63)); +} +# else +typedef __uint128_t php_random_uint128_t; + +static inline uint64_t php_random_uint128_hi(php_random_uint128_t num) +{ + return (uint64_t) (num >> 64); +} + +static inline uint64_t php_random_uint128_lo(php_random_uint128_t num) +{ + return (uint64_t) num; +} + +static inline php_random_uint128_t php_random_uint128_constant(uint64_t hi, uint64_t lo) +{ + php_random_uint128_t r; + + r = ((php_random_uint128_t) hi << 64) + lo; + + return r; +} + +static inline php_random_uint128_t php_random_uint128_add(php_random_uint128_t num1, php_random_uint128_t num2) +{ + return num1 + num2; +} + +static inline php_random_uint128_t php_random_uint128_multiply(php_random_uint128_t num1, php_random_uint128_t num2) +{ + return num1 * num2; +} + +static inline uint64_t php_random_pcgoneseq128xslrr64_rotr64(php_random_uint128_t num) +{ + const uint64_t + v = ((uint64_t) (num >> 64U)) ^ (uint64_t) num, + s = num >> 122U; + + return (v >> s) | (v << ((-s) & 63)); +} +# endif + +PHPAPI zend_result php_random_bytes(void *bytes, size_t size, bool should_throw); +PHPAPI zend_result php_random_int(zend_long min, zend_long max, zend_long *result, bool should_throw); + +static inline zend_result php_random_bytes_throw(void *bytes, size_t size) +{ + return php_random_bytes(bytes, size, true); +} + +static inline zend_result php_random_bytes_silent(void *bytes, size_t size) +{ + return php_random_bytes(bytes, size, false); +} + +static inline zend_result php_random_int_throw(zend_long min, zend_long max, zend_long *result) +{ + return php_random_int(min, max, result, true); +} + +static inline zend_result php_random_int_silent(zend_long min, zend_long max, zend_long *result) +{ + return php_random_int(min, max, result, false); +} + +typedef struct _php_random_status_ { + size_t last_generated_size; + void *state; +} php_random_status; + +typedef struct _php_random_status_state_combinedlcg { + int32_t state[2]; +} php_random_status_state_combinedlcg; + +typedef struct _php_random_status_state_mt19937 { + uint32_t state[MT_N]; + uint32_t count; + uint8_t mode; +} php_random_status_state_mt19937; + +typedef struct _php_random_status_state_pcgoneseq128xslrr64 { + php_random_uint128_t state; +} php_random_status_state_pcgoneseq128xslrr64; + +typedef struct _php_random_status_state_xoshiro256starstar { + uint64_t state[4]; +} php_random_status_state_xoshiro256starstar; + +typedef struct _php_random_status_state_user { + zend_object *object; + zend_function *generate_method; +} php_random_status_state_user; + +typedef struct _php_random_algo { + const size_t generate_size; + const size_t state_size; + void (*seed)(php_random_status *status, uint64_t seed); + uint64_t (*generate)(php_random_status *status); + zend_long (*range)(php_random_status *status, zend_long min, zend_long max); + bool (*serialize)(php_random_status *status, HashTable *data); + bool (*unserialize)(php_random_status *status, HashTable *data); +} php_random_algo; + +extern PHPAPI const php_random_algo php_random_algo_combinedlcg; +extern PHPAPI const php_random_algo php_random_algo_mt19937; +extern PHPAPI const php_random_algo php_random_algo_pcgoneseq128xslrr64; +extern PHPAPI const php_random_algo php_random_algo_xoshiro256starstar; +extern PHPAPI const php_random_algo php_random_algo_secure; +extern PHPAPI const php_random_algo php_random_algo_user; + +typedef struct _php_random_engine { + const php_random_algo *algo; + php_random_status *status; + zend_object std; +} php_random_engine; + +typedef struct _php_random_randomizer { + const php_random_algo *algo; + php_random_status *status; + bool is_userland_algo; + zend_object std; +} php_random_randomizer; + +extern PHPAPI zend_class_entry *random_ce_Random_Engine; +extern PHPAPI zend_class_entry *random_ce_Random_CryptoSafeEngine; + +extern PHPAPI zend_class_entry *random_ce_Random_RandomError; +extern PHPAPI zend_class_entry *random_ce_Random_BrokenRandomEngineError; +extern PHPAPI zend_class_entry *random_ce_Random_RandomException; + +extern PHPAPI zend_class_entry *random_ce_Random_Engine_PcgOneseq128XslRr64; +extern PHPAPI zend_class_entry *random_ce_Random_Engine_Mt19937; +extern PHPAPI zend_class_entry *random_ce_Random_Engine_Xoshiro256StarStar; +extern PHPAPI zend_class_entry *random_ce_Random_Engine_Secure; + +extern PHPAPI zend_class_entry *random_ce_Random_Randomizer; + +extern PHPAPI zend_class_entry *random_ce_Random_IntervalBoundary; + +static inline php_random_engine *php_random_engine_from_obj(zend_object *object) { + return (php_random_engine *)((char *)(object) - XtOffsetOf(php_random_engine, std)); +} + +static inline php_random_randomizer *php_random_randomizer_from_obj(zend_object *object) { + return (php_random_randomizer *)((char *)(object) - XtOffsetOf(php_random_randomizer, std)); +} + +# define Z_RANDOM_ENGINE_P(zval) php_random_engine_from_obj(Z_OBJ_P(zval)) + +# define Z_RANDOM_RANDOMIZER_P(zval) php_random_randomizer_from_obj(Z_OBJ_P(zval)); + +PHPAPI php_random_status *php_random_status_alloc(const php_random_algo *algo, const bool persistent); +PHPAPI php_random_status *php_random_status_copy(const php_random_algo *algo, php_random_status *old_status, php_random_status *new_status); +PHPAPI void php_random_status_free(php_random_status *status, const bool persistent); +PHPAPI php_random_engine *php_random_engine_common_init(zend_class_entry *ce, zend_object_handlers *handlers, const php_random_algo *algo); +PHPAPI void php_random_engine_common_free_object(zend_object *object); +PHPAPI zend_object *php_random_engine_common_clone_object(zend_object *object); +PHPAPI uint32_t php_random_range32(const php_random_algo *algo, php_random_status *status, uint32_t umax); +PHPAPI uint64_t php_random_range64(const php_random_algo *algo, php_random_status *status, uint64_t umax); +PHPAPI zend_long php_random_range(const php_random_algo *algo, php_random_status *status, zend_long min, zend_long max); +PHPAPI const php_random_algo *php_random_default_algo(void); +PHPAPI php_random_status *php_random_default_status(void); + +PHPAPI zend_string *php_random_bin2hex_le(const void *ptr, const size_t len); +PHPAPI bool php_random_hex2bin_le(zend_string *hexstr, void *dest); + +PHPAPI void php_random_combinedlcg_seed_default(php_random_status_state_combinedlcg *state); + +PHPAPI void php_random_mt19937_seed_default(php_random_status_state_mt19937 *state); + +PHPAPI void php_random_pcgoneseq128xslrr64_advance(php_random_status_state_pcgoneseq128xslrr64 *state, uint64_t advance); + +PHPAPI void php_random_xoshiro256starstar_jump(php_random_status_state_xoshiro256starstar *state); +PHPAPI void php_random_xoshiro256starstar_jump_long(php_random_status_state_xoshiro256starstar *state); + +PHPAPI double php_random_gammasection_closed_open(const php_random_algo *algo, php_random_status *status, double min, double max); +PHPAPI double php_random_gammasection_closed_closed(const php_random_algo *algo, php_random_status *status, double min, double max); +PHPAPI double php_random_gammasection_open_closed(const php_random_algo *algo, php_random_status *status, double min, double max); +PHPAPI double php_random_gammasection_open_open(const php_random_algo *algo, php_random_status *status, double min, double max); + +extern zend_module_entry random_module_entry; +# define phpext_random_ptr &random_module_entry + +PHP_MINIT_FUNCTION(random); +PHP_MSHUTDOWN_FUNCTION(random); +PHP_RINIT_FUNCTION(random); + +ZEND_BEGIN_MODULE_GLOBALS(random) + php_random_status *combined_lcg; + bool combined_lcg_seeded; + php_random_status *mt19937; + bool mt19937_seeded; + int random_fd; +ZEND_END_MODULE_GLOBALS(random) + +PHPAPI ZEND_EXTERN_MODULE_GLOBALS(random) + +# define RANDOM_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(random, v) + +#endif /* PHP_RANDOM_H */ diff --git a/include/php/ext/session/mod_files.h b/include/php/ext/session/mod_files.h new file mode 100644 index 0000000..31ed4af --- /dev/null +++ b/include/php/ext/session/mod_files.h @@ -0,0 +1,25 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ + */ + +#ifndef MOD_FILES_H +#define MOD_FILES_H + +extern const ps_module ps_mod_files; +#define ps_files_ptr &ps_mod_files + +PS_FUNCS_UPDATE_TIMESTAMP(files); + +#endif diff --git a/include/php/ext/session/mod_user.h b/include/php/ext/session/mod_user.h new file mode 100644 index 0000000..58772b4 --- /dev/null +++ b/include/php/ext/session/mod_user.h @@ -0,0 +1,25 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ + */ + +#ifndef MOD_USER_H +#define MOD_USER_H + +extern const ps_module ps_mod_user; +#define ps_user_ptr &ps_mod_user + +PS_FUNCS_UPDATE_TIMESTAMP(user); + +#endif diff --git a/include/php/ext/session/php_session.h b/include/php/ext/session/php_session.h new file mode 100644 index 0000000..341aac5 --- /dev/null +++ b/include/php/ext/session/php_session.h @@ -0,0 +1,323 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_SESSION_H +#define PHP_SESSION_H + +#include "ext/standard/php_var.h" +#include "ext/hash/php_hash.h" + +#define PHP_SESSION_API 20161017 + +#include "php_version.h" +#define PHP_SESSION_VERSION PHP_VERSION + +/* save handler macros */ +#define PS_OPEN_ARGS void **mod_data, const char *save_path, const char *session_name +#define PS_CLOSE_ARGS void **mod_data +#define PS_READ_ARGS void **mod_data, zend_string *key, zend_string **val, zend_long maxlifetime +#define PS_WRITE_ARGS void **mod_data, zend_string *key, zend_string *val, zend_long maxlifetime +#define PS_DESTROY_ARGS void **mod_data, zend_string *key +#define PS_GC_ARGS void **mod_data, zend_long maxlifetime, zend_long *nrdels +#define PS_CREATE_SID_ARGS void **mod_data +#define PS_VALIDATE_SID_ARGS void **mod_data, zend_string *key +#define PS_UPDATE_TIMESTAMP_ARGS void **mod_data, zend_string *key, zend_string *val, zend_long maxlifetime + +typedef struct ps_module_struct { + const char *s_name; + zend_result (*s_open)(PS_OPEN_ARGS); + zend_result (*s_close)(PS_CLOSE_ARGS); + zend_result (*s_read)(PS_READ_ARGS); + zend_result (*s_write)(PS_WRITE_ARGS); + zend_result (*s_destroy)(PS_DESTROY_ARGS); + zend_long (*s_gc)(PS_GC_ARGS); + zend_string *(*s_create_sid)(PS_CREATE_SID_ARGS); + zend_result (*s_validate_sid)(PS_VALIDATE_SID_ARGS); + zend_result (*s_update_timestamp)(PS_UPDATE_TIMESTAMP_ARGS); +} ps_module; + +#define PS_GET_MOD_DATA() *mod_data +#define PS_SET_MOD_DATA(a) *mod_data = (a) + +#define PS_OPEN_FUNC(x) zend_result ps_open_##x(PS_OPEN_ARGS) +#define PS_CLOSE_FUNC(x) zend_result ps_close_##x(PS_CLOSE_ARGS) +#define PS_READ_FUNC(x) zend_result ps_read_##x(PS_READ_ARGS) +#define PS_WRITE_FUNC(x) zend_result ps_write_##x(PS_WRITE_ARGS) +#define PS_DESTROY_FUNC(x) zend_result ps_delete_##x(PS_DESTROY_ARGS) +#define PS_GC_FUNC(x) zend_long ps_gc_##x(PS_GC_ARGS) +#define PS_CREATE_SID_FUNC(x) zend_string *ps_create_sid_##x(PS_CREATE_SID_ARGS) +#define PS_VALIDATE_SID_FUNC(x) zend_result ps_validate_sid_##x(PS_VALIDATE_SID_ARGS) +#define PS_UPDATE_TIMESTAMP_FUNC(x) zend_result ps_update_timestamp_##x(PS_UPDATE_TIMESTAMP_ARGS) + +/* Legacy save handler module definitions */ +#define PS_FUNCS(x) \ + PS_OPEN_FUNC(x); \ + PS_CLOSE_FUNC(x); \ + PS_READ_FUNC(x); \ + PS_WRITE_FUNC(x); \ + PS_DESTROY_FUNC(x); \ + PS_GC_FUNC(x); \ + PS_CREATE_SID_FUNC(x) + +#define PS_MOD(x) \ + #x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \ + ps_delete_##x, ps_gc_##x, php_session_create_id, \ + php_session_validate_sid, php_session_update_timestamp + +/* Legacy SID creation enabled save handler module definitions */ +#define PS_FUNCS_SID(x) \ + PS_OPEN_FUNC(x); \ + PS_CLOSE_FUNC(x); \ + PS_READ_FUNC(x); \ + PS_WRITE_FUNC(x); \ + PS_DESTROY_FUNC(x); \ + PS_GC_FUNC(x); \ + PS_CREATE_SID_FUNC(x); \ + PS_VALIDATE_SID_FUNC(x); \ + PS_UPDATE_TIMESTAMP_FUNC(x); + +#define PS_MOD_SID(x) \ + #x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \ + ps_delete_##x, ps_gc_##x, ps_create_sid_##x, \ + php_session_validate_sid, php_session_update_timestamp + +/* Update timestamp enabled save handler module definitions + New save handlers should use this API */ +#define PS_FUNCS_UPDATE_TIMESTAMP(x) \ + PS_OPEN_FUNC(x); \ + PS_CLOSE_FUNC(x); \ + PS_READ_FUNC(x); \ + PS_WRITE_FUNC(x); \ + PS_DESTROY_FUNC(x); \ + PS_GC_FUNC(x); \ + PS_CREATE_SID_FUNC(x); \ + PS_VALIDATE_SID_FUNC(x); \ + PS_UPDATE_TIMESTAMP_FUNC(x); + +#define PS_MOD_UPDATE_TIMESTAMP(x) \ + #x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \ + ps_delete_##x, ps_gc_##x, ps_create_sid_##x, \ + ps_validate_sid_##x, ps_update_timestamp_##x + + +typedef enum { + php_session_disabled, + php_session_none, + php_session_active +} php_session_status; + +typedef struct _php_session_rfc1867_progress { + size_t sname_len; + zval sid; + smart_str key; + + zend_long update_step; + zend_long next_update; + double next_update_time; + bool cancel_upload; + bool apply_trans_sid; + size_t content_length; + + zval data; /* the array exported to session data */ + zval *post_bytes_processed; /* data["bytes_processed"] */ + zval files; /* data["files"] array */ + zval current_file; /* array of currently uploading file */ + zval *current_file_bytes_processed; +} php_session_rfc1867_progress; + +typedef struct _php_ps_globals { + char *save_path; + char *session_name; + zend_string *id; + char *extern_referer_chk; + char *cache_limiter; + zend_long cookie_lifetime; + char *cookie_path; + char *cookie_domain; + bool cookie_secure; + bool cookie_httponly; + char *cookie_samesite; + const ps_module *mod; + const ps_module *default_mod; + void *mod_data; + php_session_status session_status; + zend_string *session_started_filename; + uint32_t session_started_lineno; + zend_long gc_probability; + zend_long gc_divisor; + zend_long gc_maxlifetime; + int module_number; + zend_long cache_expire; + struct { + zval ps_open; + zval ps_close; + zval ps_read; + zval ps_write; + zval ps_destroy; + zval ps_gc; + zval ps_create_sid; + zval ps_validate_sid; + zval ps_update_timestamp; + } mod_user_names; + bool mod_user_implemented; + bool mod_user_is_open; + zend_string *mod_user_class_name; + const struct ps_serializer_struct *serializer; + zval http_session_vars; + bool auto_start; + bool use_cookies; + bool use_only_cookies; + bool use_trans_sid; /* contains the INI value of whether to use trans-sid */ + + zend_long sid_length; + zend_long sid_bits_per_character; + bool send_cookie; + bool define_sid; + + php_session_rfc1867_progress *rfc1867_progress; + bool rfc1867_enabled; /* session.upload_progress.enabled */ + bool rfc1867_cleanup; /* session.upload_progress.cleanup */ + char *rfc1867_prefix; /* session.upload_progress.prefix */ + char *rfc1867_name; /* session.upload_progress.name */ + zend_long rfc1867_freq; /* session.upload_progress.freq */ + double rfc1867_min_freq; /* session.upload_progress.min_freq */ + + bool use_strict_mode; /* whether or not PHP accepts unknown session ids */ + bool lazy_write; /* omit session write when it is possible */ + bool in_save_handler; /* state if session is in save handler or not */ + bool set_handler; /* state if session module i setting handler or not */ + zend_string *session_vars; /* serialized original session data */ +} php_ps_globals; + +typedef php_ps_globals zend_ps_globals; + +extern zend_module_entry session_module_entry; +#define phpext_session_ptr &session_module_entry + +#ifdef ZTS +#define PS(v) ZEND_TSRMG(ps_globals_id, php_ps_globals *, v) +#ifdef COMPILE_DL_SESSION +ZEND_TSRMLS_CACHE_EXTERN() +#endif +#else +#define PS(v) (ps_globals.v) +#endif + +#define PS_SERIALIZER_ENCODE_ARGS void +#define PS_SERIALIZER_DECODE_ARGS const char *val, size_t vallen + +typedef struct ps_serializer_struct { + const char *name; + zend_string *(*encode)(PS_SERIALIZER_ENCODE_ARGS); + zend_result (*decode)(PS_SERIALIZER_DECODE_ARGS); +} ps_serializer; + +#define PS_SERIALIZER_ENCODE_NAME(x) ps_srlzr_encode_##x +#define PS_SERIALIZER_DECODE_NAME(x) ps_srlzr_decode_##x + +#define PS_SERIALIZER_ENCODE_FUNC(x) \ + zend_string *PS_SERIALIZER_ENCODE_NAME(x)(PS_SERIALIZER_ENCODE_ARGS) +#define PS_SERIALIZER_DECODE_FUNC(x) \ + zend_result PS_SERIALIZER_DECODE_NAME(x)(PS_SERIALIZER_DECODE_ARGS) + +#define PS_SERIALIZER_FUNCS(x) \ + PS_SERIALIZER_ENCODE_FUNC(x); \ + PS_SERIALIZER_DECODE_FUNC(x) + +#define PS_SERIALIZER_ENTRY(x) \ + { #x, PS_SERIALIZER_ENCODE_NAME(x), PS_SERIALIZER_DECODE_NAME(x) } + +/* default create id function */ +PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS); +/* Dummy PS module functions */ +PHPAPI zend_result php_session_validate_sid(PS_VALIDATE_SID_ARGS); +PHPAPI zend_result php_session_update_timestamp(PS_UPDATE_TIMESTAMP_ARGS); + +PHPAPI void session_adapt_url(const char *url, size_t url_len, char **new_url, size_t *new_len); + +PHPAPI zend_result php_session_destroy(void); +PHPAPI void php_add_session_var(zend_string *name); +PHPAPI zval *php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash); +PHPAPI zval *php_get_session_var(zend_string *name); + +PHPAPI zend_result php_session_register_module(const ps_module *); + +PHPAPI zend_result php_session_register_serializer(const char *name, + zend_string *(*encode)(PS_SERIALIZER_ENCODE_ARGS), + zend_result (*decode)(PS_SERIALIZER_DECODE_ARGS)); + +PHPAPI zend_result php_session_start(void); +PHPAPI zend_result php_session_flush(int write); + +PHPAPI const ps_module *_php_find_ps_module(const char *name); +PHPAPI const ps_serializer *_php_find_ps_serializer(const char *name); + +PHPAPI zend_result php_session_valid_key(const char *key); +PHPAPI zend_result php_session_reset_id(void); + +#define PS_ADD_VARL(name) do { \ + php_add_session_var(name); \ +} while (0) + +#define PS_ADD_VAR(name) PS_ADD_VARL(name) + +#define PS_DEL_VARL(name) do { \ + if (!Z_ISNULL(PS(http_session_vars))) { \ + zend_hash_del(Z_ARRVAL(PS(http_session_vars)), name); \ + } \ +} while (0) + + +#define PS_ENCODE_VARS \ + zend_string *key; \ + zend_ulong num_key; \ + zval *struc; + +#define PS_ENCODE_LOOP(code) do { \ + HashTable *_ht = Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))); \ + ZEND_HASH_FOREACH_KEY(_ht, num_key, key) { \ + if (key == NULL) { \ + php_error_docref(NULL, E_WARNING, \ + "Skipping numeric key " ZEND_LONG_FMT, num_key);\ + continue; \ + } \ + if ((struc = php_get_session_var(key))) { \ + code; \ + } \ + } ZEND_HASH_FOREACH_END(); \ +} while(0) + +PHPAPI ZEND_EXTERN_MODULE_GLOBALS(ps) + +void php_session_auto_start(void *data); + +extern PHPAPI zend_class_entry *php_session_class_entry; + +extern PHPAPI zend_class_entry *php_session_iface_entry; + +extern PHPAPI zend_class_entry *php_session_id_iface_entry; + +extern PHPAPI zend_class_entry *php_session_update_timestamp_iface_entry; + +extern PHP_METHOD(SessionHandler, open); +extern PHP_METHOD(SessionHandler, close); +extern PHP_METHOD(SessionHandler, read); +extern PHP_METHOD(SessionHandler, write); +extern PHP_METHOD(SessionHandler, destroy); +extern PHP_METHOD(SessionHandler, gc); +extern PHP_METHOD(SessionHandler, create_sid); + +#endif diff --git a/include/php/ext/simplexml/php_simplexml.h b/include/php/ext/simplexml/php_simplexml.h new file mode 100644 index 0000000..da5a2f2 --- /dev/null +++ b/include/php/ext/simplexml/php_simplexml.h @@ -0,0 +1,85 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sterling Hughes | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_SIMPLEXML_H +#define PHP_SIMPLEXML_H + +extern zend_module_entry simplexml_module_entry; +#define phpext_simplexml_ptr &simplexml_module_entry + +#include "php_version.h" +#define PHP_SIMPLEXML_VERSION PHP_VERSION + +#ifdef ZTS +#include "TSRM.h" +#endif + +#include "ext/libxml/php_libxml.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +PHP_MINIT_FUNCTION(simplexml); +PHP_MSHUTDOWN_FUNCTION(simplexml); +PHP_MINFO_FUNCTION(simplexml); + +typedef enum { + SXE_ITER_NONE = 0, + SXE_ITER_ELEMENT = 1, + SXE_ITER_CHILD = 2, + SXE_ITER_ATTRLIST = 3 +} SXE_ITER; + +typedef struct { + php_libxml_node_ptr *node; + php_libxml_ref_obj *document; + HashTable *properties; + xmlXPathContextPtr xpath; + struct { + xmlChar *name; + xmlChar *nsprefix; + int isprefix; + SXE_ITER type; + zval data; + } iter; + zval tmp; + zend_function *fptr_count; + zend_object zo; +} php_sxe_object; + +#ifdef PHP_WIN32 +# ifdef PHP_SIMPLEXML_EXPORTS +# define PHP_SXE_API __declspec(dllexport) +# else +# define PHP_SXE_API __declspec(dllimport) +# endif +#else +# define PHP_SXE_API ZEND_API +#endif + +extern PHP_SXE_API zend_class_entry *ce_SimpleXMLIterator; +extern PHP_SXE_API zend_class_entry *ce_SimpleXMLElement; + +PHP_SXE_API zend_class_entry *sxe_get_element_class_entry(void); + +#endif diff --git a/include/php/ext/simplexml/php_simplexml_exports.h b/include/php/ext/simplexml/php_simplexml_exports.h new file mode 100644 index 0000000..4ae0267 --- /dev/null +++ b/include/php/ext/simplexml/php_simplexml_exports.h @@ -0,0 +1,55 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sterling Hughes | + | Marcus Boerger | + | Rob Richards | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_SIMPLEXML_EXPORTS_H +#define PHP_SIMPLEXML_EXPORTS_H + +#include "php_simplexml.h" + +#define SKIP_TEXT(__p) \ + if ((__p)->type == XML_TEXT_NODE) { \ + goto next_iter; \ + } + +#define GET_NODE(__s, __n) { \ + if ((__s)->node && (__s)->node->node) { \ + __n = (__s)->node->node; \ + } else { \ + __n = NULL; \ + zend_throw_error(NULL, "SimpleXMLElement is not properly initialized"); \ + } \ +} + +PHP_SXE_API zend_object *sxe_object_new(zend_class_entry *ce); + +static inline php_sxe_object *php_sxe_fetch_object(zend_object *obj) /* {{{ */ { + return (php_sxe_object *)((char*)(obj) - XtOffsetOf(php_sxe_object, zo)); +} +/* }}} */ + +#define Z_SXEOBJ_P(zv) php_sxe_fetch_object(Z_OBJ_P((zv))) + +typedef struct { + zend_object_iterator intern; + php_sxe_object *sxe; +} php_sxe_iterator; + +PHP_SXE_API void php_sxe_rewind_iterator(php_sxe_object *sxe); +PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe); + +#endif /* PHP_SIMPLEXML_EXPORTS_H */ diff --git a/include/php/ext/spl/php_spl.h b/include/php/ext/spl/php_spl.h new file mode 100644 index 0000000..1fab66e --- /dev/null +++ b/include/php/ext/spl/php_spl.h @@ -0,0 +1,55 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_SPL_H +#define PHP_SPL_H + +#include "php.h" +#include + +#define PHP_SPL_VERSION PHP_VERSION + +extern zend_module_entry spl_module_entry; +#define phpext_spl_ptr &spl_module_entry + +#ifdef PHP_WIN32 +# ifdef SPL_EXPORTS +# define SPL_API __declspec(dllexport) +# elif defined(COMPILE_DL_SPL) +# define SPL_API __declspec(dllimport) +# else +# define SPL_API /* nothing */ +# endif +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define SPL_API __attribute__ ((visibility("default"))) +#else +# define SPL_API +#endif + +#if defined(PHP_WIN32) && !defined(COMPILE_DL_SPL) +#undef phpext_spl +#define phpext_spl NULL +#endif + +PHP_MINIT_FUNCTION(spl); +PHP_MSHUTDOWN_FUNCTION(spl); +PHP_RINIT_FUNCTION(spl); +PHP_RSHUTDOWN_FUNCTION(spl); +PHP_MINFO_FUNCTION(spl); + +PHPAPI zend_string *php_spl_object_hash(zend_object *obj); + +#endif /* PHP_SPL_H */ diff --git a/include/php/ext/spl/spl_array.h b/include/php/ext/spl/spl_array.h new file mode 100644 index 0000000..e3ea2d3 --- /dev/null +++ b/include/php/ext/spl/spl_array.h @@ -0,0 +1,45 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef SPL_ARRAY_H +#define SPL_ARRAY_H + +#include "php.h" +#include "php_spl.h" +#include "spl_iterators.h" + +#define SPL_ARRAY_STD_PROP_LIST 0x00000001 +#define SPL_ARRAY_ARRAY_AS_PROPS 0x00000002 +#define SPL_ARRAY_CHILD_ARRAYS_ONLY 0x00000004 +#define SPL_ARRAY_IS_SELF 0x01000000 +#define SPL_ARRAY_USE_OTHER 0x02000000 +#define SPL_ARRAY_INT_MASK 0xFFFF0000 +#define SPL_ARRAY_CLONE_MASK 0x0100FFFF + +#define SPL_ARRAY_METHOD_NO_ARG 0 +#define SPL_ARRAY_METHOD_CALLBACK_ARG 1 +#define SPL_ARRAY_METHOD_SORT_FLAGS_ARG 2 + +extern PHPAPI zend_class_entry *spl_ce_ArrayObject; +extern PHPAPI zend_class_entry *spl_ce_ArrayIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator; + +PHP_MINIT_FUNCTION(spl_array); + +extern void spl_array_iterator_append(zval *object, zval *append_value); +extern void spl_array_iterator_key(zval *object, zval *return_value); + +#endif /* SPL_ARRAY_H */ diff --git a/include/php/ext/spl/spl_directory.h b/include/php/ext/spl/spl_directory.h new file mode 100644 index 0000000..d036013 --- /dev/null +++ b/include/php/ext/spl/spl_directory.h @@ -0,0 +1,115 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef SPL_DIRECTORY_H +#define SPL_DIRECTORY_H + +#include "php.h" +#include "php_spl.h" + +extern PHPAPI zend_class_entry *spl_ce_SplFileInfo; +extern PHPAPI zend_class_entry *spl_ce_DirectoryIterator; +extern PHPAPI zend_class_entry *spl_ce_FilesystemIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveDirectoryIterator; +extern PHPAPI zend_class_entry *spl_ce_GlobIterator; +extern PHPAPI zend_class_entry *spl_ce_SplFileObject; +extern PHPAPI zend_class_entry *spl_ce_SplTempFileObject; + +PHP_MINIT_FUNCTION(spl_directory); + +/* Internal objecte structure and helpers for Directory and File SPL objects */ +typedef struct _spl_filesystem_object spl_filesystem_object; + +typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object); +typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst); + +PHPAPI zend_string *spl_filesystem_object_get_path(spl_filesystem_object *intern); + +typedef struct _spl_other_handler { + spl_foreign_dtor_t dtor; + spl_foreign_clone_t clone; +} spl_other_handler; + +typedef enum { + SPL_FS_INFO, /* must be 0 */ + SPL_FS_DIR, + SPL_FS_FILE +} SPL_FS_OBJ_TYPE; + +struct _spl_filesystem_object { + void *oth; + const spl_other_handler *oth_handler; + zend_string *path; + zend_string *orig_path; + zend_string *file_name; + SPL_FS_OBJ_TYPE type; + zend_long flags; + zend_class_entry *file_class; + zend_class_entry *info_class; + union { + struct { + php_stream *dirp; + zend_string *sub_path; + int index; + zend_function *func_rewind; + zend_function *func_next; + zend_function *func_valid; + php_stream_dirent entry; + } dir; + struct { + php_stream *stream; + php_stream_context *context; + zval *zcontext; + zend_string *open_mode; + zval current_zval; + char *current_line; + size_t current_line_len; + size_t max_line_len; + zend_long current_line_num; + zval zresource; + zend_function *func_getCurr; + char delimiter; + char enclosure; + int escape; + } file; + } u; + zend_object std; +}; + +#define SPL_FILE_OBJECT_DROP_NEW_LINE 0x00000001 /* drop new lines */ +#define SPL_FILE_OBJECT_READ_AHEAD 0x00000002 /* read on rewind/next */ +#define SPL_FILE_OBJECT_SKIP_EMPTY 0x00000004 /* skip empty lines */ +#define SPL_FILE_OBJECT_READ_CSV 0x00000008 /* read via fgetcsv */ +#define SPL_FILE_OBJECT_MASK 0x0000000F /* read via fgetcsv */ + +#define SPL_FILE_DIR_CURRENT_AS_FILEINFO 0x00000000 /* make RecursiveDirectoryTree::current() return SplFileInfo */ +#define SPL_FILE_DIR_CURRENT_AS_SELF 0x00000010 /* make RecursiveDirectoryTree::current() return getSelf() */ +#define SPL_FILE_DIR_CURRENT_AS_PATHNAME 0x00000020 /* make RecursiveDirectoryTree::current() return getPathname() */ +#define SPL_FILE_DIR_CURRENT_MODE_MASK 0x000000F0 /* mask RecursiveDirectoryTree::current() */ +#define SPL_FILE_DIR_CURRENT(intern,mode) ((intern->flags&SPL_FILE_DIR_CURRENT_MODE_MASK)==mode) + +#define SPL_FILE_DIR_KEY_AS_PATHNAME 0x00000000 /* make RecursiveDirectoryTree::key() return getPathname() */ +#define SPL_FILE_DIR_KEY_AS_FILENAME 0x00000100 /* make RecursiveDirectoryTree::key() return getFilename() */ +#define SPL_FILE_DIR_KEY_MODE_MASK 0x00000F00 /* mask RecursiveDirectoryTree::key() */ +#define SPL_FILE_NEW_CURRENT_AND_KEY SPL_FILE_DIR_KEY_AS_FILENAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO +#define SPL_FILE_DIR_KEY(intern,mode) ((intern->flags&SPL_FILE_DIR_KEY_MODE_MASK)==mode) + +#define SPL_FILE_DIR_SKIPDOTS 0x00001000 /* Tells whether it should skip dots or not */ +#define SPL_FILE_DIR_UNIXPATHS 0x00002000 /* Whether to unixify path separators */ +#define SPL_FILE_DIR_FOLLOW_SYMLINKS 0x00004000 /* make RecursiveDirectoryTree::hasChildren() follow symlinks */ +#define SPL_FILE_DIR_OTHERS_MASK 0x00007000 /* mask used for get/setFlags */ + +#endif /* SPL_DIRECTORY_H */ diff --git a/include/php/ext/spl/spl_dllist.h b/include/php/ext/spl/spl_dllist.h new file mode 100644 index 0000000..6915eb2 --- /dev/null +++ b/include/php/ext/spl/spl_dllist.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Etienne Kneuss | + +----------------------------------------------------------------------+ + */ + +#ifndef SPL_DLLIST_H +#define SPL_DLLIST_H + +#include "php.h" +#include "php_spl.h" + +#define SPL_DLLIST_IT_KEEP 0x00000000 +#define SPL_DLLIST_IT_FIFO 0x00000000 /* FIFO flag makes the iterator traverse the structure as a FirstInFirstOut */ +#define SPL_DLLIST_IT_DELETE 0x00000001 /* Delete flag makes the iterator delete the current element on next */ +#define SPL_DLLIST_IT_LIFO 0x00000002 /* LIFO flag makes the iterator traverse the structure as a LastInFirstOut */ +#define SPL_DLLIST_IT_MASK 0x00000003 /* Mask to isolate flags related to iterators */ +#define SPL_DLLIST_IT_FIX 0x00000004 /* Backward/Forward bit is fixed */ + +extern PHPAPI zend_class_entry *spl_ce_SplDoublyLinkedList; +extern PHPAPI zend_class_entry *spl_ce_SplQueue; +extern PHPAPI zend_class_entry *spl_ce_SplStack; + +PHP_MINIT_FUNCTION(spl_dllist); + +#endif /* SPL_DLLIST_H */ diff --git a/include/php/ext/spl/spl_engine.h b/include/php/ext/spl/spl_engine.h new file mode 100644 index 0000000..48676e8 --- /dev/null +++ b/include/php/ext/spl/spl_engine.h @@ -0,0 +1,45 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef SPL_ENGINE_H +#define SPL_ENGINE_H + +#include "php.h" +#include "php_spl.h" +#include "zend_interfaces.h" + +static inline void spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1) +{ + object_init_ex(retval, pce); + zend_call_known_instance_method_with_1_params(pce->constructor, Z_OBJ_P(retval), NULL, arg1); +} + +static inline void spl_instantiate_arg_ex2( + zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2) +{ + object_init_ex(retval, pce); + zend_call_known_instance_method_with_2_params( + pce->constructor, Z_OBJ_P(retval), NULL, arg1, arg2); +} + +static inline void spl_instantiate_arg_n( + zend_class_entry *pce, zval *retval, uint32_t argc, zval *argv) +{ + object_init_ex(retval, pce); + zend_call_known_instance_method(pce->constructor, Z_OBJ_P(retval), NULL, argc, argv); +} + +#endif /* SPL_ENGINE_H */ diff --git a/include/php/ext/spl/spl_exceptions.h b/include/php/ext/spl/spl_exceptions.h new file mode 100644 index 0000000..93add5a --- /dev/null +++ b/include/php/ext/spl/spl_exceptions.h @@ -0,0 +1,40 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef SPL_EXCEPTIONS_H +#define SPL_EXCEPTIONS_H + +#include "php.h" +#include "php_spl.h" + +extern PHPAPI zend_class_entry *spl_ce_LogicException; +extern PHPAPI zend_class_entry *spl_ce_BadFunctionCallException; +extern PHPAPI zend_class_entry *spl_ce_BadMethodCallException; +extern PHPAPI zend_class_entry *spl_ce_DomainException; +extern PHPAPI zend_class_entry *spl_ce_InvalidArgumentException; +extern PHPAPI zend_class_entry *spl_ce_LengthException; +extern PHPAPI zend_class_entry *spl_ce_OutOfRangeException; + +extern PHPAPI zend_class_entry *spl_ce_RuntimeException; +extern PHPAPI zend_class_entry *spl_ce_OutOfBoundsException; +extern PHPAPI zend_class_entry *spl_ce_OverflowException; +extern PHPAPI zend_class_entry *spl_ce_RangeException; +extern PHPAPI zend_class_entry *spl_ce_UnderflowException; +extern PHPAPI zend_class_entry *spl_ce_UnexpectedValueException; + +PHP_MINIT_FUNCTION(spl_exceptions); + +#endif /* SPL_EXCEPTIONS_H */ diff --git a/include/php/ext/spl/spl_fixedarray.h b/include/php/ext/spl/spl_fixedarray.h new file mode 100644 index 0000000..a6cb838 --- /dev/null +++ b/include/php/ext/spl/spl_fixedarray.h @@ -0,0 +1,25 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Antony Dovgal | + | Etienne Kneuss | + +----------------------------------------------------------------------+ +*/ + +#ifndef SPL_FIXEDARRAY_H +#define SPL_FIXEDARRAY_H + +extern PHPAPI zend_class_entry *spl_ce_SplFixedArray; + +PHP_MINIT_FUNCTION(spl_fixedarray); + +#endif /* SPL_FIXEDARRAY_H */ diff --git a/include/php/ext/spl/spl_functions.h b/include/php/ext/spl/spl_functions.h new file mode 100644 index 0000000..c2c3fb8 --- /dev/null +++ b/include/php/ext/spl/spl_functions.h @@ -0,0 +1,37 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_FUNCTIONS_H +#define PHP_FUNCTIONS_H + +#include "php.h" + +typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type); + +/* sub: whether to allow subclasses/interfaces + allow = 0: allow all classes and interfaces + allow > 0: allow all that match and mask ce_flags + allow < 0: disallow all that match and mask ce_flags + */ +void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags); +void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags); +void spl_add_traits(zval * list, zend_class_entry * pce, int allow, int ce_flags); +void spl_add_classes(zend_class_entry *pce, zval *list, bool sub, int allow, int ce_flags); + +/* caller must efree(return) */ +zend_string *spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, size_t prop_len); + +#endif /* PHP_FUNCTIONS_H */ diff --git a/include/php/ext/spl/spl_heap.h b/include/php/ext/spl/spl_heap.h new file mode 100644 index 0000000..42f803a --- /dev/null +++ b/include/php/ext/spl/spl_heap.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Etienne Kneuss | + +----------------------------------------------------------------------+ + */ + +#ifndef SPL_HEAP_H +#define SPL_HEAP_H + +#include "php.h" +#include "php_spl.h" + +#define SPL_PQUEUE_EXTR_MASK 0x00000003 +#define SPL_PQUEUE_EXTR_BOTH 0x00000003 +#define SPL_PQUEUE_EXTR_DATA 0x00000001 +#define SPL_PQUEUE_EXTR_PRIORITY 0x00000002 + +extern PHPAPI zend_class_entry *spl_ce_SplHeap; +extern PHPAPI zend_class_entry *spl_ce_SplMinHeap; +extern PHPAPI zend_class_entry *spl_ce_SplMaxHeap; + +extern PHPAPI zend_class_entry *spl_ce_SplPriorityQueue; + +PHP_MINIT_FUNCTION(spl_heap); + +#endif /* SPL_HEAP_H */ diff --git a/include/php/ext/spl/spl_iterators.h b/include/php/ext/spl/spl_iterators.h new file mode 100644 index 0000000..3c78bb9 --- /dev/null +++ b/include/php/ext/spl/spl_iterators.h @@ -0,0 +1,119 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef SPL_ITERATORS_H +#define SPL_ITERATORS_H + +#include "php.h" +#include "php_spl.h" + +extern PHPAPI zend_class_entry *spl_ce_AppendIterator; +extern PHPAPI zend_class_entry *spl_ce_CachingIterator; +extern PHPAPI zend_class_entry *spl_ce_CallbackFilterIterator; +extern PHPAPI zend_class_entry *spl_ce_EmptyIterator; +extern PHPAPI zend_class_entry *spl_ce_FilterIterator; +extern PHPAPI zend_class_entry *spl_ce_InfiniteIterator; +extern PHPAPI zend_class_entry *spl_ce_IteratorIterator; +extern PHPAPI zend_class_entry *spl_ce_LimitIterator; +extern PHPAPI zend_class_entry *spl_ce_NoRewindIterator; +extern PHPAPI zend_class_entry *spl_ce_OuterIterator; +extern PHPAPI zend_class_entry *spl_ce_ParentIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveCachingIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveCallbackFilterIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveFilterIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveRegexIterator; +extern PHPAPI zend_class_entry *spl_ce_RecursiveTreeIterator; +extern PHPAPI zend_class_entry *spl_ce_RegexIterator; +extern PHPAPI zend_class_entry *spl_ce_SeekableIterator; + +PHP_MINIT_FUNCTION(spl_iterators); + + +typedef enum { + RIT_LEAVES_ONLY = 0, + RIT_SELF_FIRST = 1, + RIT_CHILD_FIRST = 2 +} RecursiveIteratorMode; + +#define RIT_CATCH_GET_CHILD CIT_CATCH_GET_CHILD + +typedef enum { + RTIT_BYPASS_CURRENT = 4, + RTIT_BYPASS_KEY = 8 +} RecursiveTreeIteratorFlags; + +typedef enum { + DIT_Default = 0, + DIT_FilterIterator = DIT_Default, + DIT_RecursiveFilterIterator = DIT_Default, + DIT_ParentIterator = DIT_Default, + DIT_LimitIterator, + DIT_CachingIterator, + DIT_RecursiveCachingIterator, + DIT_IteratorIterator, + DIT_NoRewindIterator, + DIT_InfiniteIterator, + DIT_AppendIterator, + DIT_RegexIterator, + DIT_RecursiveRegexIterator, + DIT_CallbackFilterIterator, + DIT_RecursiveCallbackFilterIterator, + DIT_Unknown = ~0 +} dual_it_type; + +typedef enum { + RIT_Default = 0, + RIT_RecursiveIteratorIterator = RIT_Default, + RIT_RecursiveTreeIterator, + RIT_Unknow = ~0 +} recursive_it_it_type; + +enum { + /* public */ + CIT_CALL_TOSTRING = 0x00000001, + CIT_TOSTRING_USE_KEY = 0x00000002, + CIT_TOSTRING_USE_CURRENT = 0x00000004, + CIT_TOSTRING_USE_INNER = 0x00000008, + CIT_CATCH_GET_CHILD = 0x00000010, + CIT_FULL_CACHE = 0x00000100, + CIT_PUBLIC = 0x0000FFFF, + /* private */ + CIT_VALID = 0x00010000, + CIT_HAS_CHILDREN = 0x00020000 +}; + +enum { + /* public */ + REGIT_USE_KEY = 0x00000001, + REGIT_INVERTED = 0x00000002 +}; + +typedef enum { + REGIT_MODE_MATCH, + REGIT_MODE_GET_MATCH, + REGIT_MODE_ALL_MATCHES, + REGIT_MODE_SPLIT, + REGIT_MODE_REPLACE, + REGIT_MODE_MAX +} regex_mode; + +typedef int (*spl_iterator_apply_func_t)(zend_object_iterator *iter, void *puser); + +PHPAPI zend_result spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser); + +#endif /* SPL_ITERATORS_H */ diff --git a/include/php/ext/spl/spl_observer.h b/include/php/ext/spl/spl_observer.h new file mode 100644 index 0000000..fc2141c --- /dev/null +++ b/include/php/ext/spl/spl_observer.h @@ -0,0 +1,37 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef SPL_OBSERVER_H +#define SPL_OBSERVER_H + +#include "php.h" +#include "php_spl.h" + +typedef enum { + MIT_NEED_ANY = 0, + MIT_NEED_ALL = 1, + MIT_KEYS_NUMERIC = 0, + MIT_KEYS_ASSOC = 2 +} MultipleIteratorFlags; + +extern PHPAPI zend_class_entry *spl_ce_SplObserver; +extern PHPAPI zend_class_entry *spl_ce_SplSubject; +extern PHPAPI zend_class_entry *spl_ce_SplObjectStorage; +extern PHPAPI zend_class_entry *spl_ce_MultipleIterator; + +PHP_MINIT_FUNCTION(spl_observer); + +#endif /* SPL_OBSERVER_H */ diff --git a/include/php/ext/standard/base64.h b/include/php/ext/standard/base64.h new file mode 100644 index 0000000..5e1c6f1 --- /dev/null +++ b/include/php/ext/standard/base64.h @@ -0,0 +1,78 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Jim Winstead | + | Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +#ifndef BASE64_H +#define BASE64_H + +/* + * NEON and AVX512 implementation are based on https://github.com/WojciechMula/base64simd + * which is copyrighted to: + * Copyright (c) 2015-2018, Wojciech Mula + * All rights reserved. + * + * SSSE3 and AVX2 implementation are based on https://github.com/aklomp/base64 + * which is copyrighted to: + * + * Copyright (c) 2005-2007, Nick Galbreath + * Copyright (c) 2013-2017, Alfred Klomp + * Copyright (c) 2015-2017, Wojciech Mula + * Copyright (c) 2016-2017, Matthieu Darbois + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if (ZEND_INTRIN_AVX2_FUNC_PTR || ZEND_INTRIN_SSSE3_FUNC_PTR || ZEND_INTRIN_AVX512_FUNC_PTR || ZEND_INTRIN_AVX512_VBMI_FUNC_PTR) && !ZEND_INTRIN_AVX2_NATIVE +PHP_MINIT_FUNCTION(base64_intrin); +#endif + +PHPAPI extern zend_string *php_base64_encode(const unsigned char *, size_t); +PHPAPI extern zend_string *php_base64_decode_ex(const unsigned char *, size_t, bool); + +static inline zend_string *php_base64_encode_str(const zend_string *str) { + return php_base64_encode((const unsigned char*)(ZSTR_VAL(str)), ZSTR_LEN(str)); +} + +static inline zend_string *php_base64_decode(const unsigned char *str, size_t len) { + return php_base64_decode_ex(str, len, 0); +} +static inline zend_string *php_base64_decode_str(const zend_string *str) { + return php_base64_decode_ex((const unsigned char*)(ZSTR_VAL(str)), ZSTR_LEN(str), 0); +} + +#endif /* BASE64_H */ diff --git a/include/php/ext/standard/basic_functions.h b/include/php/ext/standard/basic_functions.h new file mode 100644 index 0000000..34cec37 --- /dev/null +++ b/include/php/ext/standard/basic_functions.h @@ -0,0 +1,142 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef BASIC_FUNCTIONS_H +#define BASIC_FUNCTIONS_H + +#include +#include + +#include "php_filestat.h" + +#include "zend_highlight.h" + +#include "url_scanner_ex.h" + +/* for MT_N */ +#include "ext/random/php_random.h" + +#if defined(_WIN32) && !defined(__clang__) +#include +#endif + +extern zend_module_entry basic_functions_module; +#define basic_functions_module_ptr &basic_functions_module + +PHP_MINIT_FUNCTION(basic); +PHP_MSHUTDOWN_FUNCTION(basic); +PHP_RINIT_FUNCTION(basic); +PHP_RSHUTDOWN_FUNCTION(basic); +PHP_MINFO_FUNCTION(basic); + +ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini); + +PHP_MINIT_FUNCTION(user_filters); +PHP_RSHUTDOWN_FUNCTION(user_filters); +PHP_RSHUTDOWN_FUNCTION(browscap); + +/* Left for BC (not binary safe!) */ +PHPAPI int _php_error_log(int opt_err, const char *message, const char *opt, const char *headers); +PHPAPI int _php_error_log_ex(int opt_err, const char *message, size_t message_len, const char *opt, const char *headers); +PHPAPI int php_prefix_varname(zval *result, zend_string *prefix, const char *var_name, size_t var_name_len, bool add_underscore); + +/* Deprecated type aliases -- use the standard types instead */ +typedef uint32_t php_uint32; +typedef int32_t php_int32; + +typedef struct _php_basic_globals { + HashTable *user_shutdown_function_names; + HashTable putenv_ht; + zend_string *strtok_string; + zend_string *ctype_string; /* current LC_CTYPE locale (or NULL for 'C') */ + bool locale_changed; /* locale was changed and has to be restored */ + char *strtok_last; + char strtok_table[256]; + size_t strtok_len; + zend_fcall_info user_compare_fci; + zend_fcall_info_cache user_compare_fci_cache; + zend_llist *user_tick_functions; + + zval active_ini_file_section; + + /* pageinfo.c */ + zend_long page_uid; + zend_long page_gid; + zend_long page_inode; + time_t page_mtime; + + /* filestat.c && main/streams/streams.c */ + zend_string *CurrentStatFile, *CurrentLStatFile; + php_stream_statbuf ssb, lssb; + + /* syslog.c */ + char *syslog_device; + + /* var.c */ + unsigned serialize_lock; /* whether to use the locally supplied var_hash instead (__sleep/__wakeup) */ + struct { + struct php_serialize_data *data; + unsigned level; + } serialize; + struct { + struct php_unserialize_data *data; + unsigned level; + } unserialize; + + /* url_scanner_ex.re */ + url_adapt_state_ex_t url_adapt_session_ex; + HashTable url_adapt_session_hosts_ht; + url_adapt_state_ex_t url_adapt_output_ex; + HashTable url_adapt_output_hosts_ht; + HashTable *user_filter_map; + + /* file.c */ +#if defined(_REENTRANT) + mbstate_t mblen_state; +#endif + + int umask; + zend_long unserialize_max_depth; +} php_basic_globals; + +#ifdef ZTS +#define BG(v) ZEND_TSRMG(basic_globals_id, php_basic_globals *, v) +PHPAPI extern int basic_globals_id; +#else +#define BG(v) (basic_globals.v) +PHPAPI extern php_basic_globals basic_globals; +#endif + +PHPAPI zend_string *php_getenv(const char *str, size_t str_len); + +PHPAPI double php_get_nan(void); +PHPAPI double php_get_inf(void); + +typedef struct _php_shutdown_function_entry { + zend_fcall_info fci; + zend_fcall_info_cache fci_cache; +} php_shutdown_function_entry; + +PHPAPI extern bool register_user_shutdown_function(const char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry); +PHPAPI extern bool remove_user_shutdown_function(const char *function_name, size_t function_len); +PHPAPI extern bool append_user_shutdown_function(php_shutdown_function_entry *shutdown_function_entry); + +PHPAPI void php_call_shutdown_functions(void); +PHPAPI void php_free_shutdown_functions(void); + + +#endif /* BASIC_FUNCTIONS_H */ diff --git a/include/php/ext/standard/basic_functions_arginfo.h b/include/php/ext/standard/basic_functions_arginfo.h new file mode 100644 index 0000000..99e08fe --- /dev/null +++ b/include/php/ext/standard/basic_functions_arginfo.h @@ -0,0 +1,4023 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 7389d094a842a2289cd32cb37386e5e40ea7e031 */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_header_register_callback, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_start, 0, 0, _IS_BOOL, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, callback, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, chunk_size, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "PHP_OUTPUT_HANDLER_STDFLAGS") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_flush, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_ob_clean arginfo_ob_flush + +#define arginfo_ob_end_flush arginfo_ob_flush + +#define arginfo_ob_end_clean arginfo_ob_flush + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ob_get_flush, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() + +#define arginfo_ob_get_clean arginfo_ob_get_flush + +#define arginfo_ob_get_contents arginfo_ob_get_flush + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_get_level, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ob_get_length, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_list_handlers, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_get_status, 0, 0, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, full_status, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_implicit_flush, 0, 0, IS_VOID, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +#define arginfo_output_reset_rewrite_vars arginfo_ob_flush + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_output_add_rewrite_var, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_wrapper_register, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +#define arginfo_stream_register_wrapper arginfo_stream_wrapper_register + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_wrapper_unregister, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_stream_wrapper_restore arginfo_stream_wrapper_unregister + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_push, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_krsort, 0, 1, IS_TRUE, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SORT_REGULAR") +ZEND_END_ARG_INFO() + +#define arginfo_ksort arginfo_krsort + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 1, IS_LONG, 0) + ZEND_ARG_OBJ_TYPE_MASK(0, value, Countable, MAY_BE_ARRAY, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "COUNT_NORMAL") +ZEND_END_ARG_INFO() + +#define arginfo_sizeof arginfo_count + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_natsort, 0, 1, IS_TRUE, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_natcasesort arginfo_natsort + +#define arginfo_asort arginfo_krsort + +#define arginfo_arsort arginfo_krsort + +#define arginfo_sort arginfo_krsort + +#define arginfo_rsort arginfo_krsort + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_usort, 0, 2, IS_TRUE, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) +ZEND_END_ARG_INFO() + +#define arginfo_uasort arginfo_usort + +#define arginfo_uksort arginfo_usort + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_end, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_MASK(1, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_prev arginfo_end + +#define arginfo_next arginfo_end + +#define arginfo_reset arginfo_end + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_current, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_pos arginfo_current + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_key, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL) + ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_min, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_max arginfo_min + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_walk, 0, 2, IS_TRUE, 0) + ZEND_ARG_TYPE_MASK(1, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) + ZEND_ARG_TYPE_INFO(0, arg, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_array_walk_recursive arginfo_array_walk + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_in_array, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, haystack, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, strict, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_array_search, 0, 2, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, needle, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, haystack, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, strict, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_extract, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(ZEND_SEND_PREFER_REF, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "EXTR_OVERWRITE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prefix, IS_STRING, 0, "\"\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_compact, 0, 1, IS_ARRAY, 0) + ZEND_ARG_INFO(0, var_name) + ZEND_ARG_VARIADIC_INFO(0, var_names) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_fill, 0, 3, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, start_index, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_fill_keys, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_range, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_MASK(0, start, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_DOUBLE, NULL) + ZEND_ARG_TYPE_MASK(0, end, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_DOUBLE, NULL) + ZEND_ARG_TYPE_MASK(0, step, MAY_BE_LONG|MAY_BE_DOUBLE, "1") +ZEND_END_ARG_INFO() + +#define arginfo_shuffle arginfo_natsort + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_pop, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_array_shift arginfo_array_pop + +#define arginfo_array_unshift arginfo_array_push + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_splice, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, replacement, IS_MIXED, 0, "[]") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_slice, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, preserve_keys, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_merge, 0, 0, IS_ARRAY, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, arrays, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_array_merge_recursive arginfo_array_merge + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_replace, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, replacements, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_array_replace_recursive arginfo_array_replace + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_keys, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, filter_value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, strict, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_array_key_first, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_array_key_last arginfo_array_key_first + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_values, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_array_count_values arginfo_array_values + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_column, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_MASK(0, column_key, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL, NULL) + ZEND_ARG_TYPE_MASK(0, index_key, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_reverse, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, preserve_keys, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_pad, 0, 3, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_array_flip arginfo_array_values + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_change_key_case, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, case, IS_LONG, 0, "CASE_LOWER") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_unique, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SORT_STRING") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_intersect_key, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, arrays, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_intersect_ukey, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_VARIADIC_INFO(0, rest) +ZEND_END_ARG_INFO() + +#define arginfo_array_intersect arginfo_array_intersect_key + +#define arginfo_array_uintersect arginfo_array_intersect_ukey + +#define arginfo_array_intersect_assoc arginfo_array_intersect_key + +#define arginfo_array_uintersect_assoc arginfo_array_intersect_ukey + +#define arginfo_array_intersect_uassoc arginfo_array_intersect_ukey + +#define arginfo_array_uintersect_uassoc arginfo_array_intersect_ukey + +#define arginfo_array_diff_key arginfo_array_intersect_key + +#define arginfo_array_diff_ukey arginfo_array_intersect_ukey + +#define arginfo_array_diff arginfo_array_intersect_key + +#define arginfo_array_udiff arginfo_array_intersect_ukey + +#define arginfo_array_diff_assoc arginfo_array_intersect_key + +#define arginfo_array_diff_uassoc arginfo_array_intersect_ukey + +#define arginfo_array_udiff_assoc arginfo_array_intersect_ukey + +#define arginfo_array_udiff_uassoc arginfo_array_intersect_ukey + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_multisort, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, array) + ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, rest) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_array_rand, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_ARRAY) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, num, IS_LONG, 0, "1") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_array_sum, 0, 1, MAY_BE_LONG|MAY_BE_DOUBLE) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_array_product arginfo_array_sum + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_reduce, 0, 2, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, initial, IS_MIXED, 0, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_filter, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_map, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, arrays, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_key_exists, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_key_exists arginfo_array_key_exists + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_chunk, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, preserve_keys, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_combine, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_is_list, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_base64_encode, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_base64_decode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, strict, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_constant, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ip2long, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_long2ip, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, ip, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getenv, 0, 0, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, local_only, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#if defined(HAVE_PUTENV) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_putenv, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, assignment, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getopt, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, short_options, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, long_options, IS_ARRAY, 0, "[]") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, rest_index, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_flush, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sleep, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_usleep, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, microseconds, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#if defined(HAVE_NANOSLEEP) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_time_nanosleep, 0, 2, MAY_BE_ARRAY|MAY_BE_BOOL) + ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, nanoseconds, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_NANOSLEEP) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_time_sleep_until, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, timestamp, IS_DOUBLE, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_current_user, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_cfg_var, 0, 1, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_error_log, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message_type, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destination, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_headers, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_error_get_last, 0, 0, IS_ARRAY, 1) +ZEND_END_ARG_INFO() + +#define arginfo_error_clear_last arginfo_flush + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_call_user_func, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_call_user_func_array, 0, 2, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) + ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_forward_static_call arginfo_call_user_func + +#define arginfo_forward_static_call_array arginfo_call_user_func_array + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_register_shutdown_function, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_highlight_file, 0, 1, MAY_BE_STRING|MAY_BE_BOOL) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#define arginfo_show_source arginfo_highlight_file + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_strip_whitespace, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_highlight_string, 0, 1, MAY_BE_STRING|MAY_BE_BOOL) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_get, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_get_all, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extension, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, details, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_set, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, value, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_BOOL|MAY_BE_NULL, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_ini_alter arginfo_ini_set + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ini_restore, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ini_parse_quantity, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, shorthand, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_set_include_path, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, include_path, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_get_include_path arginfo_ob_get_flush + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_print_r, 0, 1, MAY_BE_STRING|MAY_BE_BOOL) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#define arginfo_connection_aborted arginfo_ob_get_level + +#define arginfo_connection_status arginfo_ob_get_level + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ignore_user_abort, 0, 0, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 1, "null") +ZEND_END_ARG_INFO() + +#if defined(HAVE_GETSERVBYNAME) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getservbyname, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, service, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_GETSERVBYPORT) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getservbyport, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_GETPROTOBYNAME) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getprotobyname, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_GETPROTOBYNUMBER) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getprotobynumber, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, protocol, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_register_tick_function, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unregister_tick_function, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_uploaded_file, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_move_uploaded_file, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_parse_ini_file, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_sections, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scanner_mode, IS_LONG, 0, "INI_SCANNER_NORMAL") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_parse_ini_string, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, ini_string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_sections, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scanner_mode, IS_LONG, 0, "INI_SCANNER_NORMAL") +ZEND_END_ARG_INFO() + +#if ZEND_DEBUG +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_config_get_hash, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_GETLOADAVG) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sys_getloadavg, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_browser, 0, 0, MAY_BE_OBJECT|MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user_agent, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return_array, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crc32, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crypt, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#if defined(HAVE_STRPTIME) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strptime, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, timestamp, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_GETHOSTNAME) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gethostname, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gethostbyaddr, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gethostbyname, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gethostbynamel, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dns_check_record, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_STRING, 0, "\"MX\"") +ZEND_END_ARG_INFO() +#endif + +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) +#define arginfo_checkdnsrr arginfo_dns_check_record +#endif + +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dns_get_record, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "DNS_ANY") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, authoritative_name_servers, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, additional_records, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() +#endif + +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dns_get_mx, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) + ZEND_ARG_INFO(1, hosts) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, weights, "null") +ZEND_END_ARG_INFO() +#endif + +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) +#define arginfo_getmxrr arginfo_dns_get_mx +#endif + +#if (defined(PHP_WIN32) || HAVE_GETIFADDRS || defined(__PASE__)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_net_get_interfaces, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_FTOK) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftok, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, project_id, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hrtime, 0, 0, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_number, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_md5, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_md5_file, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#define arginfo_getmyuid arginfo_ob_get_length + +#define arginfo_getmygid arginfo_ob_get_length + +#define arginfo_getmypid arginfo_ob_get_length + +#define arginfo_getmyinode arginfo_ob_get_length + +#define arginfo_getlastmod arginfo_ob_get_length + +#define arginfo_sha1 arginfo_md5 + +#define arginfo_sha1_file arginfo_md5_file + +#if defined(HAVE_SYSLOG_H) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openlog, 0, 3, IS_TRUE, 0) + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, facility, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_SYSLOG_H) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_closelog, 0, 0, IS_TRUE, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_SYSLOG_H) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_syslog, 0, 2, IS_TRUE, 0) + ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_INET_NTOP) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_inet_ntop, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_INET_PTON) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_inet_pton, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_metaphone, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_phonemes, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_header, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, replace, _IS_BOOL, 0, "true") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, response_code, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_header_remove, 0, 0, IS_VOID, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_setrawcookie, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_MASK(0, expires_or_options, MAY_BE_ARRAY|MAY_BE_LONG, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, path, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, domain, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, secure, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, httponly, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#define arginfo_setcookie arginfo_setrawcookie + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_http_response_code, 0, 0, MAY_BE_LONG|MAY_BE_BOOL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, response_code, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_headers_sent, 0, 0, _IS_BOOL, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, filename, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, line, "null") +ZEND_END_ARG_INFO() + +#define arginfo_headers_list arginfo_ob_list_handlers + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_htmlspecialchars, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, double_encode, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_htmlspecialchars_decode, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_html_entity_decode, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_htmlentities arginfo_htmlspecialchars + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_html_translation_table, 0, 0, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, table, IS_LONG, 0, "HTML_SPECIALCHARS") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 0, "\"UTF-8\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_assert, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, assertion, IS_MIXED, 0) + ZEND_ARG_OBJ_TYPE_MASK(0, description, Throwable, MAY_BE_STRING|MAY_BE_NULL, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_assert_options, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_bin2hex arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hex2bin, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strspn, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, characters, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_strcspn arginfo_strspn + +#if defined(HAVE_NL_LANGINFO) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_nl_langinfo, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, item, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strcoll, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_trim, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, characters, IS_STRING, 0, "\" \\n\\r\\t\\v\\x00\"") +ZEND_END_ARG_INFO() + +#define arginfo_rtrim arginfo_trim + +#define arginfo_chop arginfo_trim + +#define arginfo_ltrim arginfo_trim + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_wordwrap, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, width, IS_LONG, 0, "75") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, break, IS_STRING, 0, "\"\\n\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cut_long_words, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_explode, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, separator, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, limit, IS_LONG, 0, "PHP_INT_MAX") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_implode, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, separator, MAY_BE_STRING|MAY_BE_ARRAY, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, array, IS_ARRAY, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_join arginfo_implode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtok, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, token, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_strtoupper arginfo_base64_encode + +#define arginfo_strtolower arginfo_base64_encode + +#define arginfo_str_increment arginfo_base64_encode + +#define arginfo_str_decrement arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_basename, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, suffix, IS_STRING, 0, "\"\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dirname, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, levels, IS_LONG, 0, "1") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pathinfo, 0, 1, MAY_BE_ARRAY|MAY_BE_STRING) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "PATHINFO_ALL") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stristr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, before_needle, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#define arginfo_strstr arginfo_stristr + +#define arginfo_strchr arginfo_stristr + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strpos, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +#define arginfo_stripos arginfo_strpos + +#define arginfo_strrpos arginfo_strpos + +#define arginfo_strripos arginfo_strpos + +#define arginfo_strrchr arginfo_stristr + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_contains, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_str_starts_with arginfo_str_contains + +#define arginfo_str_ends_with arginfo_str_contains + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chunk_split, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "76") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\r\\n\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_substr, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr_replace, 0, 3, MAY_BE_STRING|MAY_BE_ARRAY) + ZEND_ARG_TYPE_MASK(0, string, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, replace, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, offset, MAY_BE_ARRAY|MAY_BE_LONG, NULL) + ZEND_ARG_TYPE_MASK(0, length, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_NULL, "null") +ZEND_END_ARG_INFO() + +#define arginfo_quotemeta arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ord, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, character, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chr, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, codepoint, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_ucfirst arginfo_base64_encode + +#define arginfo_lcfirst arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ucwords, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separators, IS_STRING, 0, "\" \\t\\r\\n\\f\\v\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strtr, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, from, MAY_BE_STRING|MAY_BE_ARRAY, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, to, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_strrev arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_similar_text, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, percent, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_addcslashes, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, characters, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_addslashes arginfo_base64_encode + +#define arginfo_stripcslashes arginfo_base64_encode + +#define arginfo_stripslashes arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_str_replace, 0, 3, MAY_BE_STRING|MAY_BE_ARRAY) + ZEND_ARG_TYPE_MASK(0, search, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, replace, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, subject, MAY_BE_STRING|MAY_BE_ARRAY, NULL) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, count, "null") +ZEND_END_ARG_INFO() + +#define arginfo_str_ireplace arginfo_str_replace + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hebrev, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_chars_per_line, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_nl2br, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_xhtml, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strip_tags, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, allowed_tags, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_setlocale, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, category, IS_LONG, 0) + ZEND_ARG_INFO(0, locales) + ZEND_ARG_VARIADIC_INFO(0, rest) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_parse_str, 0, 2, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_INFO(1, result) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_getcsv, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\",\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_repeat, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, times, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_count_chars, 0, 1, MAY_BE_ARRAY|MAY_BE_STRING) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +#define arginfo_strnatcmp arginfo_strcoll + +#define arginfo_localeconv arginfo_ob_list_handlers + +#define arginfo_strnatcasecmp arginfo_strcoll + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_substr_count, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_pad, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pad_string, IS_STRING, 0, "\" \"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pad_type, IS_LONG, 0, "STR_PAD_RIGHT") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sscanf, 0, 2, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_NULL) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_str_rot13 arginfo_base64_encode + +#define arginfo_str_shuffle arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_str_word_count, 0, 1, MAY_BE_ARRAY|MAY_BE_LONG) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, characters, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_split, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "1") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strpbrk, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, characters, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_substr_compare, 0, 3, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, case_insensitive, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#define arginfo_utf8_encode arginfo_base64_encode + +#define arginfo_utf8_decode arginfo_base64_encode + +ZEND_BEGIN_ARG_INFO_EX(arginfo_opendir, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_dir, 0, 1, Directory, MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_closedir, 0, 0, IS_VOID, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, dir_handle, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chdir, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#if (defined(HAVE_CHROOT) && !defined(ZTS) && defined(ENABLE_CHROOT_FUNC)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chroot, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#define arginfo_getcwd arginfo_ob_get_flush + +#define arginfo_rewinddir arginfo_closedir + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readdir, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, dir_handle, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_scandir, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sorting_order, IS_LONG, 0, "SCANDIR_SORT_ASCENDING") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +#if defined(HAVE_GLOB) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_glob, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exec, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, output, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, result_code, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_system, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, result_code, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_passthru, 0, 1, IS_FALSE, 1) + ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, result_code, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_escapeshellcmd, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_escapeshellarg, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, arg, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_shell_exec, 0, 1, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL) + ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#if defined(HAVE_NICE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_proc_nice, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_flock, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, operation, IS_LONG, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, would_block, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_meta_tags, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pclose, 0, 1, IS_LONG, 0) + ZEND_ARG_INFO(0, handle) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_popen, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readfile, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rewind, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rmdir, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_umask, 0, 0, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mask, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_fclose arginfo_rewind + +#define arginfo_feof arginfo_rewind + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgetc, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgets, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fread, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_fopen, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fscanf, 0, 2, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_NULL) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fpassthru, 0, 1, IS_LONG, 0) + ZEND_ARG_INFO(0, stream) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftruncate, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fstat, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fseek, 0, 2, IS_LONG, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "SEEK_SET") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftell, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) +ZEND_END_ARG_INFO() + +#define arginfo_fflush arginfo_rewind + +#define arginfo_fsync arginfo_rewind + +#define arginfo_fdatasync arginfo_rewind + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fwrite, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_fputs arginfo_fwrite + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mkdir, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, permissions, IS_LONG, 0, "0777") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, recursive, _IS_BOOL, 0, "false") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rename, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +#define arginfo_copy arginfo_rename + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_tempnam, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_tmpfile, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_file, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_file_get_contents, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unlink, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_file_put_contents, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, data, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fputcsv, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, fields, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\",\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, eol, IS_STRING, 0, "\"\\n\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgetcsv, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\",\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_realpath, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#if defined(HAVE_FNMATCH) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fnmatch, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() +#endif + +#define arginfo_sys_get_temp_dir arginfo_get_current_user + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fileatime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_filectime arginfo_fileatime + +#define arginfo_filegroup arginfo_fileatime + +#define arginfo_fileinode arginfo_fileatime + +#define arginfo_filemtime arginfo_fileatime + +#define arginfo_fileowner arginfo_fileatime + +#define arginfo_fileperms arginfo_fileatime + +#define arginfo_filesize arginfo_fileatime + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_filetype, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_file_exists arginfo_is_uploaded_file + +#define arginfo_is_writable arginfo_is_uploaded_file + +#define arginfo_is_writeable arginfo_is_uploaded_file + +#define arginfo_is_readable arginfo_is_uploaded_file + +#define arginfo_is_executable arginfo_is_uploaded_file + +#define arginfo_is_file arginfo_is_uploaded_file + +#define arginfo_is_dir arginfo_is_uploaded_file + +#define arginfo_is_link arginfo_is_uploaded_file + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stat, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_lstat arginfo_stat + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chown, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, user, MAY_BE_STRING|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chgrp, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, group, MAY_BE_STRING|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() + +#if defined(HAVE_LCHOWN) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_lchown, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, user, MAY_BE_STRING|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_LCHOWN) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_lchgrp, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, group, MAY_BE_STRING|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chmod, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, permissions, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#if defined(HAVE_UTIME) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_touch, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mtime, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, atime, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_clearstatcache, 0, 0, IS_VOID, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, clear_realpath_cache, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 0, "\"\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_disk_total_space, 0, 1, MAY_BE_DOUBLE|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_disk_free_space arginfo_disk_total_space + +#define arginfo_diskfreespace arginfo_disk_total_space + +#define arginfo_realpath_cache_get arginfo_ob_list_handlers + +#define arginfo_realpath_cache_size arginfo_ob_get_level + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sprintf, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_printf, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_vprintf, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_vsprintf, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fprintf, 0, 2, IS_LONG, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_vfprintf, 0, 3, IS_LONG, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "-1") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_code, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_message, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_DOUBLE, 1, "null") +ZEND_END_ARG_INFO() + +#define arginfo_pfsockopen arginfo_fsockopen + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_http_build_query, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, data, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numeric_prefix, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg_separator, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding_type, IS_LONG, 0, "PHP_QUERY_RFC1738") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_image_type_to_mime_type, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, image_type, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_image_type_to_extension, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, image_type, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, include_dot, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getimagesize, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, image_info, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getimagesizefromstring, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, image_info, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpinfo, 0, 0, IS_TRUE, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "INFO_ALL") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_phpversion, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extension, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpcredits, 0, 0, IS_TRUE, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "CREDITS_ALL") +ZEND_END_ARG_INFO() + +#define arginfo_php_sapi_name arginfo_ob_get_flush + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_uname, 0, 0, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"a\"") +ZEND_END_ARG_INFO() + +#define arginfo_php_ini_scanned_files arginfo_ob_get_flush + +#define arginfo_php_ini_loaded_file arginfo_ob_get_flush + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iptcembed, 0, 2, MAY_BE_STRING|MAY_BE_BOOL) + ZEND_ARG_TYPE_INFO(0, iptc_data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, spool, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iptcparse, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, iptc_block, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_levenshtein, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, insertion_cost, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, replacement_cost, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, deletion_cost, IS_LONG, 0, "1") +ZEND_END_ARG_INFO() + +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readlink, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_linkinfo, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_symlink, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, target, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, link, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) +#define arginfo_link arginfo_symlink +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mail, 0, 3, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, additional_headers, MAY_BE_ARRAY|MAY_BE_STRING, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_params, IS_STRING, 0, "\"\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_abs, 0, 1, MAY_BE_LONG|MAY_BE_DOUBLE) + ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ceil, 0, 1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_floor arginfo_ceil + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_round, 0, 1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, precision, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PHP_ROUND_HALF_UP") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sin, 0, 1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_DOUBLE, 0) +ZEND_END_ARG_INFO() + +#define arginfo_cos arginfo_sin + +#define arginfo_tan arginfo_sin + +#define arginfo_asin arginfo_sin + +#define arginfo_acos arginfo_sin + +#define arginfo_atan arginfo_sin + +#define arginfo_atanh arginfo_sin + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_atan2, 0, 2, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +ZEND_END_ARG_INFO() + +#define arginfo_sinh arginfo_sin + +#define arginfo_cosh arginfo_sin + +#define arginfo_tanh arginfo_sin + +#define arginfo_asinh arginfo_sin + +#define arginfo_acosh arginfo_sin + +#define arginfo_expm1 arginfo_sin + +#define arginfo_log1p arginfo_sin + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pi, 0, 0, IS_DOUBLE, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_finite, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_DOUBLE, 0) +ZEND_END_ARG_INFO() + +#define arginfo_is_nan arginfo_is_finite + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intdiv, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, num1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, num2, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_is_infinite arginfo_is_finite + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pow, 0, 2, MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_OBJECT) + ZEND_ARG_TYPE_INFO(0, num, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, exponent, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_exp arginfo_sin + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_log, 0, 1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_DOUBLE, 0, "M_E") +ZEND_END_ARG_INFO() + +#define arginfo_log10 arginfo_sin + +#define arginfo_sqrt arginfo_sin + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hypot, 0, 2, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +ZEND_END_ARG_INFO() + +#define arginfo_deg2rad arginfo_sin + +#define arginfo_rad2deg arginfo_sin + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bindec, 0, 1, MAY_BE_LONG|MAY_BE_DOUBLE) + ZEND_ARG_TYPE_INFO(0, binary_string, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hexdec, 0, 1, MAY_BE_LONG|MAY_BE_DOUBLE) + ZEND_ARG_TYPE_INFO(0, hex_string, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_octdec, 0, 1, MAY_BE_LONG|MAY_BE_DOUBLE) + ZEND_ARG_TYPE_INFO(0, octal_string, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_decbin, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_decoct arginfo_decbin + +#define arginfo_dechex arginfo_decbin + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_base_convert, 0, 3, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, from_base, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, to_base, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_number_format, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, decimals, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, decimal_separator, IS_STRING, 1, "\".\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, thousands_separator, IS_STRING, 1, "\",\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fmod, 0, 2, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num2, IS_DOUBLE, 0) +ZEND_END_ARG_INFO() + +#define arginfo_fdiv arginfo_fmod + +#if defined(HAVE_GETTIMEOFDAY) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_microtime, 0, 0, MAY_BE_STRING|MAY_BE_DOUBLE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_float, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_GETTIMEOFDAY) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gettimeofday, 0, 0, MAY_BE_ARRAY|MAY_BE_DOUBLE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_float, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_GETRUSAGE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getrusage, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() +#endif + +#define arginfo_pack arginfo_sprintf + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_unpack, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_password_get_info, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_password_hash, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, algo, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_password_needs_rehash, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, algo, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_password_verify, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_password_algos arginfo_ob_list_handlers + +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) +ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_open, 0, 0, 3) + ZEND_ARG_TYPE_MASK(0, command, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO(0, descriptor_spec, IS_ARRAY, 0) + ZEND_ARG_INFO(1, pipes) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cwd, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, env_vars, IS_ARRAY, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") +ZEND_END_ARG_INFO() +#endif + +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_proc_close, 0, 1, IS_LONG, 0) + ZEND_ARG_INFO(0, process) +ZEND_END_ARG_INFO() +#endif + +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_proc_terminate, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, process) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, signal, IS_LONG, 0, "15") +ZEND_END_ARG_INFO() +#endif + +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_proc_get_status, 0, 1, IS_ARRAY, 0) + ZEND_ARG_INFO(0, process) +ZEND_END_ARG_INFO() +#endif + +#define arginfo_quoted_printable_decode arginfo_base64_encode + +#define arginfo_quoted_printable_encode arginfo_base64_encode + +#define arginfo_soundex arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(1, except, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 1) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microseconds, IS_LONG, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_context_set_params, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, context) + ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_context_get_params, 0, 1, IS_ARRAY, 0) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_context_set_option, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, context) + ZEND_ARG_TYPE_MASK(0, wrapper_or_options, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option_name, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_context_set_options, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, context) + ZEND_ARG_TYPE_INFO(0, options, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_context_get_options, 0, 1, IS_ARRAY, 0) + ZEND_ARG_INFO(0, stream_or_context) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_default, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_set_default, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, options, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, filter_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO(0, params, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_stream_filter_append arginfo_stream_filter_prepend + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_filter_remove, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream_filter) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, address, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_code, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_message, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_DOUBLE, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "STREAM_CLIENT_CONNECT") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, address, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_code, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_message, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "STREAM_SERVER_BIND | STREAM_SERVER_LISTEN") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_accept, 0, 0, 1) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_DOUBLE, 1, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, peer_name, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_get_name, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_TYPE_INFO(0, remote, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_recvfrom, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, address, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_sendto, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, address, IS_STRING, 0, "\"\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_enable_crypto, 0, 2, MAY_BE_LONG|MAY_BE_BOOL) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, crypto_method, IS_LONG, 1, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, session_stream, "null") +ZEND_END_ARG_INFO() + +#if defined(HAVE_SHUTDOWN) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_socket_shutdown, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(HAVE_SOCKETPAIR) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_pair, 0, 3, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, domain, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, protocol, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_copy_to_stream, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_INFO(0, from) + ZEND_ARG_INFO(0, to) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_get_contents, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "-1") +ZEND_END_ARG_INFO() + +#define arginfo_stream_supports_lock arginfo_rewind + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_set_write_buffer, 0, 2, IS_LONG, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_set_file_buffer arginfo_stream_set_write_buffer + +#define arginfo_stream_set_read_buffer arginfo_stream_set_write_buffer + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_set_blocking, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_socket_set_blocking arginfo_stream_set_blocking + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_get_meta_data, 0, 1, IS_ARRAY, 0) + ZEND_ARG_INFO(0, stream) +ZEND_END_ARG_INFO() + +#define arginfo_socket_get_status arginfo_stream_get_meta_data + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_get_line, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ending, IS_STRING, 0, "\"\"") +ZEND_END_ARG_INFO() + +#define arginfo_stream_resolve_include_path arginfo_filetype + +#define arginfo_stream_get_wrappers arginfo_ob_list_handlers + +#define arginfo_stream_get_transports arginfo_ob_list_handlers + +#define arginfo_stream_is_local arginfo_rewind + +#define arginfo_stream_isatty arginfo_rewind + +#if defined(PHP_WIN32) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_vt100_support, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 1, "null") +ZEND_END_ARG_INFO() +#endif + +#define arginfo_stream_set_chunk_size arginfo_stream_set_write_buffer + +#if (defined(HAVE_SYS_TIME_H) || defined(PHP_WIN32)) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_set_timeout, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microseconds, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() +#endif + +#if (defined(HAVE_SYS_TIME_H) || defined(PHP_WIN32)) +#define arginfo_socket_set_timeout arginfo_stream_set_timeout +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gettype, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_get_debug_type arginfo_gettype + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_settype, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intval, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_LONG, 0, "10") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_floatval, 0, 1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_doubleval arginfo_floatval + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_boolval, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_strval arginfo_gettype + +#define arginfo_is_null arginfo_boolval + +#define arginfo_is_resource arginfo_boolval + +#define arginfo_is_bool arginfo_boolval + +#define arginfo_is_int arginfo_boolval + +#define arginfo_is_integer arginfo_boolval + +#define arginfo_is_long arginfo_boolval + +#define arginfo_is_float arginfo_boolval + +#define arginfo_is_double arginfo_boolval + +#define arginfo_is_numeric arginfo_boolval + +#define arginfo_is_string arginfo_boolval + +#define arginfo_is_array arginfo_boolval + +#define arginfo_is_object arginfo_boolval + +#define arginfo_is_scalar arginfo_boolval + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_callable, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, syntax_only, _IS_BOOL, 0, "false") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, callable_name, "null") +ZEND_END_ARG_INFO() + +#define arginfo_is_iterable arginfo_boolval + +#define arginfo_is_countable arginfo_boolval + +#if defined(HAVE_GETTIMEOFDAY) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_uniqid, 0, 0, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prefix, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, more_entropy, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_parse_url, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_NULL|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, url, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, component, IS_LONG, 0, "-1") +ZEND_END_ARG_INFO() + +#define arginfo_urlencode arginfo_base64_encode + +#define arginfo_urldecode arginfo_base64_encode + +#define arginfo_rawurlencode arginfo_base64_encode + +#define arginfo_rawurldecode arginfo_base64_encode + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_headers, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, url, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, associative, _IS_BOOL, 0, "false") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_bucket_make_writeable, 0, 1, IS_OBJECT, 1) + ZEND_ARG_INFO(0, brigade) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_bucket_prepend, 0, 2, IS_VOID, 0) + ZEND_ARG_INFO(0, brigade) + ZEND_ARG_TYPE_INFO(0, bucket, IS_OBJECT, 0) +ZEND_END_ARG_INFO() + +#define arginfo_stream_bucket_append arginfo_stream_bucket_prepend + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_bucket_new, 0, 2, IS_OBJECT, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, buffer, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_stream_get_filters arginfo_ob_list_handlers + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_filter_register, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filter_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_convert_uuencode arginfo_base64_encode + +#define arginfo_convert_uudecode arginfo_hex2bin + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_var_dump, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_var_export, 0, 1, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#define arginfo_debug_zval_dump arginfo_var_dump + +#define arginfo_serialize arginfo_gettype + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unserialize, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_memory_get_usage, 0, 0, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, real_usage, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +#define arginfo_memory_get_peak_usage arginfo_memory_get_usage + +#define arginfo_memory_reset_peak_usage arginfo_flush + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_version_compare, 0, 2, MAY_BE_LONG|MAY_BE_BOOL) + ZEND_ARG_TYPE_INFO(0, version1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, version2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, operator, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +#if defined(PHP_WIN32) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_cp_set, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, codepage, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(PHP_WIN32) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_cp_get, 0, 0, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, kind, IS_STRING, 0, "\"\"") +ZEND_END_ARG_INFO() +#endif + +#if defined(PHP_WIN32) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_cp_conv, 0, 3, IS_STRING, 1) + ZEND_ARG_TYPE_MASK(0, in_codepage, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, out_codepage, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(PHP_WIN32) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_cp_is_utf8, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(PHP_WIN32) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_set_ctrl_handler, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, handler, IS_CALLABLE, 1) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, add, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() +#endif + +#if defined(PHP_WIN32) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_generate_ctrl_event, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, event, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pid, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() +#endif + + +ZEND_FUNCTION(set_time_limit); +ZEND_FUNCTION(header_register_callback); +ZEND_FUNCTION(ob_start); +ZEND_FUNCTION(ob_flush); +ZEND_FUNCTION(ob_clean); +ZEND_FUNCTION(ob_end_flush); +ZEND_FUNCTION(ob_end_clean); +ZEND_FUNCTION(ob_get_flush); +ZEND_FUNCTION(ob_get_clean); +ZEND_FUNCTION(ob_get_contents); +ZEND_FUNCTION(ob_get_level); +ZEND_FUNCTION(ob_get_length); +ZEND_FUNCTION(ob_list_handlers); +ZEND_FUNCTION(ob_get_status); +ZEND_FUNCTION(ob_implicit_flush); +ZEND_FUNCTION(output_reset_rewrite_vars); +ZEND_FUNCTION(output_add_rewrite_var); +ZEND_FUNCTION(stream_wrapper_register); +ZEND_FUNCTION(stream_wrapper_unregister); +ZEND_FUNCTION(stream_wrapper_restore); +ZEND_FUNCTION(array_push); +ZEND_FUNCTION(krsort); +ZEND_FUNCTION(ksort); +ZEND_FUNCTION(count); +ZEND_FUNCTION(natsort); +ZEND_FUNCTION(natcasesort); +ZEND_FUNCTION(asort); +ZEND_FUNCTION(arsort); +ZEND_FUNCTION(sort); +ZEND_FUNCTION(rsort); +ZEND_FUNCTION(usort); +ZEND_FUNCTION(uasort); +ZEND_FUNCTION(uksort); +ZEND_FUNCTION(end); +ZEND_FUNCTION(prev); +ZEND_FUNCTION(next); +ZEND_FUNCTION(reset); +ZEND_FUNCTION(current); +ZEND_FUNCTION(key); +ZEND_FUNCTION(min); +ZEND_FUNCTION(max); +ZEND_FUNCTION(array_walk); +ZEND_FUNCTION(array_walk_recursive); +ZEND_FUNCTION(in_array); +ZEND_FUNCTION(array_search); +ZEND_FUNCTION(extract); +ZEND_FUNCTION(compact); +ZEND_FUNCTION(array_fill); +ZEND_FUNCTION(array_fill_keys); +ZEND_FUNCTION(range); +ZEND_FUNCTION(shuffle); +ZEND_FUNCTION(array_pop); +ZEND_FUNCTION(array_shift); +ZEND_FUNCTION(array_unshift); +ZEND_FUNCTION(array_splice); +ZEND_FUNCTION(array_slice); +ZEND_FUNCTION(array_merge); +ZEND_FUNCTION(array_merge_recursive); +ZEND_FUNCTION(array_replace); +ZEND_FUNCTION(array_replace_recursive); +ZEND_FUNCTION(array_keys); +ZEND_FUNCTION(array_key_first); +ZEND_FUNCTION(array_key_last); +ZEND_FUNCTION(array_values); +ZEND_FUNCTION(array_count_values); +ZEND_FUNCTION(array_column); +ZEND_FUNCTION(array_reverse); +ZEND_FUNCTION(array_pad); +ZEND_FUNCTION(array_flip); +ZEND_FUNCTION(array_change_key_case); +ZEND_FUNCTION(array_unique); +ZEND_FUNCTION(array_intersect_key); +ZEND_FUNCTION(array_intersect_ukey); +ZEND_FUNCTION(array_intersect); +ZEND_FUNCTION(array_uintersect); +ZEND_FUNCTION(array_intersect_assoc); +ZEND_FUNCTION(array_uintersect_assoc); +ZEND_FUNCTION(array_intersect_uassoc); +ZEND_FUNCTION(array_uintersect_uassoc); +ZEND_FUNCTION(array_diff_key); +ZEND_FUNCTION(array_diff_ukey); +ZEND_FUNCTION(array_diff); +ZEND_FUNCTION(array_udiff); +ZEND_FUNCTION(array_diff_assoc); +ZEND_FUNCTION(array_diff_uassoc); +ZEND_FUNCTION(array_udiff_assoc); +ZEND_FUNCTION(array_udiff_uassoc); +ZEND_FUNCTION(array_multisort); +ZEND_FUNCTION(array_rand); +ZEND_FUNCTION(array_sum); +ZEND_FUNCTION(array_product); +ZEND_FUNCTION(array_reduce); +ZEND_FUNCTION(array_filter); +ZEND_FUNCTION(array_map); +ZEND_FUNCTION(array_key_exists); +ZEND_FUNCTION(array_chunk); +ZEND_FUNCTION(array_combine); +ZEND_FUNCTION(array_is_list); +ZEND_FUNCTION(base64_encode); +ZEND_FUNCTION(base64_decode); +ZEND_FUNCTION(constant); +ZEND_FUNCTION(ip2long); +ZEND_FUNCTION(long2ip); +ZEND_FUNCTION(getenv); +#if defined(HAVE_PUTENV) +ZEND_FUNCTION(putenv); +#endif +ZEND_FUNCTION(getopt); +ZEND_FUNCTION(flush); +ZEND_FUNCTION(sleep); +ZEND_FUNCTION(usleep); +#if defined(HAVE_NANOSLEEP) +ZEND_FUNCTION(time_nanosleep); +#endif +#if defined(HAVE_NANOSLEEP) +ZEND_FUNCTION(time_sleep_until); +#endif +ZEND_FUNCTION(get_current_user); +ZEND_FUNCTION(get_cfg_var); +ZEND_FUNCTION(error_log); +ZEND_FUNCTION(error_get_last); +ZEND_FUNCTION(error_clear_last); +ZEND_FUNCTION(call_user_func); +ZEND_FUNCTION(call_user_func_array); +ZEND_FUNCTION(forward_static_call); +ZEND_FUNCTION(forward_static_call_array); +ZEND_FUNCTION(register_shutdown_function); +ZEND_FUNCTION(highlight_file); +ZEND_FUNCTION(php_strip_whitespace); +ZEND_FUNCTION(highlight_string); +ZEND_FUNCTION(ini_get); +ZEND_FUNCTION(ini_get_all); +ZEND_FUNCTION(ini_set); +ZEND_FUNCTION(ini_restore); +ZEND_FUNCTION(ini_parse_quantity); +ZEND_FUNCTION(set_include_path); +ZEND_FUNCTION(get_include_path); +ZEND_FUNCTION(print_r); +ZEND_FUNCTION(connection_aborted); +ZEND_FUNCTION(connection_status); +ZEND_FUNCTION(ignore_user_abort); +#if defined(HAVE_GETSERVBYNAME) +ZEND_FUNCTION(getservbyname); +#endif +#if defined(HAVE_GETSERVBYPORT) +ZEND_FUNCTION(getservbyport); +#endif +#if defined(HAVE_GETPROTOBYNAME) +ZEND_FUNCTION(getprotobyname); +#endif +#if defined(HAVE_GETPROTOBYNUMBER) +ZEND_FUNCTION(getprotobynumber); +#endif +ZEND_FUNCTION(register_tick_function); +ZEND_FUNCTION(unregister_tick_function); +ZEND_FUNCTION(is_uploaded_file); +ZEND_FUNCTION(move_uploaded_file); +ZEND_FUNCTION(parse_ini_file); +ZEND_FUNCTION(parse_ini_string); +#if ZEND_DEBUG +ZEND_FUNCTION(config_get_hash); +#endif +#if defined(HAVE_GETLOADAVG) +ZEND_FUNCTION(sys_getloadavg); +#endif +ZEND_FUNCTION(get_browser); +ZEND_FUNCTION(crc32); +ZEND_FUNCTION(crypt); +#if defined(HAVE_STRPTIME) +ZEND_FUNCTION(strptime); +#endif +#if defined(HAVE_GETHOSTNAME) +ZEND_FUNCTION(gethostname); +#endif +ZEND_FUNCTION(gethostbyaddr); +ZEND_FUNCTION(gethostbyname); +ZEND_FUNCTION(gethostbynamel); +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) +ZEND_FUNCTION(dns_check_record); +#endif +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) +ZEND_FUNCTION(dns_get_record); +#endif +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) +ZEND_FUNCTION(dns_get_mx); +#endif +#if (defined(PHP_WIN32) || HAVE_GETIFADDRS || defined(__PASE__)) +ZEND_FUNCTION(net_get_interfaces); +#endif +#if defined(HAVE_FTOK) +ZEND_FUNCTION(ftok); +#endif +ZEND_FUNCTION(hrtime); +ZEND_FUNCTION(md5); +ZEND_FUNCTION(md5_file); +ZEND_FUNCTION(getmyuid); +ZEND_FUNCTION(getmygid); +ZEND_FUNCTION(getmypid); +ZEND_FUNCTION(getmyinode); +ZEND_FUNCTION(getlastmod); +ZEND_FUNCTION(sha1); +ZEND_FUNCTION(sha1_file); +#if defined(HAVE_SYSLOG_H) +ZEND_FUNCTION(openlog); +#endif +#if defined(HAVE_SYSLOG_H) +ZEND_FUNCTION(closelog); +#endif +#if defined(HAVE_SYSLOG_H) +ZEND_FUNCTION(syslog); +#endif +#if defined(HAVE_INET_NTOP) +ZEND_FUNCTION(inet_ntop); +#endif +#if defined(HAVE_INET_PTON) +ZEND_FUNCTION(inet_pton); +#endif +ZEND_FUNCTION(metaphone); +ZEND_FUNCTION(header); +ZEND_FUNCTION(header_remove); +ZEND_FUNCTION(setrawcookie); +ZEND_FUNCTION(setcookie); +ZEND_FUNCTION(http_response_code); +ZEND_FUNCTION(headers_sent); +ZEND_FUNCTION(headers_list); +ZEND_FUNCTION(htmlspecialchars); +ZEND_FUNCTION(htmlspecialchars_decode); +ZEND_FUNCTION(html_entity_decode); +ZEND_FUNCTION(htmlentities); +ZEND_FUNCTION(get_html_translation_table); +ZEND_FUNCTION(assert); +ZEND_FUNCTION(assert_options); +ZEND_FUNCTION(bin2hex); +ZEND_FUNCTION(hex2bin); +ZEND_FUNCTION(strspn); +ZEND_FUNCTION(strcspn); +#if defined(HAVE_NL_LANGINFO) +ZEND_FUNCTION(nl_langinfo); +#endif +ZEND_FUNCTION(strcoll); +ZEND_FUNCTION(trim); +ZEND_FUNCTION(rtrim); +ZEND_FUNCTION(ltrim); +ZEND_FUNCTION(wordwrap); +ZEND_FUNCTION(explode); +ZEND_FUNCTION(implode); +ZEND_FUNCTION(strtok); +ZEND_FUNCTION(strtoupper); +ZEND_FUNCTION(strtolower); +ZEND_FUNCTION(str_increment); +ZEND_FUNCTION(str_decrement); +ZEND_FUNCTION(basename); +ZEND_FUNCTION(dirname); +ZEND_FUNCTION(pathinfo); +ZEND_FUNCTION(stristr); +ZEND_FUNCTION(strstr); +ZEND_FUNCTION(strpos); +ZEND_FUNCTION(stripos); +ZEND_FUNCTION(strrpos); +ZEND_FUNCTION(strripos); +ZEND_FUNCTION(strrchr); +ZEND_FUNCTION(str_contains); +ZEND_FUNCTION(str_starts_with); +ZEND_FUNCTION(str_ends_with); +ZEND_FUNCTION(chunk_split); +ZEND_FUNCTION(substr); +ZEND_FUNCTION(substr_replace); +ZEND_FUNCTION(quotemeta); +ZEND_FUNCTION(ord); +ZEND_FUNCTION(chr); +ZEND_FUNCTION(ucfirst); +ZEND_FUNCTION(lcfirst); +ZEND_FUNCTION(ucwords); +ZEND_FUNCTION(strtr); +ZEND_FUNCTION(strrev); +ZEND_FUNCTION(similar_text); +ZEND_FUNCTION(addcslashes); +ZEND_FUNCTION(addslashes); +ZEND_FUNCTION(stripcslashes); +ZEND_FUNCTION(stripslashes); +ZEND_FUNCTION(str_replace); +ZEND_FUNCTION(str_ireplace); +ZEND_FUNCTION(hebrev); +ZEND_FUNCTION(nl2br); +ZEND_FUNCTION(strip_tags); +ZEND_FUNCTION(setlocale); +ZEND_FUNCTION(parse_str); +ZEND_FUNCTION(str_getcsv); +ZEND_FUNCTION(str_repeat); +ZEND_FUNCTION(count_chars); +ZEND_FUNCTION(strnatcmp); +ZEND_FUNCTION(localeconv); +ZEND_FUNCTION(strnatcasecmp); +ZEND_FUNCTION(substr_count); +ZEND_FUNCTION(str_pad); +ZEND_FUNCTION(sscanf); +ZEND_FUNCTION(str_rot13); +ZEND_FUNCTION(str_shuffle); +ZEND_FUNCTION(str_word_count); +ZEND_FUNCTION(str_split); +ZEND_FUNCTION(strpbrk); +ZEND_FUNCTION(substr_compare); +ZEND_FUNCTION(utf8_encode); +ZEND_FUNCTION(utf8_decode); +ZEND_FUNCTION(opendir); +ZEND_FUNCTION(dir); +ZEND_FUNCTION(closedir); +ZEND_FUNCTION(chdir); +#if (defined(HAVE_CHROOT) && !defined(ZTS) && defined(ENABLE_CHROOT_FUNC)) +ZEND_FUNCTION(chroot); +#endif +ZEND_FUNCTION(getcwd); +ZEND_FUNCTION(rewinddir); +ZEND_FUNCTION(readdir); +ZEND_FUNCTION(scandir); +#if defined(HAVE_GLOB) +ZEND_FUNCTION(glob); +#endif +ZEND_FUNCTION(exec); +ZEND_FUNCTION(system); +ZEND_FUNCTION(passthru); +ZEND_FUNCTION(escapeshellcmd); +ZEND_FUNCTION(escapeshellarg); +ZEND_FUNCTION(shell_exec); +#if defined(HAVE_NICE) +ZEND_FUNCTION(proc_nice); +#endif +ZEND_FUNCTION(flock); +ZEND_FUNCTION(get_meta_tags); +ZEND_FUNCTION(pclose); +ZEND_FUNCTION(popen); +ZEND_FUNCTION(readfile); +ZEND_FUNCTION(rewind); +ZEND_FUNCTION(rmdir); +ZEND_FUNCTION(umask); +ZEND_FUNCTION(fclose); +ZEND_FUNCTION(feof); +ZEND_FUNCTION(fgetc); +ZEND_FUNCTION(fgets); +ZEND_FUNCTION(fread); +ZEND_FUNCTION(fopen); +ZEND_FUNCTION(fscanf); +ZEND_FUNCTION(fpassthru); +ZEND_FUNCTION(ftruncate); +ZEND_FUNCTION(fstat); +ZEND_FUNCTION(fseek); +ZEND_FUNCTION(ftell); +ZEND_FUNCTION(fflush); +ZEND_FUNCTION(fsync); +ZEND_FUNCTION(fdatasync); +ZEND_FUNCTION(fwrite); +ZEND_FUNCTION(mkdir); +ZEND_FUNCTION(rename); +ZEND_FUNCTION(copy); +ZEND_FUNCTION(tempnam); +ZEND_FUNCTION(tmpfile); +ZEND_FUNCTION(file); +ZEND_FUNCTION(file_get_contents); +ZEND_FUNCTION(unlink); +ZEND_FUNCTION(file_put_contents); +ZEND_FUNCTION(fputcsv); +ZEND_FUNCTION(fgetcsv); +ZEND_FUNCTION(realpath); +#if defined(HAVE_FNMATCH) +ZEND_FUNCTION(fnmatch); +#endif +ZEND_FUNCTION(sys_get_temp_dir); +ZEND_FUNCTION(fileatime); +ZEND_FUNCTION(filectime); +ZEND_FUNCTION(filegroup); +ZEND_FUNCTION(fileinode); +ZEND_FUNCTION(filemtime); +ZEND_FUNCTION(fileowner); +ZEND_FUNCTION(fileperms); +ZEND_FUNCTION(filesize); +ZEND_FUNCTION(filetype); +ZEND_FUNCTION(file_exists); +ZEND_FUNCTION(is_writable); +ZEND_FUNCTION(is_readable); +ZEND_FUNCTION(is_executable); +ZEND_FUNCTION(is_file); +ZEND_FUNCTION(is_dir); +ZEND_FUNCTION(is_link); +ZEND_FUNCTION(stat); +ZEND_FUNCTION(lstat); +ZEND_FUNCTION(chown); +ZEND_FUNCTION(chgrp); +#if defined(HAVE_LCHOWN) +ZEND_FUNCTION(lchown); +#endif +#if defined(HAVE_LCHOWN) +ZEND_FUNCTION(lchgrp); +#endif +ZEND_FUNCTION(chmod); +#if defined(HAVE_UTIME) +ZEND_FUNCTION(touch); +#endif +ZEND_FUNCTION(clearstatcache); +ZEND_FUNCTION(disk_total_space); +ZEND_FUNCTION(disk_free_space); +ZEND_FUNCTION(realpath_cache_get); +ZEND_FUNCTION(realpath_cache_size); +ZEND_FUNCTION(sprintf); +ZEND_FUNCTION(printf); +ZEND_FUNCTION(vprintf); +ZEND_FUNCTION(vsprintf); +ZEND_FUNCTION(fprintf); +ZEND_FUNCTION(vfprintf); +ZEND_FUNCTION(fsockopen); +ZEND_FUNCTION(pfsockopen); +ZEND_FUNCTION(http_build_query); +ZEND_FUNCTION(image_type_to_mime_type); +ZEND_FUNCTION(image_type_to_extension); +ZEND_FUNCTION(getimagesize); +ZEND_FUNCTION(getimagesizefromstring); +ZEND_FUNCTION(phpinfo); +ZEND_FUNCTION(phpversion); +ZEND_FUNCTION(phpcredits); +ZEND_FUNCTION(php_sapi_name); +ZEND_FUNCTION(php_uname); +ZEND_FUNCTION(php_ini_scanned_files); +ZEND_FUNCTION(php_ini_loaded_file); +ZEND_FUNCTION(iptcembed); +ZEND_FUNCTION(iptcparse); +ZEND_FUNCTION(levenshtein); +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) +ZEND_FUNCTION(readlink); +#endif +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) +ZEND_FUNCTION(linkinfo); +#endif +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) +ZEND_FUNCTION(symlink); +#endif +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) +ZEND_FUNCTION(link); +#endif +ZEND_FUNCTION(mail); +ZEND_FUNCTION(abs); +ZEND_FUNCTION(ceil); +ZEND_FUNCTION(floor); +ZEND_FUNCTION(round); +ZEND_FUNCTION(sin); +ZEND_FUNCTION(cos); +ZEND_FUNCTION(tan); +ZEND_FUNCTION(asin); +ZEND_FUNCTION(acos); +ZEND_FUNCTION(atan); +ZEND_FUNCTION(atanh); +ZEND_FUNCTION(atan2); +ZEND_FUNCTION(sinh); +ZEND_FUNCTION(cosh); +ZEND_FUNCTION(tanh); +ZEND_FUNCTION(asinh); +ZEND_FUNCTION(acosh); +ZEND_FUNCTION(expm1); +ZEND_FUNCTION(log1p); +ZEND_FUNCTION(pi); +ZEND_FUNCTION(is_finite); +ZEND_FUNCTION(is_nan); +ZEND_FUNCTION(intdiv); +ZEND_FUNCTION(is_infinite); +ZEND_FUNCTION(pow); +ZEND_FUNCTION(exp); +ZEND_FUNCTION(log); +ZEND_FUNCTION(log10); +ZEND_FUNCTION(sqrt); +ZEND_FUNCTION(hypot); +ZEND_FUNCTION(deg2rad); +ZEND_FUNCTION(rad2deg); +ZEND_FUNCTION(bindec); +ZEND_FUNCTION(hexdec); +ZEND_FUNCTION(octdec); +ZEND_FUNCTION(decbin); +ZEND_FUNCTION(decoct); +ZEND_FUNCTION(dechex); +ZEND_FUNCTION(base_convert); +ZEND_FUNCTION(number_format); +ZEND_FUNCTION(fmod); +ZEND_FUNCTION(fdiv); +#if defined(HAVE_GETTIMEOFDAY) +ZEND_FUNCTION(microtime); +#endif +#if defined(HAVE_GETTIMEOFDAY) +ZEND_FUNCTION(gettimeofday); +#endif +#if defined(HAVE_GETRUSAGE) +ZEND_FUNCTION(getrusage); +#endif +ZEND_FUNCTION(pack); +ZEND_FUNCTION(unpack); +ZEND_FUNCTION(password_get_info); +ZEND_FUNCTION(password_hash); +ZEND_FUNCTION(password_needs_rehash); +ZEND_FUNCTION(password_verify); +ZEND_FUNCTION(password_algos); +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) +ZEND_FUNCTION(proc_open); +#endif +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) +ZEND_FUNCTION(proc_close); +#endif +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) +ZEND_FUNCTION(proc_terminate); +#endif +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) +ZEND_FUNCTION(proc_get_status); +#endif +ZEND_FUNCTION(quoted_printable_decode); +ZEND_FUNCTION(quoted_printable_encode); +ZEND_FUNCTION(soundex); +ZEND_FUNCTION(stream_select); +ZEND_FUNCTION(stream_context_create); +ZEND_FUNCTION(stream_context_set_params); +ZEND_FUNCTION(stream_context_get_params); +ZEND_FUNCTION(stream_context_set_option); +ZEND_FUNCTION(stream_context_set_options); +ZEND_FUNCTION(stream_context_get_options); +ZEND_FUNCTION(stream_context_get_default); +ZEND_FUNCTION(stream_context_set_default); +ZEND_FUNCTION(stream_filter_prepend); +ZEND_FUNCTION(stream_filter_append); +ZEND_FUNCTION(stream_filter_remove); +ZEND_FUNCTION(stream_socket_client); +ZEND_FUNCTION(stream_socket_server); +ZEND_FUNCTION(stream_socket_accept); +ZEND_FUNCTION(stream_socket_get_name); +ZEND_FUNCTION(stream_socket_recvfrom); +ZEND_FUNCTION(stream_socket_sendto); +ZEND_FUNCTION(stream_socket_enable_crypto); +#if defined(HAVE_SHUTDOWN) +ZEND_FUNCTION(stream_socket_shutdown); +#endif +#if defined(HAVE_SOCKETPAIR) +ZEND_FUNCTION(stream_socket_pair); +#endif +ZEND_FUNCTION(stream_copy_to_stream); +ZEND_FUNCTION(stream_get_contents); +ZEND_FUNCTION(stream_supports_lock); +ZEND_FUNCTION(stream_set_write_buffer); +ZEND_FUNCTION(stream_set_read_buffer); +ZEND_FUNCTION(stream_set_blocking); +ZEND_FUNCTION(stream_get_meta_data); +ZEND_FUNCTION(stream_get_line); +ZEND_FUNCTION(stream_resolve_include_path); +ZEND_FUNCTION(stream_get_wrappers); +ZEND_FUNCTION(stream_get_transports); +ZEND_FUNCTION(stream_is_local); +ZEND_FUNCTION(stream_isatty); +#if defined(PHP_WIN32) +ZEND_FUNCTION(sapi_windows_vt100_support); +#endif +ZEND_FUNCTION(stream_set_chunk_size); +#if (defined(HAVE_SYS_TIME_H) || defined(PHP_WIN32)) +ZEND_FUNCTION(stream_set_timeout); +#endif +ZEND_FUNCTION(gettype); +ZEND_FUNCTION(get_debug_type); +ZEND_FUNCTION(settype); +ZEND_FUNCTION(intval); +ZEND_FUNCTION(floatval); +ZEND_FUNCTION(boolval); +ZEND_FUNCTION(strval); +ZEND_FUNCTION(is_null); +ZEND_FUNCTION(is_resource); +ZEND_FUNCTION(is_bool); +ZEND_FUNCTION(is_int); +ZEND_FUNCTION(is_float); +ZEND_FUNCTION(is_numeric); +ZEND_FUNCTION(is_string); +ZEND_FUNCTION(is_array); +ZEND_FUNCTION(is_object); +ZEND_FUNCTION(is_scalar); +ZEND_FUNCTION(is_callable); +ZEND_FUNCTION(is_iterable); +ZEND_FUNCTION(is_countable); +#if defined(HAVE_GETTIMEOFDAY) +ZEND_FUNCTION(uniqid); +#endif +ZEND_FUNCTION(parse_url); +ZEND_FUNCTION(urlencode); +ZEND_FUNCTION(urldecode); +ZEND_FUNCTION(rawurlencode); +ZEND_FUNCTION(rawurldecode); +ZEND_FUNCTION(get_headers); +ZEND_FUNCTION(stream_bucket_make_writeable); +ZEND_FUNCTION(stream_bucket_prepend); +ZEND_FUNCTION(stream_bucket_append); +ZEND_FUNCTION(stream_bucket_new); +ZEND_FUNCTION(stream_get_filters); +ZEND_FUNCTION(stream_filter_register); +ZEND_FUNCTION(convert_uuencode); +ZEND_FUNCTION(convert_uudecode); +ZEND_FUNCTION(var_dump); +ZEND_FUNCTION(var_export); +ZEND_FUNCTION(debug_zval_dump); +ZEND_FUNCTION(serialize); +ZEND_FUNCTION(unserialize); +ZEND_FUNCTION(memory_get_usage); +ZEND_FUNCTION(memory_get_peak_usage); +ZEND_FUNCTION(memory_reset_peak_usage); +ZEND_FUNCTION(version_compare); +#if defined(PHP_WIN32) +ZEND_FUNCTION(sapi_windows_cp_set); +#endif +#if defined(PHP_WIN32) +ZEND_FUNCTION(sapi_windows_cp_get); +#endif +#if defined(PHP_WIN32) +ZEND_FUNCTION(sapi_windows_cp_conv); +#endif +#if defined(PHP_WIN32) +ZEND_FUNCTION(sapi_windows_cp_is_utf8); +#endif +#if defined(PHP_WIN32) +ZEND_FUNCTION(sapi_windows_set_ctrl_handler); +#endif +#if defined(PHP_WIN32) +ZEND_FUNCTION(sapi_windows_generate_ctrl_event); +#endif + + +static const zend_function_entry ext_functions[] = { + ZEND_FE(set_time_limit, arginfo_set_time_limit) + ZEND_FE(header_register_callback, arginfo_header_register_callback) + ZEND_FE(ob_start, arginfo_ob_start) + ZEND_FE(ob_flush, arginfo_ob_flush) + ZEND_FE(ob_clean, arginfo_ob_clean) + ZEND_FE(ob_end_flush, arginfo_ob_end_flush) + ZEND_FE(ob_end_clean, arginfo_ob_end_clean) + ZEND_FE(ob_get_flush, arginfo_ob_get_flush) + ZEND_FE(ob_get_clean, arginfo_ob_get_clean) + ZEND_FE(ob_get_contents, arginfo_ob_get_contents) + ZEND_FE(ob_get_level, arginfo_ob_get_level) + ZEND_FE(ob_get_length, arginfo_ob_get_length) + ZEND_FE(ob_list_handlers, arginfo_ob_list_handlers) + ZEND_FE(ob_get_status, arginfo_ob_get_status) + ZEND_FE(ob_implicit_flush, arginfo_ob_implicit_flush) + ZEND_FE(output_reset_rewrite_vars, arginfo_output_reset_rewrite_vars) + ZEND_FE(output_add_rewrite_var, arginfo_output_add_rewrite_var) + ZEND_FE(stream_wrapper_register, arginfo_stream_wrapper_register) + ZEND_FALIAS(stream_register_wrapper, stream_wrapper_register, arginfo_stream_register_wrapper) + ZEND_FE(stream_wrapper_unregister, arginfo_stream_wrapper_unregister) + ZEND_FE(stream_wrapper_restore, arginfo_stream_wrapper_restore) + ZEND_FE(array_push, arginfo_array_push) + ZEND_FE(krsort, arginfo_krsort) + ZEND_FE(ksort, arginfo_ksort) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(count, arginfo_count) + ZEND_FALIAS(sizeof, count, arginfo_sizeof) + ZEND_FE(natsort, arginfo_natsort) + ZEND_FE(natcasesort, arginfo_natcasesort) + ZEND_FE(asort, arginfo_asort) + ZEND_FE(arsort, arginfo_arsort) + ZEND_FE(sort, arginfo_sort) + ZEND_FE(rsort, arginfo_rsort) + ZEND_FE(usort, arginfo_usort) + ZEND_FE(uasort, arginfo_uasort) + ZEND_FE(uksort, arginfo_uksort) + ZEND_FE(end, arginfo_end) + ZEND_FE(prev, arginfo_prev) + ZEND_FE(next, arginfo_next) + ZEND_FE(reset, arginfo_reset) + ZEND_FE(current, arginfo_current) + ZEND_FALIAS(pos, current, arginfo_pos) + ZEND_FE(key, arginfo_key) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(min, arginfo_min) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(max, arginfo_max) + ZEND_FE(array_walk, arginfo_array_walk) + ZEND_FE(array_walk_recursive, arginfo_array_walk_recursive) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(in_array, arginfo_in_array) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_search, arginfo_array_search) + ZEND_FE(extract, arginfo_extract) + ZEND_FE(compact, arginfo_compact) + ZEND_FE(array_fill, arginfo_array_fill) + ZEND_FE(array_fill_keys, arginfo_array_fill_keys) + ZEND_FE(range, arginfo_range) + ZEND_FE(shuffle, arginfo_shuffle) + ZEND_FE(array_pop, arginfo_array_pop) + ZEND_FE(array_shift, arginfo_array_shift) + ZEND_FE(array_unshift, arginfo_array_unshift) + ZEND_FE(array_splice, arginfo_array_splice) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_slice, arginfo_array_slice) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_merge, arginfo_array_merge) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_merge_recursive, arginfo_array_merge_recursive) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_replace, arginfo_array_replace) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_replace_recursive, arginfo_array_replace_recursive) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_keys, arginfo_array_keys) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_first, arginfo_array_key_first) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_last, arginfo_array_key_last) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_values, arginfo_array_values) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_count_values, arginfo_array_count_values) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_column, arginfo_array_column) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_reverse, arginfo_array_reverse) + ZEND_FE(array_pad, arginfo_array_pad) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_flip, arginfo_array_flip) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_change_key_case, arginfo_array_change_key_case) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_unique, arginfo_array_unique) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect_key, arginfo_array_intersect_key) + ZEND_FE(array_intersect_ukey, arginfo_array_intersect_ukey) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect, arginfo_array_intersect) + ZEND_FE(array_uintersect, arginfo_array_uintersect) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_intersect_assoc, arginfo_array_intersect_assoc) + ZEND_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc) + ZEND_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc) + ZEND_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_diff_key, arginfo_array_diff_key) + ZEND_FE(array_diff_ukey, arginfo_array_diff_ukey) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_diff, arginfo_array_diff) + ZEND_FE(array_udiff, arginfo_array_udiff) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_diff_assoc, arginfo_array_diff_assoc) + ZEND_FE(array_diff_uassoc, arginfo_array_diff_uassoc) + ZEND_FE(array_udiff_assoc, arginfo_array_udiff_assoc) + ZEND_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc) + ZEND_FE(array_multisort, arginfo_array_multisort) + ZEND_FE(array_rand, arginfo_array_rand) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_sum, arginfo_array_sum) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_product, arginfo_array_product) + ZEND_FE(array_reduce, arginfo_array_reduce) + ZEND_FE(array_filter, arginfo_array_filter) + ZEND_FE(array_map, arginfo_array_map) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_key_exists, arginfo_array_key_exists) + ZEND_FALIAS(key_exists, array_key_exists, arginfo_key_exists) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_chunk, arginfo_array_chunk) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_combine, arginfo_array_combine) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(array_is_list, arginfo_array_is_list) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_encode, arginfo_base64_encode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base64_decode, arginfo_base64_decode) + ZEND_FE(constant, arginfo_constant) + ZEND_FE(ip2long, arginfo_ip2long) + ZEND_FE(long2ip, arginfo_long2ip) + ZEND_FE(getenv, arginfo_getenv) +#if defined(HAVE_PUTENV) + ZEND_FE(putenv, arginfo_putenv) +#endif + ZEND_FE(getopt, arginfo_getopt) + ZEND_FE(flush, arginfo_flush) + ZEND_FE(sleep, arginfo_sleep) + ZEND_FE(usleep, arginfo_usleep) +#if defined(HAVE_NANOSLEEP) + ZEND_FE(time_nanosleep, arginfo_time_nanosleep) +#endif +#if defined(HAVE_NANOSLEEP) + ZEND_FE(time_sleep_until, arginfo_time_sleep_until) +#endif + ZEND_FE(get_current_user, arginfo_get_current_user) + ZEND_FE(get_cfg_var, arginfo_get_cfg_var) + ZEND_FE(error_log, arginfo_error_log) + ZEND_FE(error_get_last, arginfo_error_get_last) + ZEND_FE(error_clear_last, arginfo_error_clear_last) + ZEND_FE(call_user_func, arginfo_call_user_func) + ZEND_FE(call_user_func_array, arginfo_call_user_func_array) + ZEND_FE(forward_static_call, arginfo_forward_static_call) + ZEND_FE(forward_static_call_array, arginfo_forward_static_call_array) + ZEND_FE(register_shutdown_function, arginfo_register_shutdown_function) + ZEND_FE(highlight_file, arginfo_highlight_file) + ZEND_FALIAS(show_source, highlight_file, arginfo_show_source) + ZEND_FE(php_strip_whitespace, arginfo_php_strip_whitespace) + ZEND_FE(highlight_string, arginfo_highlight_string) + ZEND_FE(ini_get, arginfo_ini_get) + ZEND_FE(ini_get_all, arginfo_ini_get_all) + ZEND_FE(ini_set, arginfo_ini_set) + ZEND_FALIAS(ini_alter, ini_set, arginfo_ini_alter) + ZEND_FE(ini_restore, arginfo_ini_restore) + ZEND_FE(ini_parse_quantity, arginfo_ini_parse_quantity) + ZEND_FE(set_include_path, arginfo_set_include_path) + ZEND_FE(get_include_path, arginfo_get_include_path) + ZEND_FE(print_r, arginfo_print_r) + ZEND_FE(connection_aborted, arginfo_connection_aborted) + ZEND_FE(connection_status, arginfo_connection_status) + ZEND_FE(ignore_user_abort, arginfo_ignore_user_abort) +#if defined(HAVE_GETSERVBYNAME) + ZEND_FE(getservbyname, arginfo_getservbyname) +#endif +#if defined(HAVE_GETSERVBYPORT) + ZEND_FE(getservbyport, arginfo_getservbyport) +#endif +#if defined(HAVE_GETPROTOBYNAME) + ZEND_FE(getprotobyname, arginfo_getprotobyname) +#endif +#if defined(HAVE_GETPROTOBYNUMBER) + ZEND_FE(getprotobynumber, arginfo_getprotobynumber) +#endif + ZEND_FE(register_tick_function, arginfo_register_tick_function) + ZEND_FE(unregister_tick_function, arginfo_unregister_tick_function) + ZEND_FE(is_uploaded_file, arginfo_is_uploaded_file) + ZEND_FE(move_uploaded_file, arginfo_move_uploaded_file) + ZEND_FE(parse_ini_file, arginfo_parse_ini_file) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(parse_ini_string, arginfo_parse_ini_string) +#if ZEND_DEBUG + ZEND_FE(config_get_hash, arginfo_config_get_hash) +#endif +#if defined(HAVE_GETLOADAVG) + ZEND_FE(sys_getloadavg, arginfo_sys_getloadavg) +#endif + ZEND_FE(get_browser, arginfo_get_browser) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(crc32, arginfo_crc32) + ZEND_FE(crypt, arginfo_crypt) +#if defined(HAVE_STRPTIME) + ZEND_DEP_FE(strptime, arginfo_strptime) +#endif +#if defined(HAVE_GETHOSTNAME) + ZEND_FE(gethostname, arginfo_gethostname) +#endif + ZEND_FE(gethostbyaddr, arginfo_gethostbyaddr) + ZEND_FE(gethostbyname, arginfo_gethostbyname) + ZEND_FE(gethostbynamel, arginfo_gethostbynamel) +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) + ZEND_FE(dns_check_record, arginfo_dns_check_record) +#endif +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) + ZEND_FALIAS(checkdnsrr, dns_check_record, arginfo_checkdnsrr) +#endif +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) + ZEND_FE(dns_get_record, arginfo_dns_get_record) +#endif +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) + ZEND_FE(dns_get_mx, arginfo_dns_get_mx) +#endif +#if (defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)) + ZEND_FALIAS(getmxrr, dns_get_mx, arginfo_getmxrr) +#endif +#if (defined(PHP_WIN32) || HAVE_GETIFADDRS || defined(__PASE__)) + ZEND_FE(net_get_interfaces, arginfo_net_get_interfaces) +#endif +#if defined(HAVE_FTOK) + ZEND_FE(ftok, arginfo_ftok) +#endif + ZEND_FE(hrtime, arginfo_hrtime) + ZEND_FE(md5, arginfo_md5) + ZEND_FE(md5_file, arginfo_md5_file) + ZEND_FE(getmyuid, arginfo_getmyuid) + ZEND_FE(getmygid, arginfo_getmygid) + ZEND_FE(getmypid, arginfo_getmypid) + ZEND_FE(getmyinode, arginfo_getmyinode) + ZEND_FE(getlastmod, arginfo_getlastmod) + ZEND_FE(sha1, arginfo_sha1) + ZEND_FE(sha1_file, arginfo_sha1_file) +#if defined(HAVE_SYSLOG_H) + ZEND_FE(openlog, arginfo_openlog) +#endif +#if defined(HAVE_SYSLOG_H) + ZEND_FE(closelog, arginfo_closelog) +#endif +#if defined(HAVE_SYSLOG_H) + ZEND_FE(syslog, arginfo_syslog) +#endif +#if defined(HAVE_INET_NTOP) + ZEND_FE(inet_ntop, arginfo_inet_ntop) +#endif +#if defined(HAVE_INET_PTON) + ZEND_FE(inet_pton, arginfo_inet_pton) +#endif + ZEND_FE(metaphone, arginfo_metaphone) + ZEND_FE(header, arginfo_header) + ZEND_FE(header_remove, arginfo_header_remove) + ZEND_FE(setrawcookie, arginfo_setrawcookie) + ZEND_FE(setcookie, arginfo_setcookie) + ZEND_FE(http_response_code, arginfo_http_response_code) + ZEND_FE(headers_sent, arginfo_headers_sent) + ZEND_FE(headers_list, arginfo_headers_list) + ZEND_FE(htmlspecialchars, arginfo_htmlspecialchars) + ZEND_FE(htmlspecialchars_decode, arginfo_htmlspecialchars_decode) + ZEND_FE(html_entity_decode, arginfo_html_entity_decode) + ZEND_FE(htmlentities, arginfo_htmlentities) + ZEND_FE(get_html_translation_table, arginfo_get_html_translation_table) + ZEND_FE(assert, arginfo_assert) + ZEND_DEP_FE(assert_options, arginfo_assert_options) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(bin2hex, arginfo_bin2hex) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hex2bin, arginfo_hex2bin) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strspn, arginfo_strspn) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strcspn, arginfo_strcspn) +#if defined(HAVE_NL_LANGINFO) + ZEND_FE(nl_langinfo, arginfo_nl_langinfo) +#endif + ZEND_FE(strcoll, arginfo_strcoll) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(trim, arginfo_trim) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rtrim, arginfo_rtrim) + ZEND_FALIAS(chop, rtrim, arginfo_chop) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ltrim, arginfo_ltrim) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(wordwrap, arginfo_wordwrap) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(explode, arginfo_explode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(implode, arginfo_implode) + ZEND_FALIAS(join, implode, arginfo_join) + ZEND_FE(strtok, arginfo_strtok) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtoupper, arginfo_strtoupper) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtolower, arginfo_strtolower) + ZEND_FE(str_increment, arginfo_str_increment) + ZEND_FE(str_decrement, arginfo_str_decrement) + ZEND_FE(basename, arginfo_basename) + ZEND_FE(dirname, arginfo_dirname) + ZEND_FE(pathinfo, arginfo_pathinfo) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stristr, arginfo_stristr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strstr, arginfo_strstr) + ZEND_FALIAS(strchr, strstr, arginfo_strchr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strpos, arginfo_strpos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripos, arginfo_stripos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrpos, arginfo_strrpos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strripos, arginfo_strripos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrchr, arginfo_strrchr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_contains, arginfo_str_contains) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_starts_with, arginfo_str_starts_with) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ends_with, arginfo_str_ends_with) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(chunk_split, arginfo_chunk_split) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr, arginfo_substr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_replace, arginfo_substr_replace) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quotemeta, arginfo_quotemeta) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ord, arginfo_ord) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(chr, arginfo_chr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ucfirst, arginfo_ucfirst) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(lcfirst, arginfo_lcfirst) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ucwords, arginfo_ucwords) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtr, arginfo_strtr) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strrev, arginfo_strrev) + ZEND_FE(similar_text, arginfo_similar_text) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(addcslashes, arginfo_addcslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(addslashes, arginfo_addslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripcslashes, arginfo_stripcslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(stripslashes, arginfo_stripslashes) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_replace, arginfo_str_replace) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_ireplace, arginfo_str_ireplace) + ZEND_FE(hebrev, arginfo_hebrev) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(nl2br, arginfo_nl2br) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strip_tags, arginfo_strip_tags) + ZEND_FE(setlocale, arginfo_setlocale) + ZEND_FE(parse_str, arginfo_parse_str) + ZEND_FE(str_getcsv, arginfo_str_getcsv) + ZEND_FE(str_repeat, arginfo_str_repeat) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(count_chars, arginfo_count_chars) + ZEND_FE(strnatcmp, arginfo_strnatcmp) + ZEND_FE(localeconv, arginfo_localeconv) + ZEND_FE(strnatcasecmp, arginfo_strnatcasecmp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_count, arginfo_substr_count) + ZEND_FE(str_pad, arginfo_str_pad) + ZEND_FE(sscanf, arginfo_sscanf) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_rot13, arginfo_str_rot13) + ZEND_FE(str_shuffle, arginfo_str_shuffle) + ZEND_FE(str_word_count, arginfo_str_word_count) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(str_split, arginfo_str_split) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strpbrk, arginfo_strpbrk) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(substr_compare, arginfo_substr_compare) + ZEND_DEP_FE(utf8_encode, arginfo_utf8_encode) + ZEND_DEP_FE(utf8_decode, arginfo_utf8_decode) + ZEND_FE(opendir, arginfo_opendir) + ZEND_FE(dir, arginfo_dir) + ZEND_FE(closedir, arginfo_closedir) + ZEND_FE(chdir, arginfo_chdir) +#if (defined(HAVE_CHROOT) && !defined(ZTS) && defined(ENABLE_CHROOT_FUNC)) + ZEND_FE(chroot, arginfo_chroot) +#endif + ZEND_FE(getcwd, arginfo_getcwd) + ZEND_FE(rewinddir, arginfo_rewinddir) + ZEND_FE(readdir, arginfo_readdir) + ZEND_FE(scandir, arginfo_scandir) +#if defined(HAVE_GLOB) + ZEND_FE(glob, arginfo_glob) +#endif + ZEND_FE(exec, arginfo_exec) + ZEND_FE(system, arginfo_system) + ZEND_FE(passthru, arginfo_passthru) + ZEND_FE(escapeshellcmd, arginfo_escapeshellcmd) + ZEND_FE(escapeshellarg, arginfo_escapeshellarg) + ZEND_FE(shell_exec, arginfo_shell_exec) +#if defined(HAVE_NICE) + ZEND_FE(proc_nice, arginfo_proc_nice) +#endif + ZEND_FE(flock, arginfo_flock) + ZEND_FE(get_meta_tags, arginfo_get_meta_tags) + ZEND_FE(pclose, arginfo_pclose) + ZEND_FE(popen, arginfo_popen) + ZEND_FE(readfile, arginfo_readfile) + ZEND_FE(rewind, arginfo_rewind) + ZEND_FE(rmdir, arginfo_rmdir) + ZEND_FE(umask, arginfo_umask) + ZEND_FE(fclose, arginfo_fclose) + ZEND_FE(feof, arginfo_feof) + ZEND_FE(fgetc, arginfo_fgetc) + ZEND_FE(fgets, arginfo_fgets) + ZEND_FE(fread, arginfo_fread) + ZEND_FE(fopen, arginfo_fopen) + ZEND_FE(fscanf, arginfo_fscanf) + ZEND_FE(fpassthru, arginfo_fpassthru) + ZEND_FE(ftruncate, arginfo_ftruncate) + ZEND_FE(fstat, arginfo_fstat) + ZEND_FE(fseek, arginfo_fseek) + ZEND_FE(ftell, arginfo_ftell) + ZEND_FE(fflush, arginfo_fflush) + ZEND_FE(fsync, arginfo_fsync) + ZEND_FE(fdatasync, arginfo_fdatasync) + ZEND_FE(fwrite, arginfo_fwrite) + ZEND_FALIAS(fputs, fwrite, arginfo_fputs) + ZEND_FE(mkdir, arginfo_mkdir) + ZEND_FE(rename, arginfo_rename) + ZEND_FE(copy, arginfo_copy) + ZEND_FE(tempnam, arginfo_tempnam) + ZEND_FE(tmpfile, arginfo_tmpfile) + ZEND_FE(file, arginfo_file) + ZEND_FE(file_get_contents, arginfo_file_get_contents) + ZEND_FE(unlink, arginfo_unlink) + ZEND_FE(file_put_contents, arginfo_file_put_contents) + ZEND_FE(fputcsv, arginfo_fputcsv) + ZEND_FE(fgetcsv, arginfo_fgetcsv) + ZEND_FE(realpath, arginfo_realpath) +#if defined(HAVE_FNMATCH) + ZEND_FE(fnmatch, arginfo_fnmatch) +#endif + ZEND_FE(sys_get_temp_dir, arginfo_sys_get_temp_dir) + ZEND_FE(fileatime, arginfo_fileatime) + ZEND_FE(filectime, arginfo_filectime) + ZEND_FE(filegroup, arginfo_filegroup) + ZEND_FE(fileinode, arginfo_fileinode) + ZEND_FE(filemtime, arginfo_filemtime) + ZEND_FE(fileowner, arginfo_fileowner) + ZEND_FE(fileperms, arginfo_fileperms) + ZEND_FE(filesize, arginfo_filesize) + ZEND_FE(filetype, arginfo_filetype) + ZEND_FE(file_exists, arginfo_file_exists) + ZEND_FE(is_writable, arginfo_is_writable) + ZEND_FALIAS(is_writeable, is_writable, arginfo_is_writeable) + ZEND_FE(is_readable, arginfo_is_readable) + ZEND_FE(is_executable, arginfo_is_executable) + ZEND_FE(is_file, arginfo_is_file) + ZEND_FE(is_dir, arginfo_is_dir) + ZEND_FE(is_link, arginfo_is_link) + ZEND_FE(stat, arginfo_stat) + ZEND_FE(lstat, arginfo_lstat) + ZEND_FE(chown, arginfo_chown) + ZEND_FE(chgrp, arginfo_chgrp) +#if defined(HAVE_LCHOWN) + ZEND_FE(lchown, arginfo_lchown) +#endif +#if defined(HAVE_LCHOWN) + ZEND_FE(lchgrp, arginfo_lchgrp) +#endif + ZEND_FE(chmod, arginfo_chmod) +#if defined(HAVE_UTIME) + ZEND_FE(touch, arginfo_touch) +#endif + ZEND_FE(clearstatcache, arginfo_clearstatcache) + ZEND_FE(disk_total_space, arginfo_disk_total_space) + ZEND_FE(disk_free_space, arginfo_disk_free_space) + ZEND_FALIAS(diskfreespace, disk_free_space, arginfo_diskfreespace) + ZEND_FE(realpath_cache_get, arginfo_realpath_cache_get) + ZEND_FE(realpath_cache_size, arginfo_realpath_cache_size) + ZEND_FE(sprintf, arginfo_sprintf) + ZEND_FE(printf, arginfo_printf) + ZEND_FE(vprintf, arginfo_vprintf) + ZEND_FE(vsprintf, arginfo_vsprintf) + ZEND_FE(fprintf, arginfo_fprintf) + ZEND_FE(vfprintf, arginfo_vfprintf) + ZEND_FE(fsockopen, arginfo_fsockopen) + ZEND_FE(pfsockopen, arginfo_pfsockopen) + ZEND_FE(http_build_query, arginfo_http_build_query) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(image_type_to_extension, arginfo_image_type_to_extension) + ZEND_FE(getimagesize, arginfo_getimagesize) + ZEND_FE(getimagesizefromstring, arginfo_getimagesizefromstring) + ZEND_FE(phpinfo, arginfo_phpinfo) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(phpversion, arginfo_phpversion) + ZEND_FE(phpcredits, arginfo_phpcredits) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(php_sapi_name, arginfo_php_sapi_name) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(php_uname, arginfo_php_uname) + ZEND_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files) + ZEND_FE(php_ini_loaded_file, arginfo_php_ini_loaded_file) + ZEND_FE(iptcembed, arginfo_iptcembed) + ZEND_FE(iptcparse, arginfo_iptcparse) + ZEND_FE(levenshtein, arginfo_levenshtein) +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) + ZEND_FE(readlink, arginfo_readlink) +#endif +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) + ZEND_FE(linkinfo, arginfo_linkinfo) +#endif +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) + ZEND_FE(symlink, arginfo_symlink) +#endif +#if (defined(HAVE_SYMLINK) || defined(PHP_WIN32)) + ZEND_FE(link, arginfo_link) +#endif + ZEND_FE(mail, arginfo_mail) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(abs, arginfo_abs) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(ceil, arginfo_ceil) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(floor, arginfo_floor) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(round, arginfo_round) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sin, arginfo_sin) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(cos, arginfo_cos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(tan, arginfo_tan) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(asin, arginfo_asin) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(acos, arginfo_acos) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atan, arginfo_atan) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atanh, arginfo_atanh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(atan2, arginfo_atan2) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sinh, arginfo_sinh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(cosh, arginfo_cosh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(tanh, arginfo_tanh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(asinh, arginfo_asinh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(acosh, arginfo_acosh) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(expm1, arginfo_expm1) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log1p, arginfo_log1p) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pi, arginfo_pi) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_finite, arginfo_is_finite) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_nan, arginfo_is_nan) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(intdiv, arginfo_intdiv) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_infinite, arginfo_is_infinite) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pow, arginfo_pow) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(exp, arginfo_exp) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log, arginfo_log) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(log10, arginfo_log10) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(sqrt, arginfo_sqrt) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hypot, arginfo_hypot) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(deg2rad, arginfo_deg2rad) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rad2deg, arginfo_rad2deg) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(bindec, arginfo_bindec) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hexdec, arginfo_hexdec) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(octdec, arginfo_octdec) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(decbin, arginfo_decbin) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(decoct, arginfo_decoct) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(dechex, arginfo_dechex) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(base_convert, arginfo_base_convert) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(number_format, arginfo_number_format) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(fmod, arginfo_fmod) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(fdiv, arginfo_fdiv) +#if defined(HAVE_GETTIMEOFDAY) + ZEND_FE(microtime, arginfo_microtime) +#endif +#if defined(HAVE_GETTIMEOFDAY) + ZEND_FE(gettimeofday, arginfo_gettimeofday) +#endif +#if defined(HAVE_GETRUSAGE) + ZEND_FE(getrusage, arginfo_getrusage) +#endif + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(pack, arginfo_pack) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(unpack, arginfo_unpack) + ZEND_FE(password_get_info, arginfo_password_get_info) + ZEND_FE(password_hash, arginfo_password_hash) + ZEND_FE(password_needs_rehash, arginfo_password_needs_rehash) + ZEND_FE(password_verify, arginfo_password_verify) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(password_algos, arginfo_password_algos) +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) + ZEND_FE(proc_open, arginfo_proc_open) +#endif +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) + ZEND_FE(proc_close, arginfo_proc_close) +#endif +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) + ZEND_FE(proc_terminate, arginfo_proc_terminate) +#endif +#if defined(PHP_CAN_SUPPORT_PROC_OPEN) + ZEND_FE(proc_get_status, arginfo_proc_get_status) +#endif + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_decode, arginfo_quoted_printable_decode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(quoted_printable_encode, arginfo_quoted_printable_encode) + ZEND_FE(soundex, arginfo_soundex) + ZEND_FE(stream_select, arginfo_stream_select) + ZEND_FE(stream_context_create, arginfo_stream_context_create) + ZEND_FE(stream_context_set_params, arginfo_stream_context_set_params) + ZEND_FE(stream_context_get_params, arginfo_stream_context_get_params) + ZEND_FE(stream_context_set_option, arginfo_stream_context_set_option) + ZEND_FE(stream_context_set_options, arginfo_stream_context_set_options) + ZEND_FE(stream_context_get_options, arginfo_stream_context_get_options) + ZEND_FE(stream_context_get_default, arginfo_stream_context_get_default) + ZEND_FE(stream_context_set_default, arginfo_stream_context_set_default) + ZEND_FE(stream_filter_prepend, arginfo_stream_filter_prepend) + ZEND_FE(stream_filter_append, arginfo_stream_filter_append) + ZEND_FE(stream_filter_remove, arginfo_stream_filter_remove) + ZEND_FE(stream_socket_client, arginfo_stream_socket_client) + ZEND_FE(stream_socket_server, arginfo_stream_socket_server) + ZEND_FE(stream_socket_accept, arginfo_stream_socket_accept) + ZEND_FE(stream_socket_get_name, arginfo_stream_socket_get_name) + ZEND_FE(stream_socket_recvfrom, arginfo_stream_socket_recvfrom) + ZEND_FE(stream_socket_sendto, arginfo_stream_socket_sendto) + ZEND_FE(stream_socket_enable_crypto, arginfo_stream_socket_enable_crypto) +#if defined(HAVE_SHUTDOWN) + ZEND_FE(stream_socket_shutdown, arginfo_stream_socket_shutdown) +#endif +#if defined(HAVE_SOCKETPAIR) + ZEND_FE(stream_socket_pair, arginfo_stream_socket_pair) +#endif + ZEND_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream) + ZEND_FE(stream_get_contents, arginfo_stream_get_contents) + ZEND_FE(stream_supports_lock, arginfo_stream_supports_lock) + ZEND_FE(stream_set_write_buffer, arginfo_stream_set_write_buffer) + ZEND_FALIAS(set_file_buffer, stream_set_write_buffer, arginfo_set_file_buffer) + ZEND_FE(stream_set_read_buffer, arginfo_stream_set_read_buffer) + ZEND_FE(stream_set_blocking, arginfo_stream_set_blocking) + ZEND_FALIAS(socket_set_blocking, stream_set_blocking, arginfo_socket_set_blocking) + ZEND_FE(stream_get_meta_data, arginfo_stream_get_meta_data) + ZEND_FALIAS(socket_get_status, stream_get_meta_data, arginfo_socket_get_status) + ZEND_FE(stream_get_line, arginfo_stream_get_line) + ZEND_FE(stream_resolve_include_path, arginfo_stream_resolve_include_path) + ZEND_FE(stream_get_wrappers, arginfo_stream_get_wrappers) + ZEND_FE(stream_get_transports, arginfo_stream_get_transports) + ZEND_FE(stream_is_local, arginfo_stream_is_local) + ZEND_FE(stream_isatty, arginfo_stream_isatty) +#if defined(PHP_WIN32) + ZEND_FE(sapi_windows_vt100_support, arginfo_sapi_windows_vt100_support) +#endif + ZEND_FE(stream_set_chunk_size, arginfo_stream_set_chunk_size) +#if (defined(HAVE_SYS_TIME_H) || defined(PHP_WIN32)) + ZEND_FE(stream_set_timeout, arginfo_stream_set_timeout) +#endif +#if (defined(HAVE_SYS_TIME_H) || defined(PHP_WIN32)) + ZEND_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_socket_set_timeout) +#endif + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(gettype, arginfo_gettype) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(get_debug_type, arginfo_get_debug_type) + ZEND_FE(settype, arginfo_settype) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(intval, arginfo_intval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(floatval, arginfo_floatval) + ZEND_FALIAS(doubleval, floatval, arginfo_doubleval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(boolval, arginfo_boolval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strval, arginfo_strval) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_null, arginfo_is_null) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_resource, arginfo_is_resource) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_bool, arginfo_is_bool) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_int, arginfo_is_int) + ZEND_FALIAS(is_integer, is_int, arginfo_is_integer) + ZEND_FALIAS(is_long, is_int, arginfo_is_long) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_float, arginfo_is_float) + ZEND_FALIAS(is_double, is_float, arginfo_is_double) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_numeric, arginfo_is_numeric) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_string, arginfo_is_string) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_array, arginfo_is_array) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_object, arginfo_is_object) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_scalar, arginfo_is_scalar) + ZEND_FE(is_callable, arginfo_is_callable) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_iterable, arginfo_is_iterable) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(is_countable, arginfo_is_countable) +#if defined(HAVE_GETTIMEOFDAY) + ZEND_FE(uniqid, arginfo_uniqid) +#endif + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(parse_url, arginfo_parse_url) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(urlencode, arginfo_urlencode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(urldecode, arginfo_urldecode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rawurlencode, arginfo_rawurlencode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(rawurldecode, arginfo_rawurldecode) + ZEND_FE(get_headers, arginfo_get_headers) + ZEND_FE(stream_bucket_make_writeable, arginfo_stream_bucket_make_writeable) + ZEND_FE(stream_bucket_prepend, arginfo_stream_bucket_prepend) + ZEND_FE(stream_bucket_append, arginfo_stream_bucket_append) + ZEND_FE(stream_bucket_new, arginfo_stream_bucket_new) + ZEND_FE(stream_get_filters, arginfo_stream_get_filters) + ZEND_FE(stream_filter_register, arginfo_stream_filter_register) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(convert_uuencode, arginfo_convert_uuencode) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(convert_uudecode, arginfo_convert_uudecode) + ZEND_FE(var_dump, arginfo_var_dump) + ZEND_FE(var_export, arginfo_var_export) + ZEND_FE(debug_zval_dump, arginfo_debug_zval_dump) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(serialize, arginfo_serialize) + ZEND_FE(unserialize, arginfo_unserialize) + ZEND_FE(memory_get_usage, arginfo_memory_get_usage) + ZEND_FE(memory_get_peak_usage, arginfo_memory_get_peak_usage) + ZEND_FE(memory_reset_peak_usage, arginfo_memory_reset_peak_usage) + ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(version_compare, arginfo_version_compare) +#if defined(PHP_WIN32) + ZEND_FE(sapi_windows_cp_set, arginfo_sapi_windows_cp_set) +#endif +#if defined(PHP_WIN32) + ZEND_FE(sapi_windows_cp_get, arginfo_sapi_windows_cp_get) +#endif +#if defined(PHP_WIN32) + ZEND_FE(sapi_windows_cp_conv, arginfo_sapi_windows_cp_conv) +#endif +#if defined(PHP_WIN32) + ZEND_FE(sapi_windows_cp_is_utf8, arginfo_sapi_windows_cp_is_utf8) +#endif +#if defined(PHP_WIN32) + ZEND_FE(sapi_windows_set_ctrl_handler, arginfo_sapi_windows_set_ctrl_handler) +#endif +#if defined(PHP_WIN32) + ZEND_FE(sapi_windows_generate_ctrl_event, arginfo_sapi_windows_generate_ctrl_event) +#endif + ZEND_FE_END +}; + + +static const zend_function_entry class___PHP_Incomplete_Class_methods[] = { + ZEND_FE_END +}; + + +static const zend_function_entry class_AssertionError_methods[] = { + ZEND_FE_END +}; + +static void register_basic_functions_symbols(int module_number) +{ + REGISTER_LONG_CONSTANT("EXTR_OVERWRITE", PHP_EXTR_OVERWRITE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("EXTR_SKIP", PHP_EXTR_SKIP, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("EXTR_PREFIX_SAME", PHP_EXTR_PREFIX_SAME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("EXTR_PREFIX_ALL", PHP_EXTR_PREFIX_ALL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("EXTR_PREFIX_INVALID", PHP_EXTR_PREFIX_INVALID, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("EXTR_PREFIX_IF_EXISTS", PHP_EXTR_PREFIX_IF_EXISTS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("EXTR_IF_EXISTS", PHP_EXTR_IF_EXISTS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("EXTR_REFS", PHP_EXTR_REFS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_ASC", PHP_SORT_ASC, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_DESC", PHP_SORT_DESC, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_REGULAR", PHP_SORT_REGULAR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_NUMERIC", PHP_SORT_NUMERIC, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_STRING", PHP_SORT_STRING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_LOCALE_STRING", PHP_SORT_LOCALE_STRING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_NATURAL", PHP_SORT_NATURAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_FLAG_CASE", PHP_SORT_FLAG_CASE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CASE_LOWER", PHP_CASE_LOWER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CASE_UPPER", PHP_CASE_UPPER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("COUNT_NORMAL", PHP_COUNT_NORMAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("COUNT_RECURSIVE", PHP_COUNT_RECURSIVE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ARRAY_FILTER_USE_BOTH", ARRAY_FILTER_USE_BOTH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ARRAY_FILTER_USE_KEY", ARRAY_FILTER_USE_KEY, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ASSERT_ACTIVE", PHP_ASSERT_ACTIVE, CONST_PERSISTENT | CONST_DEPRECATED); + REGISTER_LONG_CONSTANT("ASSERT_CALLBACK", PHP_ASSERT_CALLBACK, CONST_PERSISTENT | CONST_DEPRECATED); + REGISTER_LONG_CONSTANT("ASSERT_BAIL", PHP_ASSERT_BAIL, CONST_PERSISTENT | CONST_DEPRECATED); + REGISTER_LONG_CONSTANT("ASSERT_WARNING", PHP_ASSERT_WARNING, CONST_PERSISTENT | CONST_DEPRECATED); + REGISTER_LONG_CONSTANT("ASSERT_EXCEPTION", PHP_ASSERT_EXCEPTION, CONST_PERSISTENT | CONST_DEPRECATED); + REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CONNECTION_TIMEOUT", PHP_CONNECTION_TIMEOUT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INI_USER", ZEND_INI_USER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INI_PERDIR", ZEND_INI_PERDIR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INI_SYSTEM", ZEND_INI_SYSTEM, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INI_ALL", ZEND_INI_ALL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INI_SCANNER_NORMAL", ZEND_INI_SCANNER_NORMAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INI_SCANNER_RAW", ZEND_INI_SCANNER_RAW, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INI_SCANNER_TYPED", ZEND_INI_SCANNER_TYPED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_URL_SCHEME", PHP_URL_SCHEME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_URL_HOST", PHP_URL_HOST, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_URL_PORT", PHP_URL_PORT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_URL_USER", PHP_URL_USER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_URL_PASS", PHP_URL_PASS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_URL_PATH", PHP_URL_PATH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_URL_QUERY", PHP_URL_QUERY, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_URL_FRAGMENT", PHP_URL_FRAGMENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_QUERY_RFC1738", PHP_QUERY_RFC1738, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_QUERY_RFC3986", PHP_QUERY_RFC3986, CONST_PERSISTENT); + REGISTER_DOUBLE_CONSTANT("M_E", M_E, CONST_PERSISTENT); + ZEND_ASSERT(M_E == 2.718281828459045); + REGISTER_DOUBLE_CONSTANT("M_LOG2E", M_LOG2E, CONST_PERSISTENT); + ZEND_ASSERT(M_LOG2E == 1.4426950408889634); + REGISTER_DOUBLE_CONSTANT("M_LOG10E", M_LOG10E, CONST_PERSISTENT); + ZEND_ASSERT(M_LOG10E == 0.4342944819032518); + REGISTER_DOUBLE_CONSTANT("M_LN2", M_LN2, CONST_PERSISTENT); + ZEND_ASSERT(M_LN2 == 0.6931471805599453); + REGISTER_DOUBLE_CONSTANT("M_LN10", M_LN10, CONST_PERSISTENT); + ZEND_ASSERT(M_LN10 == 2.302585092994046); + REGISTER_DOUBLE_CONSTANT("M_PI", M_PI, CONST_PERSISTENT); + ZEND_ASSERT(M_PI == 3.141592653589793); + REGISTER_DOUBLE_CONSTANT("M_PI_2", M_PI_2, CONST_PERSISTENT); + ZEND_ASSERT(M_PI_2 == 1.5707963267948966); + REGISTER_DOUBLE_CONSTANT("M_PI_4", M_PI_4, CONST_PERSISTENT); + ZEND_ASSERT(M_PI_4 == 0.7853981633974483); + REGISTER_DOUBLE_CONSTANT("M_1_PI", M_1_PI, CONST_PERSISTENT); + ZEND_ASSERT(M_1_PI == 0.3183098861837907); + REGISTER_DOUBLE_CONSTANT("M_2_PI", M_2_PI, CONST_PERSISTENT); + ZEND_ASSERT(M_2_PI == 0.6366197723675814); + REGISTER_DOUBLE_CONSTANT("M_SQRTPI", M_SQRTPI, CONST_PERSISTENT); + ZEND_ASSERT(M_SQRTPI == 1.772453850905516); + REGISTER_DOUBLE_CONSTANT("M_2_SQRTPI", M_2_SQRTPI, CONST_PERSISTENT); + ZEND_ASSERT(M_2_SQRTPI == 1.1283791670955126); + REGISTER_DOUBLE_CONSTANT("M_LNPI", M_LNPI, CONST_PERSISTENT); + ZEND_ASSERT(M_LNPI == 1.1447298858494002); + REGISTER_DOUBLE_CONSTANT("M_EULER", M_EULER, CONST_PERSISTENT); + ZEND_ASSERT(M_EULER == 0.5772156649015329); + REGISTER_DOUBLE_CONSTANT("M_SQRT2", M_SQRT2, CONST_PERSISTENT); + ZEND_ASSERT(M_SQRT2 == 1.4142135623730951); + REGISTER_DOUBLE_CONSTANT("M_SQRT1_2", M_SQRT1_2, CONST_PERSISTENT); + ZEND_ASSERT(M_SQRT1_2 == 0.7071067811865476); + REGISTER_DOUBLE_CONSTANT("M_SQRT3", M_SQRT3, CONST_PERSISTENT); + ZEND_ASSERT(M_SQRT3 == 1.7320508075688772); + REGISTER_DOUBLE_CONSTANT("INF", ZEND_INFINITY, CONST_PERSISTENT); + REGISTER_DOUBLE_CONSTANT("NAN", ZEND_NAN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_UP", PHP_ROUND_HALF_UP, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_DOWN", PHP_ROUND_HALF_DOWN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_EVEN", PHP_ROUND_HALF_EVEN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_ODD", PHP_ROUND_HALF_ODD, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SALT_LENGTH", PHP_MAX_SALT_LEN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_STD_DES", 1, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_EXT_DES", 1, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_MD5", 1, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_BLOWFISH", 1, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SHA256", 1, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SHA512", 1, CONST_PERSISTENT); +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_A", PHP_DNS_A, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_NS", PHP_DNS_NS, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_CNAME", PHP_DNS_CNAME, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_SOA", PHP_DNS_SOA, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_PTR", PHP_DNS_PTR, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_HINFO", PHP_DNS_HINFO, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) && (!defined(PHP_WIN32)) + REGISTER_LONG_CONSTANT("DNS_CAA", PHP_DNS_CAA, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_MX", PHP_DNS_MX, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_TXT", PHP_DNS_TXT, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_SRV", PHP_DNS_SRV, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_NAPTR", PHP_DNS_NAPTR, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_AAAA", PHP_DNS_AAAA, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_A6", PHP_DNS_A6, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_ANY", PHP_DNS_ANY, CONST_PERSISTENT); +#endif +#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) + REGISTER_LONG_CONSTANT("DNS_ALL", PHP_DNS_ALL, CONST_PERSISTENT); +#endif + REGISTER_LONG_CONSTANT("HTML_SPECIALCHARS", PHP_HTML_SPECIALCHARS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("HTML_ENTITIES", PHP_HTML_ENTITIES, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_COMPAT", ENT_COMPAT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_QUOTES", ENT_QUOTES, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_NOQUOTES", ENT_NOQUOTES, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_IGNORE", ENT_IGNORE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_SUBSTITUTE", ENT_SUBSTITUTE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_DISALLOWED", ENT_DISALLOWED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_HTML401", ENT_HTML401, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_XML1", ENT_XML1, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_XHTML", ENT_XHTML, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("ENT_HTML5", ENT_HTML5, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_GIF", IMAGE_FILETYPE_GIF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_JPEG", IMAGE_FILETYPE_JPEG, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_PNG", IMAGE_FILETYPE_PNG, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_SWF", IMAGE_FILETYPE_SWF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_PSD", IMAGE_FILETYPE_PSD, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_BMP", IMAGE_FILETYPE_BMP, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_TIFF_II", IMAGE_FILETYPE_TIFF_II, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_TIFF_MM", IMAGE_FILETYPE_TIFF_MM, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_JPC", IMAGE_FILETYPE_JPC, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_JP2", IMAGE_FILETYPE_JP2, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_JPX", IMAGE_FILETYPE_JPX, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_JB2", IMAGE_FILETYPE_JB2, CONST_PERSISTENT); +#if (defined(HAVE_ZLIB) && !defined(COMPILE_DL_ZLIB)) + REGISTER_LONG_CONSTANT("IMAGETYPE_SWC", IMAGE_FILETYPE_SWC, CONST_PERSISTENT); +#endif + REGISTER_LONG_CONSTANT("IMAGETYPE_IFF", IMAGE_FILETYPE_IFF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_WBMP", IMAGE_FILETYPE_WBMP, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_JPEG2000", IMAGE_FILETYPE_JPC, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_XBM", IMAGE_FILETYPE_XBM, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_ICO", IMAGE_FILETYPE_ICO, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_WEBP", IMAGE_FILETYPE_WEBP, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_AVIF", IMAGE_FILETYPE_AVIF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_UNKNOWN", IMAGE_FILETYPE_UNKNOWN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMAGETYPE_COUNT", IMAGE_FILETYPE_COUNT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INFO_GENERAL", PHP_INFO_GENERAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INFO_CREDITS", PHP_INFO_CREDITS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INFO_CONFIGURATION", PHP_INFO_CONFIGURATION, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INFO_MODULES", PHP_INFO_MODULES, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INFO_ENVIRONMENT", PHP_INFO_ENVIRONMENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INFO_VARIABLES", PHP_INFO_VARIABLES, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INFO_LICENSE", PHP_INFO_LICENSE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("INFO_ALL", PHP_INFO_ALL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CREDITS_GROUP", PHP_CREDITS_GROUP, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CREDITS_GENERAL", PHP_CREDITS_GENERAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CREDITS_SAPI", PHP_CREDITS_SAPI, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CREDITS_MODULES", PHP_CREDITS_MODULES, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CREDITS_DOCS", PHP_CREDITS_DOCS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CREDITS_FULLPAGE", PHP_CREDITS_FULLPAGE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CREDITS_QA", PHP_CREDITS_QA, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CREDITS_ALL", PHP_CREDITS_ALL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_EMERG", LOG_EMERG, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_ALERT", LOG_ALERT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_CRIT", LOG_CRIT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_ERR", LOG_ERR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_WARNING", LOG_WARNING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_NOTICE", LOG_NOTICE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_INFO", LOG_INFO, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_DEBUG", LOG_DEBUG, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_KERN", LOG_KERN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_USER", LOG_USER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_MAIL", LOG_MAIL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_DAEMON", LOG_DAEMON, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_AUTH", LOG_AUTH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_SYSLOG", LOG_SYSLOG, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_LPR", LOG_LPR, CONST_PERSISTENT); +#if defined(LOG_NEWS) + REGISTER_LONG_CONSTANT("LOG_NEWS", LOG_NEWS, CONST_PERSISTENT); +#endif +#if defined(LOG_UUCP) + REGISTER_LONG_CONSTANT("LOG_UUCP", LOG_UUCP, CONST_PERSISTENT); +#endif +#if defined(LOG_CRON) + REGISTER_LONG_CONSTANT("LOG_CRON", LOG_CRON, CONST_PERSISTENT); +#endif +#if defined(LOG_AUTHPRIV) + REGISTER_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_PERSISTENT); +#endif +#if !defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_PERSISTENT); +#endif +#if !defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_PERSISTENT); +#endif +#if !defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_PERSISTENT); +#endif +#if !defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("LOG_LOCAL3", LOG_LOCAL3, CONST_PERSISTENT); +#endif +#if !defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("LOG_LOCAL4", LOG_LOCAL4, CONST_PERSISTENT); +#endif +#if !defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("LOG_LOCAL5", LOG_LOCAL5, CONST_PERSISTENT); +#endif +#if !defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("LOG_LOCAL6", LOG_LOCAL6, CONST_PERSISTENT); +#endif +#if !defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("LOG_LOCAL7", LOG_LOCAL7, CONST_PERSISTENT); +#endif + REGISTER_LONG_CONSTANT("LOG_PID", LOG_PID, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_CONS", LOG_CONS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_ODELAY", LOG_ODELAY, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOG_NDELAY", LOG_NDELAY, CONST_PERSISTENT); +#if defined(LOG_NOWAIT) + REGISTER_LONG_CONSTANT("LOG_NOWAIT", LOG_NOWAIT, CONST_PERSISTENT); +#endif +#if defined(LOG_PERROR) + REGISTER_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_PERSISTENT); +#endif + REGISTER_LONG_CONSTANT("STR_PAD_LEFT", PHP_STR_PAD_LEFT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STR_PAD_RIGHT", PHP_STR_PAD_RIGHT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STR_PAD_BOTH", PHP_STR_PAD_BOTH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PATHINFO_DIRNAME", PHP_PATHINFO_DIRNAME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PATHINFO_BASENAME", PHP_PATHINFO_BASENAME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PATHINFO_EXTENSION", PHP_PATHINFO_EXTENSION, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PATHINFO_FILENAME", PHP_PATHINFO_FILENAME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PATHINFO_ALL", PHP_PATHINFO_ALL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CHAR_MAX", CHAR_MAX, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LC_CTYPE", LC_CTYPE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LC_NUMERIC", LC_NUMERIC, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LC_TIME", LC_TIME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LC_COLLATE", LC_COLLATE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LC_MONETARY", LC_MONETARY, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LC_ALL", LC_ALL, CONST_PERSISTENT); +#if defined(LC_MESSAGES) + REGISTER_LONG_CONSTANT("LC_MESSAGES", LC_MESSAGES, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABDAY_1) + REGISTER_LONG_CONSTANT("ABDAY_1", ABDAY_1, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABDAY_1) + REGISTER_LONG_CONSTANT("ABDAY_2", ABDAY_2, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABDAY_1) + REGISTER_LONG_CONSTANT("ABDAY_3", ABDAY_3, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABDAY_1) + REGISTER_LONG_CONSTANT("ABDAY_4", ABDAY_4, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABDAY_1) + REGISTER_LONG_CONSTANT("ABDAY_5", ABDAY_5, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABDAY_1) + REGISTER_LONG_CONSTANT("ABDAY_6", ABDAY_6, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABDAY_1) + REGISTER_LONG_CONSTANT("ABDAY_7", ABDAY_7, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(DAY_1) + REGISTER_LONG_CONSTANT("DAY_1", DAY_1, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(DAY_1) + REGISTER_LONG_CONSTANT("DAY_2", DAY_2, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(DAY_1) + REGISTER_LONG_CONSTANT("DAY_3", DAY_3, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(DAY_1) + REGISTER_LONG_CONSTANT("DAY_4", DAY_4, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(DAY_1) + REGISTER_LONG_CONSTANT("DAY_5", DAY_5, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(DAY_1) + REGISTER_LONG_CONSTANT("DAY_6", DAY_6, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(DAY_1) + REGISTER_LONG_CONSTANT("DAY_7", DAY_7, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_1", ABMON_1, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_2", ABMON_2, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_3", ABMON_3, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_4", ABMON_4, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_5", ABMON_5, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_6", ABMON_6, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_7", ABMON_7, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_8", ABMON_8, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_9", ABMON_9, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_10", ABMON_10, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_11", ABMON_11, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ABMON_1) + REGISTER_LONG_CONSTANT("ABMON_12", ABMON_12, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_1", MON_1, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_2", MON_2, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_3", MON_3, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_4", MON_4, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_5", MON_5, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_6", MON_6, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_7", MON_7, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_8", MON_8, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_9", MON_9, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_10", MON_10, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_11", MON_11, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_1) + REGISTER_LONG_CONSTANT("MON_12", MON_12, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(AM_STR) + REGISTER_LONG_CONSTANT("AM_STR", AM_STR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(PM_STR) + REGISTER_LONG_CONSTANT("PM_STR", PM_STR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(D_T_FMT) + REGISTER_LONG_CONSTANT("D_T_FMT", D_T_FMT, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(D_FMT) + REGISTER_LONG_CONSTANT("D_FMT", D_FMT, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(T_FMT) + REGISTER_LONG_CONSTANT("T_FMT", T_FMT, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(T_FMT_AMPM) + REGISTER_LONG_CONSTANT("T_FMT_AMPM", T_FMT_AMPM, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ERA) + REGISTER_LONG_CONSTANT("ERA", ERA, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ERA_YEAR) + REGISTER_LONG_CONSTANT("ERA_YEAR", ERA_YEAR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ERA_D_T_FMT) + REGISTER_LONG_CONSTANT("ERA_D_T_FMT", ERA_D_T_FMT, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ERA_D_FMT) + REGISTER_LONG_CONSTANT("ERA_D_FMT", ERA_D_FMT, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ERA_T_FMT) + REGISTER_LONG_CONSTANT("ERA_T_FMT", ERA_T_FMT, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(ALT_DIGITS) + REGISTER_LONG_CONSTANT("ALT_DIGITS", ALT_DIGITS, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(INT_CURR_SYMBOL) + REGISTER_LONG_CONSTANT("INT_CURR_SYMBOL", INT_CURR_SYMBOL, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(CURRENCY_SYMBOL) + REGISTER_LONG_CONSTANT("CURRENCY_SYMBOL", CURRENCY_SYMBOL, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(CRNCYSTR) + REGISTER_LONG_CONSTANT("CRNCYSTR", CRNCYSTR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_DECIMAL_POINT) + REGISTER_LONG_CONSTANT("MON_DECIMAL_POINT", MON_DECIMAL_POINT, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_THOUSANDS_SEP) + REGISTER_LONG_CONSTANT("MON_THOUSANDS_SEP", MON_THOUSANDS_SEP, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(MON_GROUPING) + REGISTER_LONG_CONSTANT("MON_GROUPING", MON_GROUPING, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(POSITIVE_SIGN) + REGISTER_LONG_CONSTANT("POSITIVE_SIGN", POSITIVE_SIGN, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(NEGATIVE_SIGN) + REGISTER_LONG_CONSTANT("NEGATIVE_SIGN", NEGATIVE_SIGN, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(INT_FRAC_DIGITS) + REGISTER_LONG_CONSTANT("INT_FRAC_DIGITS", INT_FRAC_DIGITS, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(FRAC_DIGITS) + REGISTER_LONG_CONSTANT("FRAC_DIGITS", FRAC_DIGITS, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(P_CS_PRECEDES) + REGISTER_LONG_CONSTANT("P_CS_PRECEDES", P_CS_PRECEDES, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(P_SEP_BY_SPACE) + REGISTER_LONG_CONSTANT("P_SEP_BY_SPACE", P_SEP_BY_SPACE, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(N_CS_PRECEDES) + REGISTER_LONG_CONSTANT("N_CS_PRECEDES", N_CS_PRECEDES, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(N_SEP_BY_SPACE) + REGISTER_LONG_CONSTANT("N_SEP_BY_SPACE", N_SEP_BY_SPACE, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(P_SIGN_POSN) + REGISTER_LONG_CONSTANT("P_SIGN_POSN", P_SIGN_POSN, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(N_SIGN_POSN) + REGISTER_LONG_CONSTANT("N_SIGN_POSN", N_SIGN_POSN, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(DECIMAL_POINT) + REGISTER_LONG_CONSTANT("DECIMAL_POINT", DECIMAL_POINT, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(RADIXCHAR) + REGISTER_LONG_CONSTANT("RADIXCHAR", RADIXCHAR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(THOUSANDS_SEP) + REGISTER_LONG_CONSTANT("THOUSANDS_SEP", THOUSANDS_SEP, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(THOUSEP) + REGISTER_LONG_CONSTANT("THOUSEP", THOUSEP, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(GROUPING) + REGISTER_LONG_CONSTANT("GROUPING", GROUPING, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(YESEXPR) + REGISTER_LONG_CONSTANT("YESEXPR", YESEXPR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(NOEXPR) + REGISTER_LONG_CONSTANT("NOEXPR", NOEXPR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(YESSTR) + REGISTER_LONG_CONSTANT("YESSTR", YESSTR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(NOSTR) + REGISTER_LONG_CONSTANT("NOSTR", NOSTR, CONST_PERSISTENT); +#endif +#if defined(HAVE_NL_LANGINFO) && defined(CODESET) + REGISTER_LONG_CONSTANT("CODESET", CODESET, CONST_PERSISTENT); +#endif + + + zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "crypt", sizeof("crypt") - 1), 0, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); + + zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "password_hash", sizeof("password_hash") - 1), 0, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); + + zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "password_verify", sizeof("password_verify") - 1), 0, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); +} + +static zend_class_entry *register_class___PHP_Incomplete_Class(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "__PHP_Incomplete_Class", class___PHP_Incomplete_Class_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES; + + zend_string *attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, 1); + zend_add_class_attribute(class_entry, attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0, 0); + zend_string_release(attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0); + + return class_entry; +} + +static zend_class_entry *register_class_AssertionError(zend_class_entry *class_entry_Error) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "AssertionError", class_AssertionError_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Error); + + return class_entry; +} diff --git a/include/php/ext/standard/crc32.h b/include/php/ext/standard/crc32.h new file mode 100644 index 0000000..bdf45a4 --- /dev/null +++ b/include/php/ext/standard/crc32.h @@ -0,0 +1,104 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +/* + * This code implements the AUTODIN II polynomial + * The variable corresponding to the macro argument "crc" should + * be an unsigned long. + * Original code by Spencer Garrett + */ + +#define CRC32(crc, ch) (crc = (crc >> 8) ^ crc32tab[(crc ^ (ch)) & 0xff]) + +#define php_crc32_bulk_init() (0 ^ 0xffffffff) +#define php_crc32_bulk_end(c) ((c) ^ 0xffffffff) + +PHPAPI uint32_t php_crc32_bulk_update(uint32_t crc, const char *p, size_t nr); + +/* Return FAILURE if stream reading fail */ +PHPAPI int php_crc32_stream_bulk_update(uint32_t *crc, php_stream *fp, size_t nr); + +/* generated using the AUTODIN II polynomial + * x^32 + x^26 + x^23 + x^22 + x^16 + + * x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1 + */ + +static const unsigned int crc32tab[256] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +}; diff --git a/include/php/ext/standard/crc32_x86.h b/include/php/ext/standard/crc32_x86.h new file mode 100644 index 0000000..6420030 --- /dev/null +++ b/include/php/ext/standard/crc32_x86.h @@ -0,0 +1,52 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Frank Du | + +----------------------------------------------------------------------+ +*/ + +#ifndef _CRC32_X86_HEADER_H_ +#define _CRC32_X86_HEADER_H_ + +#include "php.h" + +typedef enum { + /* polynomial: 0x04C11DB7, used by bzip */ + X86_CRC32 = 0, + /* + polynomial: 0x04C11DB7 with reversed ordering, + used by ethernet (IEEE 802.3), gzip, zip, png, etc + */ + X86_CRC32B, + /* + polynomial: 0x1EDC6F41 with reversed ordering, + used by iSCSI, SCTP, Btrfs, ext4, etc + */ + X86_CRC32C, + X86_CRC32_MAX, +} X86_CRC32_TYPE; + +#if ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PTR +PHP_MINIT_FUNCTION(crc32_x86_intrin); +#endif + +#if ZEND_INTRIN_SSE4_2_PCLMUL_NATIVE || ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER +/* Return the size processed by SIMD routine */ +size_t crc32_x86_simd_update(X86_CRC32_TYPE type, uint32_t *crc, const unsigned char *p, size_t nr); +#else +static inline size_t crc32_x86_simd_update(X86_CRC32_TYPE type, uint32_t *crc, const unsigned char *p, size_t nr) +{ + return 0; +} +#endif + +#endif diff --git a/include/php/ext/standard/credits.h b/include/php/ext/standard/credits.h new file mode 100644 index 0000000..a0c5d1e --- /dev/null +++ b/include/php/ext/standard/credits.h @@ -0,0 +1,38 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rasmus Lerdorf | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef CREDITS_H +#define CREDITS_H + +#ifndef HAVE_CREDITS_DEFS +#define HAVE_CREDITS_DEFS + +#define PHP_CREDITS_GROUP (1<<0) +#define PHP_CREDITS_GENERAL (1<<1) +#define PHP_CREDITS_SAPI (1<<2) +#define PHP_CREDITS_MODULES (1<<3) +#define PHP_CREDITS_DOCS (1<<4) +#define PHP_CREDITS_FULLPAGE (1<<5) +#define PHP_CREDITS_QA (1<<6) +#define PHP_CREDITS_WEB (1<<7) +#define PHP_CREDITS_ALL 0xFFFFFFFF + +#endif /* HAVE_CREDITS_DEFS */ + +PHPAPI void php_print_credits(int flag); + +#endif diff --git a/include/php/ext/standard/credits_ext.h b/include/php/ext/standard/credits_ext.h new file mode 100644 index 0000000..093e56f --- /dev/null +++ b/include/php/ext/standard/credits_ext.h @@ -0,0 +1,81 @@ +/* + DO NOT EDIT THIS FILE! + + it has been automatically created by scripts/dev/credits from + the information found in the various ext/.../CREDITS and + sapi/.../CREDITS files + + if you want to change an entry you have to edit the appropriate + CREDITS file instead + +*/ + +CREDIT_LINE("BC Math", "Andi Gutmans"); +CREDIT_LINE("Bzip2", "Sterling Hughes"); +CREDIT_LINE("Calendar", "Shane Caraveo, Colin Viebrock, Hartmut Holzgraefe, Wez Furlong"); +CREDIT_LINE("COM and .Net", "Wez Furlong"); +CREDIT_LINE("ctype", "Hartmut Holzgraefe"); +CREDIT_LINE("cURL", "Sterling Hughes"); +CREDIT_LINE("Date/Time Support", "Derick Rethans"); +CREDIT_LINE("DB-LIB (MS SQL, Sybase)", "Wez Furlong, Frank M. Kromann, Adam Baratz"); +CREDIT_LINE("DBA", "Sascha Schumann, Marcus Boerger"); +CREDIT_LINE("DOM", "Christian Stocker, Rob Richards, Marcus Boerger"); +CREDIT_LINE("enchant", "Pierre-Alain Joye, Ilia Alshanetsky"); +CREDIT_LINE("EXIF", "Rasmus Lerdorf, Marcus Boerger"); +CREDIT_LINE("FFI", "Dmitry Stogov"); +CREDIT_LINE("fileinfo", "Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans, Anatol Belski"); +CREDIT_LINE("Firebird driver for PDO", "Ard Biesheuvel"); +CREDIT_LINE("FTP", "Stefan Esser, Andrew Skalski"); +CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger, Mark Randall"); +CREDIT_LINE("GetText", "Alex Plotnick"); +CREDIT_LINE("GNU GMP support", "Stanislav Malyshev"); +CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi"); +CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky"); +CREDIT_LINE("Input Filter", "Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky"); +CREDIT_LINE("Internationalization", "Ed Batutis, Vladimir Iordanov, Dmitry Lakhtyuk, Stanislav Malyshev, Vadim Savchuk, Kirti Velankar"); +CREDIT_LINE("JSON", "Jakub Zelenka, Omar Kilani, Scott MacVicar"); +CREDIT_LINE("LDAP", "Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas"); +CREDIT_LINE("LIBXML", "Christian Stocker, Rob Richards, Marcus Boerger, Wez Furlong, Shane Caraveo"); +CREDIT_LINE("Multibyte String Functions", "Tsukada Takuya, Rui Hirokawa"); +CREDIT_LINE("MySQL driver for PDO", "George Schlossnagle, Wez Furlong, Ilia Alshanetsky, Johannes Schlueter"); +CREDIT_LINE("MySQLi", "Zak Greant, Georg Richter, Andrey Hristov, Ulf Wendel"); +CREDIT_LINE("MySQLnd", "Andrey Hristov, Ulf Wendel, Georg Richter, Johannes Schlüter"); +CREDIT_LINE("OCI8", "Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong, Christopher Jones, Oracle Corporation"); +CREDIT_LINE("ODBC driver for PDO", "Wez Furlong"); +CREDIT_LINE("ODBC", "Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky"); +CREDIT_LINE("Opcache", "Andi Gutmans, Zeev Suraski, Stanislav Malyshev, Dmitry Stogov, Xinchen Hui"); +CREDIT_LINE("OpenSSL", "Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar, Eliot Lear"); +CREDIT_LINE("Oracle (OCI) driver for PDO", "Wez Furlong"); +CREDIT_LINE("pcntl", "Jason Greene, Arnaud Le Blanc"); +CREDIT_LINE("Perl Compatible Regexps", "Andrei Zmievski"); +CREDIT_LINE("PHP Archive", "Gregory Beaver, Marcus Boerger"); +CREDIT_LINE("PHP Data Objects", "Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle, Ilia Alshanetsky"); +CREDIT_LINE("PHP hash", "Sara Golemon, Rasmus Lerdorf, Stefan Esser, Michael Wallner, Scott MacVicar"); +CREDIT_LINE("Posix", "Kristian Koehntopp"); +CREDIT_LINE("PostgreSQL driver for PDO", "Edin Kadribasic, Ilia Alshanetsky"); +CREDIT_LINE("PostgreSQL", "Jouni Ahto, Zeev Suraski, Yasuo Ohgaki, Chris Kings-Lynne"); +CREDIT_LINE("Pspell", "Vlad Krupin"); +CREDIT_LINE("random", "Go Kudo, Tim Düsterhus, Guilliam Xavier, Christoph M. Becker, Jakub Zelenka, Bob Weinand, Máté Kocsis, and Original RNG implementators"); +CREDIT_LINE("Readline", "Thies C. Arntzen"); +CREDIT_LINE("Reflection", "Marcus Boerger, Timm Friebe, George Schlossnagle, Andrei Zmievski, Johannes Schlueter"); +CREDIT_LINE("Sessions", "Sascha Schumann, Andrei Zmievski"); +CREDIT_LINE("Shared Memory Operations", "Slava Poliakov, Ilia Alshanetsky"); +CREDIT_LINE("SimpleXML", "Sterling Hughes, Marcus Boerger, Rob Richards"); +CREDIT_LINE("SNMP", "Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Lawrance, Johann Hanne, Boris Lytochkin"); +CREDIT_LINE("SOAP", "Brad Lafountain, Shane Caraveo, Dmitry Stogov"); +CREDIT_LINE("Sockets", "Chris Vandomelen, Sterling Hughes, Daniel Beulshausen, Jason Greene"); +CREDIT_LINE("Sodium", "Frank Denis"); +CREDIT_LINE("SPL", "Marcus Boerger, Etienne Kneuss"); +CREDIT_LINE("SQLite 3.x driver for PDO", "Wez Furlong"); +CREDIT_LINE("SQLite3", "Scott MacVicar, Ilia Alshanetsky, Brad Dewar"); +CREDIT_LINE("System V Message based IPC", "Wez Furlong"); +CREDIT_LINE("System V Semaphores", "Tom May"); +CREDIT_LINE("System V Shared Memory", "Christian Cartus"); +CREDIT_LINE("tidy", "John Coggeshall, Ilia Alshanetsky"); +CREDIT_LINE("tokenizer", "Andrei Zmievski, Johannes Schlueter"); +CREDIT_LINE("XML", "Stig Bakken, Thies C. Arntzen, Sterling Hughes"); +CREDIT_LINE("XMLReader", "Rob Richards"); +CREDIT_LINE("XMLWriter", "Rob Richards, Pierre-Alain Joye"); +CREDIT_LINE("XSL", "Christian Stocker, Rob Richards"); +CREDIT_LINE("Zip", "Pierre-Alain Joye, Remi Collet"); +CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti, Michael Wallner"); diff --git a/include/php/ext/standard/credits_sapi.h b/include/php/ext/standard/credits_sapi.h new file mode 100644 index 0000000..d6553ea --- /dev/null +++ b/include/php/ext/standard/credits_sapi.h @@ -0,0 +1,19 @@ +/* + DO NOT EDIT THIS FILE! + + it has been automatically created by scripts/dev/credits from + the information found in the various ext/.../CREDITS and + sapi/.../CREDITS files + + if you want to change an entry you have to edit the appropriate + CREDITS file instead + +*/ + +CREDIT_LINE("Apache 2.0 Handler", "Ian Holsman, Justin Erenkrantz (based on Apache 2.0 Filter code)"); +CREDIT_LINE("CGI / FastCGI", "Rasmus Lerdorf, Stig Bakken, Shane Caraveo, Dmitry Stogov"); +CREDIT_LINE("CLI", "Edin Kadribasic, Marcus Boerger, Johannes Schlueter, Moriyoshi Koizumi, Xinchen Hui"); +CREDIT_LINE("Embed", "Edin Kadribasic"); +CREDIT_LINE("FastCGI Process Manager", "Andrei Nigmatulin, dreamcat4, Antony Dovgal, Jerome Loyet"); +CREDIT_LINE("litespeed", "George Wang"); +CREDIT_LINE("phpdbg", "Felipe Pena, Joe Watkins, Bob Weinand"); diff --git a/include/php/ext/standard/crypt_blowfish.h b/include/php/ext/standard/crypt_blowfish.h new file mode 100644 index 0000000..a1150b5 --- /dev/null +++ b/include/php/ext/standard/crypt_blowfish.h @@ -0,0 +1,23 @@ +/* + * Written by Solar Designer in 2000-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 2000-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * See crypt_blowfish.c for more information. + */ + +#ifndef _CRYPT_BLOWFISH_H +#define _CRYPT_BLOWFISH_H + +extern char *php_crypt_blowfish_rn(const char *key, const char *setting, + char *output, int size); + +#endif diff --git a/include/php/ext/standard/crypt_freesec.h b/include/php/ext/standard/crypt_freesec.h new file mode 100644 index 0000000..33bca14 --- /dev/null +++ b/include/php/ext/standard/crypt_freesec.h @@ -0,0 +1,28 @@ +#ifndef _CRYPT_FREESEC_H +#define _CRYPT_FREESEC_H + +#include + +#define MD5_HASH_MAX_LEN 120 + +struct php_crypt_extended_data { + int initialized; + uint32_t saltbits; + uint32_t old_salt; + uint32_t en_keysl[16], en_keysr[16]; + uint32_t de_keysl[16], de_keysr[16]; + uint32_t old_rawkey0, old_rawkey1; + char output[21]; +}; + +/* + * _crypt_extended_init() must be called explicitly before first use of + * _crypt_extended_r(). + */ + +void _crypt_extended_init(void); + +char *_crypt_extended_r(const unsigned char *key, const char *setting, + struct php_crypt_extended_data *data); + +#endif diff --git a/include/php/ext/standard/css.h b/include/php/ext/standard/css.h new file mode 100644 index 0000000..6771541 --- /dev/null +++ b/include/php/ext/standard/css.h @@ -0,0 +1,22 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Colin Viebrock | + +----------------------------------------------------------------------+ +*/ + +#ifndef CSS_H +#define CSS_H + +PHPAPI void php_info_print_css(void); + +#endif diff --git a/include/php/ext/standard/datetime.h b/include/php/ext/standard/datetime.h new file mode 100644 index 0000000..da87cb8 --- /dev/null +++ b/include/php/ext/standard/datetime.h @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef DATETIME_H +#define DATETIME_H + +PHPAPI char *php_std_date(time_t t); + +#endif /* DATETIME_H */ diff --git a/include/php/ext/standard/dir_arginfo.h b/include/php/ext/standard/dir_arginfo.h new file mode 100644 index 0000000..f46d0b2 --- /dev/null +++ b/include/php/ext/standard/dir_arginfo.h @@ -0,0 +1,45 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: b3890e798e609e306027b4717ce0c5e782884087 */ + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Directory_close, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Directory_rewind arginfo_class_Directory_close + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Directory_read, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() + + +ZEND_FUNCTION(closedir); +ZEND_FUNCTION(rewinddir); +ZEND_FUNCTION(readdir); + + +static const zend_function_entry class_Directory_methods[] = { + ZEND_ME_MAPPING(close, closedir, arginfo_class_Directory_close, ZEND_ACC_PUBLIC) + ZEND_ME_MAPPING(rewind, rewinddir, arginfo_class_Directory_rewind, ZEND_ACC_PUBLIC) + ZEND_ME_MAPPING(read, readdir, arginfo_class_Directory_read, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static zend_class_entry *register_class_Directory(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "Directory", class_Directory_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + + zval property_path_default_value; + ZVAL_UNDEF(&property_path_default_value); + zend_string *property_path_name = zend_string_init("path", sizeof("path") - 1, 1); + zend_declare_typed_property(class_entry, property_path_name, &property_path_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_string_release(property_path_name); + + zval property_handle_default_value; + ZVAL_UNDEF(&property_handle_default_value); + zend_string *property_handle_name = zend_string_init("handle", sizeof("handle") - 1, 1); + zend_declare_typed_property(class_entry, property_handle_name, &property_handle_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); + zend_string_release(property_handle_name); + + return class_entry; +} diff --git a/include/php/ext/standard/dl.h b/include/php/ext/standard/dl.h new file mode 100644 index 0000000..58de973 --- /dev/null +++ b/include/php/ext/standard/dl.h @@ -0,0 +1,31 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Brian Schaffner | + | Shane Caraveo | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef DL_H +#define DL_H + +PHPAPI int php_load_extension(const char *filename, int type, int start_now); +PHPAPI void php_dl(const char *file, int type, zval *return_value, int start_now); +PHPAPI void *php_load_shlib(const char *path, char **errp); + +/* dynamic loading functions */ +PHPAPI PHP_FUNCTION(dl); + +PHP_MINFO_FUNCTION(dl); + +#endif /* DL_H */ diff --git a/include/php/ext/standard/dl_arginfo.h b/include/php/ext/standard/dl_arginfo.h new file mode 100644 index 0000000..889e952 --- /dev/null +++ b/include/php/ext/standard/dl_arginfo.h @@ -0,0 +1,6 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 7dac6edd98e3e17669ae4bf0be7db89678059ca0 */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dl, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, extension_filename, IS_STRING, 0) +ZEND_END_ARG_INFO() diff --git a/include/php/ext/standard/exec.h b/include/php/ext/standard/exec.h new file mode 100644 index 0000000..db8c74a --- /dev/null +++ b/include/php/ext/standard/exec.h @@ -0,0 +1,27 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +#ifndef EXEC_H +#define EXEC_H + +PHP_MINIT_FUNCTION(proc_open); +PHP_MINIT_FUNCTION(exec); + +PHPAPI zend_string *php_escape_shell_cmd(const char *str); +PHPAPI zend_string *php_escape_shell_arg(const char *str); +PHPAPI int php_exec(int type, const char *cmd, zval *array, zval *return_value); + +#endif /* EXEC_H */ diff --git a/include/php/ext/standard/file.h b/include/php/ext/standard/file.h new file mode 100644 index 0000000..2b2307c --- /dev/null +++ b/include/php/ext/standard/file.h @@ -0,0 +1,116 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +#ifndef FILE_H +#define FILE_H + +#include "php_network.h" + +PHP_MINIT_FUNCTION(file); +PHP_MSHUTDOWN_FUNCTION(file); + +PHPAPI PHP_FUNCTION(fclose); +PHPAPI PHP_FUNCTION(feof); +PHPAPI PHP_FUNCTION(fread); +PHPAPI PHP_FUNCTION(fgetc); +PHPAPI PHP_FUNCTION(fgets); +PHPAPI PHP_FUNCTION(fwrite); +PHPAPI PHP_FUNCTION(fflush); +PHPAPI PHP_FUNCTION(rewind); +PHPAPI PHP_FUNCTION(ftell); +PHPAPI PHP_FUNCTION(fseek); +PHPAPI PHP_FUNCTION(fpassthru); + +PHP_MINIT_FUNCTION(user_streams); + +PHPAPI int php_le_stream_context(void); +PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block); +PHPAPI int php_copy_file(const char *src, const char *dest); +PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk); +PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx); +PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options); +PHPAPI int php_mkdir(const char *dir, zend_long mode); +PHPAPI void php_fstat(php_stream *stream, zval *return_value); +PHPAPI void php_flock_common(php_stream *stream, zend_long operation, uint32_t operation_arg_num, + zval *wouldblock, zval *return_value); + +#define PHP_CSV_NO_ESCAPE EOF +PHPAPI HashTable *php_bc_fgetcsv_empty_line(void); +PHPAPI HashTable *php_fgetcsv(php_stream *stream, char delimiter, char enclosure, int escape_char, size_t buf_len, char *buf); +PHPAPI ssize_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, int escape_char, zend_string *eol_str); + +#define META_DEF_BUFSIZE 8192 + +#define PHP_FILE_USE_INCLUDE_PATH (1 << 0) +#define PHP_FILE_IGNORE_NEW_LINES (1 << 1) +#define PHP_FILE_SKIP_EMPTY_LINES (1 << 2) +#define PHP_FILE_APPEND (1 << 3) +#define PHP_FILE_NO_DEFAULT_CONTEXT (1 << 4) + +typedef enum _php_meta_tags_token { + TOK_EOF = 0, + TOK_OPENTAG, + TOK_CLOSETAG, + TOK_SLASH, + TOK_EQUAL, + TOK_SPACE, + TOK_ID, + TOK_STRING, + TOK_OTHER +} php_meta_tags_token; + +typedef struct _php_meta_tags_data { + php_stream *stream; + int ulc; + int lc; + char *input_buffer; + char *token_data; + int token_len; + int in_meta; +} php_meta_tags_data; + +php_meta_tags_token php_next_meta_token(php_meta_tags_data *); + +typedef struct { + int pclose_ret; + size_t def_chunk_size; + bool auto_detect_line_endings; + zend_long default_socket_timeout; + char *user_agent; /* for the http wrapper */ + char *from_address; /* for the ftp and http wrappers */ + const char *user_stream_current_filename; /* for simple recursion protection */ + php_stream_context *default_context; + HashTable *stream_wrappers; /* per-request copy of url_stream_wrappers_hash */ + HashTable *stream_filters; /* per-request copy of stream_filters_hash */ + HashTable *wrapper_errors; /* key: wrapper address; value: linked list of char* */ + int pclose_wait; +#ifdef HAVE_GETHOSTBYNAME_R + struct hostent tmp_host_info; + char *tmp_host_buf; + size_t tmp_host_buf_len; +#endif +} php_file_globals; + +#ifdef ZTS +#define FG(v) ZEND_TSRMG(file_globals_id, php_file_globals *, v) +extern PHPAPI int file_globals_id; +#else +#define FG(v) (file_globals.v) +extern PHPAPI php_file_globals file_globals; +#endif + + +#endif /* FILE_H */ diff --git a/include/php/ext/standard/file_arginfo.h b/include/php/ext/standard/file_arginfo.h new file mode 100644 index 0000000..b7ecefe --- /dev/null +++ b/include/php/ext/standard/file_arginfo.h @@ -0,0 +1,127 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: e9a566d5ef96f781074027b1b3ff1824d0208b47 */ + + + +static void register_file_symbols(int module_number) +{ + REGISTER_LONG_CONSTANT("SEEK_SET", SEEK_SET, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SEEK_CUR", SEEK_CUR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SEEK_END", SEEK_END, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOCK_SH", PHP_LOCK_SH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOCK_EX", PHP_LOCK_EX, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOCK_UN", PHP_LOCK_UN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("LOCK_NB", PHP_LOCK_NB, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_CONNECT", PHP_STREAM_NOTIFY_CONNECT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_AUTH_REQUIRED", PHP_STREAM_NOTIFY_AUTH_REQUIRED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_AUTH_RESULT", PHP_STREAM_NOTIFY_AUTH_RESULT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_MIME_TYPE_IS", PHP_STREAM_NOTIFY_MIME_TYPE_IS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_FILE_SIZE_IS", PHP_STREAM_NOTIFY_FILE_SIZE_IS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_REDIRECTED", PHP_STREAM_NOTIFY_REDIRECTED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_PROGRESS", PHP_STREAM_NOTIFY_PROGRESS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_FAILURE", PHP_STREAM_NOTIFY_FAILURE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_COMPLETED", PHP_STREAM_NOTIFY_COMPLETED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_RESOLVE", PHP_STREAM_NOTIFY_RESOLVE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_SEVERITY_INFO", PHP_STREAM_NOTIFY_SEVERITY_INFO, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_SEVERITY_WARN", PHP_STREAM_NOTIFY_SEVERITY_WARN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_NOTIFY_SEVERITY_ERR", PHP_STREAM_NOTIFY_SEVERITY_ERR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_FILTER_READ", PHP_STREAM_FILTER_READ, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_FILTER_WRITE", PHP_STREAM_FILTER_WRITE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_FILTER_ALL", PHP_STREAM_FILTER_ALL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CLIENT_PERSISTENT", PHP_STREAM_CLIENT_PERSISTENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CLIENT_ASYNC_CONNECT", PHP_STREAM_CLIENT_ASYNC_CONNECT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CLIENT_CONNECT", PHP_STREAM_CLIENT_CONNECT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_ANY_CLIENT", STREAM_CRYPTO_METHOD_ANY_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_CLIENT", STREAM_CRYPTO_METHOD_SSLv2_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_CLIENT", STREAM_CRYPTO_METHOD_SSLv3_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_CLIENT", STREAM_CRYPTO_METHOD_SSLv23_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_CLIENT", STREAM_CRYPTO_METHOD_TLS_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_ANY_SERVER", STREAM_CRYPTO_METHOD_ANY_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_SERVER", STREAM_CRYPTO_METHOD_SSLv2_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_SERVER", STREAM_CRYPTO_METHOD_SSLv3_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_SERVER", STREAM_CRYPTO_METHOD_SSLv23_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_SERVER", STREAM_CRYPTO_METHOD_TLS_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_0_SERVER", STREAM_CRYPTO_METHOD_TLSv1_0_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_1_SERVER", STREAM_CRYPTO_METHOD_TLSv1_1_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_2_SERVER", STREAM_CRYPTO_METHOD_TLSv1_2_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_3_SERVER", STREAM_CRYPTO_METHOD_TLSv1_3_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_PROTO_SSLv3", STREAM_CRYPTO_METHOD_SSLv3_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_PROTO_TLSv1_0", STREAM_CRYPTO_METHOD_TLSv1_0_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_PROTO_TLSv1_1", STREAM_CRYPTO_METHOD_TLSv1_1_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_PROTO_TLSv1_2", STREAM_CRYPTO_METHOD_TLSv1_2_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_PROTO_TLSv1_3", STREAM_CRYPTO_METHOD_TLSv1_3_SERVER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_SHUT_RD", STREAM_SHUT_RD, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_SHUT_WR", STREAM_SHUT_WR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_SHUT_RDWR", STREAM_SHUT_RDWR, CONST_PERSISTENT); +#if defined(PF_INET) + REGISTER_LONG_CONSTANT("STREAM_PF_INET", PF_INET, CONST_PERSISTENT); +#endif +#if (!defined(PF_INET) && defined(AF_INET)) + REGISTER_LONG_CONSTANT("STREAM_PF_INET", AF_INET, CONST_PERSISTENT); +#endif +#if defined(HAVE_IPV6) && defined(PF_INET6) + REGISTER_LONG_CONSTANT("STREAM_PF_INET6", PF_INET6, CONST_PERSISTENT); +#endif +#if defined(HAVE_IPV6) && (!defined(PF_INET6) && defined(AF_INET6)) + REGISTER_LONG_CONSTANT("STREAM_PF_INET6", AF_INET6, CONST_PERSISTENT); +#endif +#if defined(PF_UNIX) + REGISTER_LONG_CONSTANT("STREAM_PF_UNIX", PF_UNIX, CONST_PERSISTENT); +#endif +#if (!defined(PF_UNIX) && defined(AF_UNIX)) + REGISTER_LONG_CONSTANT("STREAM_PF_UNIX", AF_UNIX, CONST_PERSISTENT); +#endif +#if defined(IPPROTO_IP) + REGISTER_LONG_CONSTANT("STREAM_IPPROTO_IP", IPPROTO_IP, CONST_PERSISTENT); +#endif +#if (defined(IPPROTO_TCP) || defined(PHP_WIN32)) + REGISTER_LONG_CONSTANT("STREAM_IPPROTO_TCP", IPPROTO_TCP, CONST_PERSISTENT); +#endif +#if (defined(IPPROTO_UDP) || defined(PHP_WIN32)) + REGISTER_LONG_CONSTANT("STREAM_IPPROTO_UDP", IPPROTO_UDP, CONST_PERSISTENT); +#endif +#if (defined(IPPROTO_ICMP) || defined(PHP_WIN32)) + REGISTER_LONG_CONSTANT("STREAM_IPPROTO_ICMP", IPPROTO_ICMP, CONST_PERSISTENT); +#endif +#if (defined(IPPROTO_RAW) || defined(PHP_WIN32)) + REGISTER_LONG_CONSTANT("STREAM_IPPROTO_RAW", IPPROTO_RAW, CONST_PERSISTENT); +#endif + REGISTER_LONG_CONSTANT("STREAM_SOCK_STREAM", SOCK_STREAM, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_SOCK_DGRAM", SOCK_DGRAM, CONST_PERSISTENT); +#if defined(SOCK_RAW) + REGISTER_LONG_CONSTANT("STREAM_SOCK_RAW", SOCK_RAW, CONST_PERSISTENT); +#endif +#if defined(SOCK_SEQPACKET) + REGISTER_LONG_CONSTANT("STREAM_SOCK_SEQPACKET", SOCK_SEQPACKET, CONST_PERSISTENT); +#endif +#if defined(SOCK_RDM) + REGISTER_LONG_CONSTANT("STREAM_SOCK_RDM", SOCK_RDM, CONST_PERSISTENT); +#endif + REGISTER_LONG_CONSTANT("STREAM_PEEK", STREAM_PEEK, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_OOB", STREAM_OOB, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_SERVER_BIND", STREAM_XPORT_BIND, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_SERVER_LISTEN", STREAM_XPORT_LISTEN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILE_USE_INCLUDE_PATH", PHP_FILE_USE_INCLUDE_PATH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILE_IGNORE_NEW_LINES", PHP_FILE_IGNORE_NEW_LINES, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILE_SKIP_EMPTY_LINES", PHP_FILE_SKIP_EMPTY_LINES, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILE_APPEND", PHP_FILE_APPEND, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILE_NO_DEFAULT_CONTEXT", PHP_FILE_NO_DEFAULT_CONTEXT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILE_TEXT", 0, CONST_PERSISTENT | CONST_DEPRECATED); + REGISTER_LONG_CONSTANT("FILE_BINARY", 0, CONST_PERSISTENT | CONST_DEPRECATED); +#if defined(HAVE_FNMATCH) + REGISTER_LONG_CONSTANT("FNM_NOESCAPE", FNM_NOESCAPE, CONST_PERSISTENT); +#endif +#if defined(HAVE_FNMATCH) + REGISTER_LONG_CONSTANT("FNM_PATHNAME", FNM_PATHNAME, CONST_PERSISTENT); +#endif +#if defined(HAVE_FNMATCH) + REGISTER_LONG_CONSTANT("FNM_PERIOD", FNM_PERIOD, CONST_PERSISTENT); +#endif +#if defined(HAVE_FNMATCH) && defined(FNM_CASEFOLD) + REGISTER_LONG_CONSTANT("FNM_CASEFOLD", FNM_CASEFOLD, CONST_PERSISTENT); +#endif +} diff --git a/include/php/ext/standard/flock_compat.h b/include/php/ext/standard/flock_compat.h new file mode 100644 index 0000000..a55c3af --- /dev/null +++ b/include/php/ext/standard/flock_compat.h @@ -0,0 +1,72 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ +*/ + +#ifndef FLOCK_COMPAT_H +#define FLOCK_COMPAT_H + +#ifdef HAVE_STRUCT_FLOCK +#include +#include +#include +#endif + +#ifdef PHP_WIN32 +#include +#include "config.w32.h" +#endif + +/* php_flock internally uses fcntl whether or not flock is available + * This way our php_flock even works on NFS files. + * More info: /usr/src/linux/Documentation + */ +PHPAPI int php_flock(int fd, int operation); + +#ifndef HAVE_FLOCK +# define LOCK_SH 1 +# define LOCK_EX 2 +# define LOCK_NB 4 +# define LOCK_UN 8 +PHPAPI int flock(int fd, int operation); +#endif + +/* Userland LOCK_* constants */ +#define PHP_LOCK_SH 1 +#define PHP_LOCK_EX 2 +#define PHP_LOCK_UN 3 +#define PHP_LOCK_NB 4 + +#ifdef PHP_WIN32 +# ifdef EWOULDBLOCK +# undef EWOULDBLOCK +# endif +# define EWOULDBLOCK WSAEWOULDBLOCK +# define fsync _commit +# define ftruncate(a, b) chsize(a, b) +#endif /* defined(PHP_WIN32) */ + +#ifndef HAVE_INET_ATON +# ifdef HAVE_NETINET_IN_H +# include +# endif +# ifdef HAVE_ARPA_INET_H +# include +# endif +# ifndef PHP_WIN32 +extern int inet_aton(const char *, struct in_addr *); +# endif +#endif + +#endif /* FLOCK_COMPAT_H */ diff --git a/include/php/ext/standard/fsock.h b/include/php/ext/standard/fsock.h new file mode 100644 index 0000000..3789a01 --- /dev/null +++ b/include/php/ext/standard/fsock.h @@ -0,0 +1,27 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Paul Panotzki - Bunyip Information Systems | + | Jim Winstead | + | Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +#ifndef FSOCK_H +#define FSOCK_H + +#include "file.h" + +#include "php_network.h" + + +#endif /* FSOCK_H */ diff --git a/include/php/ext/standard/head.h b/include/php/ext/standard/head.h new file mode 100644 index 0000000..a891e05 --- /dev/null +++ b/include/php/ext/standard/head.h @@ -0,0 +1,35 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +#ifndef HEAD_H +#define HEAD_H + +#define COOKIE_EXPIRES "; expires=" +#define COOKIE_MAX_AGE "; Max-Age=" +#define COOKIE_DOMAIN "; domain=" +#define COOKIE_PATH "; path=" +#define COOKIE_SECURE "; secure" +#define COOKIE_HTTPONLY "; HttpOnly" +#define COOKIE_SAMESITE "; SameSite=" + +extern PHP_RINIT_FUNCTION(head); + +PHPAPI int php_header(void); +PHPAPI zend_result php_setcookie(zend_string *name, zend_string *value, time_t expires, + zend_string *path, zend_string *domain, bool secure, bool httponly, + zend_string *samesite, bool url_encode); + +#endif diff --git a/include/php/ext/standard/html.h b/include/php/ext/standard/html.h new file mode 100644 index 0000000..40c595b --- /dev/null +++ b/include/php/ext/standard/html.h @@ -0,0 +1,52 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +#ifndef HTML_H +#define HTML_H + +#define ENT_HTML_QUOTE_NONE 0 +#define ENT_HTML_QUOTE_SINGLE 1 +#define ENT_HTML_QUOTE_DOUBLE 2 +#define ENT_HTML_IGNORE_ERRORS 4 +#define ENT_HTML_SUBSTITUTE_ERRORS 8 +#define ENT_HTML_DOC_TYPE_MASK (16|32) +#define ENT_HTML_DOC_HTML401 0 +#define ENT_HTML_DOC_XML1 16 +#define ENT_HTML_DOC_XHTML 32 +#define ENT_HTML_DOC_HTML5 (16|32) +/* reserve bit 6 */ +#define ENT_HTML_SUBSTITUTE_DISALLOWED_CHARS 128 + +#define PHP_HTML_SPECIALCHARS 0 +#define PHP_HTML_ENTITIES 1 + +#define ENT_COMPAT ENT_HTML_QUOTE_DOUBLE +#define ENT_QUOTES (ENT_HTML_QUOTE_DOUBLE | ENT_HTML_QUOTE_SINGLE) +#define ENT_NOQUOTES ENT_HTML_QUOTE_NONE +#define ENT_IGNORE ENT_HTML_IGNORE_ERRORS +#define ENT_SUBSTITUTE ENT_HTML_SUBSTITUTE_ERRORS +#define ENT_HTML401 0 +#define ENT_XML1 16 +#define ENT_XHTML 32 +#define ENT_HTML5 (16|32) +#define ENT_DISALLOWED 128 + +PHPAPI zend_string *php_escape_html_entities(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset); +PHPAPI zend_string *php_escape_html_entities_ex(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset, bool double_encode, bool quiet); +PHPAPI zend_string *php_unescape_html_entities(zend_string *str, int all, int flags, const char *hint_charset); +PHPAPI unsigned int php_next_utf8_char(const unsigned char *str, size_t str_len, size_t *cursor, zend_result *status); + +#endif /* HTML_H */ diff --git a/include/php/ext/standard/html_tables.h b/include/php/ext/standard/html_tables.h new file mode 100644 index 0000000..2d17d3f --- /dev/null +++ b/include/php/ext/standard/html_tables.h @@ -0,0 +1,6230 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ +*/ + +#ifndef HTML_TABLES_H +#define HTML_TABLES_H + +/************************************************************************** +*************************************************************************** +** THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT. ** +*************************************************************************** +** Please change html_tables/html_table_gen.php instead and then ** +** run it in order to generate this file ** +*************************************************************************** +**************************************************************************/ + +enum entity_charset { cs_utf_8, cs_8859_1, cs_cp1252, cs_8859_15, cs_cp1251, + cs_8859_5, cs_cp866, cs_macroman, cs_koi8r, cs_big5, + cs_gb2312, cs_big5hkscs, cs_sjis, cs_eucjp, + cs_numelems /* used to count the number of charsets */ + }; +#define CHARSET_UNICODE_COMPAT(cs) ((cs) <= cs_8859_1) +#define CHARSET_SINGLE_BYTE(cs) ((cs) > cs_utf_8 && (cs) < cs_big5) +#define CHARSET_PARTIAL_SUPPORT(cs) ((cs) >= cs_big5) + +static const struct { + const char *codeset; + uint32_t codeset_len; + enum entity_charset charset; +} charset_map[] = { + { "ISO-8859-1", sizeof("ISO-8859-1")-1, cs_8859_1 }, + { "ISO8859-1", sizeof("ISO8859-1")-1, cs_8859_1 }, + { "ISO-8859-15", sizeof("ISO-8859-15")-1, cs_8859_15 }, + { "ISO8859-15", sizeof("ISO8859-15")-1, cs_8859_15 }, + { "utf-8", sizeof("utf-8")-1, cs_utf_8 }, + { "cp1252", sizeof("cp1252")-1, cs_cp1252 }, + { "Windows-1252", sizeof("Windows-1252")-1, cs_cp1252 }, + { "1252", sizeof("1252")-1, cs_cp1252 }, + { "BIG5", sizeof("BIG5")-1, cs_big5 }, + { "950", sizeof("950")-1, cs_big5 }, + { "GB2312", sizeof("GB2312")-1, cs_gb2312 }, + { "936", sizeof("936")-1, cs_gb2312 }, + { "BIG5-HKSCS", sizeof("BIG5-HKSCS")-1, cs_big5hkscs }, + { "Shift_JIS", sizeof("Shift_JIS")-1, cs_sjis }, + { "SJIS", sizeof("SJIS")-1, cs_sjis }, + { "932", sizeof("932")-1, cs_sjis }, + { "SJIS-win", sizeof("SJIS-win")-1, cs_sjis }, + { "CP932", sizeof("CP932")-1, cs_sjis }, + { "EUCJP", sizeof("EUCJP")-1, cs_eucjp }, + { "EUC-JP", sizeof("EUC-JP")-1, cs_eucjp }, + { "eucJP-win", sizeof("eucJP-win")-1, cs_eucjp }, + { "KOI8-R", sizeof("KOI8-R")-1, cs_koi8r }, + { "koi8-ru", sizeof("koi8-ru")-1, cs_koi8r }, + { "koi8r", sizeof("koi8r")-1, cs_koi8r }, + { "cp1251", sizeof("cp1251")-1, cs_cp1251 }, + { "Windows-1251", sizeof("Windows-1251")-1, cs_cp1251 }, + { "win-1251", sizeof("win-1251")-1, cs_cp1251 }, + { "iso8859-5", sizeof("iso8859-5")-1, cs_8859_5 }, + { "iso-8859-5", sizeof("iso-8859-5")-1, cs_8859_5 }, + { "cp866", sizeof("cp866")-1, cs_cp866 }, + { "866", sizeof("866")-1, cs_cp866 }, + { "ibm866", sizeof("ibm866")-1, cs_cp866 }, + { "MacRoman", sizeof("MacRoman")-1, cs_macroman } +}; + +/* longest entity name length excluding & and ; */ +#define LONGEST_ENTITY_LENGTH 31 + +/* Definitions for mappings *to* Unicode. + * The origin charset must have at most 256 code points. + * The multi-byte encodings are not supported */ +typedef struct { + unsigned short uni_cp[64]; +} enc_to_uni_stage2; + +typedef struct { + const enc_to_uni_stage2 *inner[4]; +} enc_to_uni; + +/* bits 7-8 bits (only single bytes encodings supported )*/ +#define ENT_ENC_TO_UNI_STAGE1(k) ((k & 0xC0) >> 6) +/* bits 1-6 */ +#define ENT_ENC_TO_UNI_STAGE2(k) ((k) & 0x3F) + +/* {{{ Mappings *to* Unicode for ISO-8859-1 */ + +/* {{{ Stage 2 tables for ISO-8859-1 */ + +static const enc_to_uni_stage2 enc_to_uni_s2_iso88591_00 = { { + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, + 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, + 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, + 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, + 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, + 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, + 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, + 0x003C, 0x003D, 0x003E, 0x003F, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_iso88591_40 = { { + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, + 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, + 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, + 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, + 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, + 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, + 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, + 0x007C, 0x007D, 0x007E, 0x007F, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_iso88591_80 = { { + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, + 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, + 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, + 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, + 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, + 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, + 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, + 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, + 0x00BC, 0x00BD, 0x00BE, 0x00BF, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_iso88591_C0 = { { + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, + 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, + 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, + 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, + 0x00DE, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, + 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, + 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, + 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, + 0x00FC, 0x00FD, 0x00FE, 0x00FF, +} }; + +/* end of stage 2 tables for ISO-8859-1 }}} */ + +/* {{{ Stage 1 table for ISO-8859-1 */ +static const enc_to_uni enc_to_uni_iso88591 = { { + &enc_to_uni_s2_iso88591_00, + &enc_to_uni_s2_iso88591_40, + &enc_to_uni_s2_iso88591_80, + &enc_to_uni_s2_iso88591_C0 } +}; +/* end of stage 1 table for ISO-8859-1 }}} */ + +/* {{{ Mappings *to* Unicode for ISO-8859-5 */ + +/* {{{ Stage 2 tables for ISO-8859-5 */ + +static const enc_to_uni_stage2 enc_to_uni_s2_iso88595_80 = { { + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, + 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, + 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, + 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, + 0x009E, 0x009F, 0x00A0, 0x0401, 0x0402, 0x0403, + 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, + 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F, + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, + 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, + 0x041C, 0x041D, 0x041E, 0x041F, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_iso88595_C0 = { { + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, + 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, + 0x042C, 0x042D, 0x042E, 0x042F, 0x0430, 0x0431, + 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, + 0x043E, 0x043F, 0x0440, 0x0441, 0x0442, 0x0443, + 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, + 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, + 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, + 0x045C, 0x00A7, 0x045E, 0x045F, +} }; + +/* end of stage 2 tables for ISO-8859-5 }}} */ + +/* {{{ Stage 1 table for ISO-8859-5 */ +static const enc_to_uni enc_to_uni_iso88595 = { { + &enc_to_uni_s2_iso88591_00, + &enc_to_uni_s2_iso88591_40, + &enc_to_uni_s2_iso88595_80, + &enc_to_uni_s2_iso88595_C0 } +}; +/* end of stage 1 table for ISO-8859-5 }}} */ + +/* {{{ Mappings *to* Unicode for ISO-8859-15 */ + +/* {{{ Stage 2 tables for ISO-8859-15 */ + +static const enc_to_uni_stage2 enc_to_uni_s2_iso885915_80 = { { + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, + 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, + 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, + 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, + 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, + 0x20AC, 0x00A5, 0x0160, 0x00A7, 0x0161, 0x00A9, + 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x017D, 0x00B5, + 0x00B6, 0x00B7, 0x017E, 0x00B9, 0x00BA, 0x00BB, + 0x0152, 0x0153, 0x0178, 0x00BF, +} }; + +/* end of stage 2 tables for ISO-8859-15 }}} */ + +/* {{{ Stage 1 table for ISO-8859-15 */ +static const enc_to_uni enc_to_uni_iso885915 = { { + &enc_to_uni_s2_iso88591_00, + &enc_to_uni_s2_iso88591_40, + &enc_to_uni_s2_iso885915_80, + &enc_to_uni_s2_iso88591_C0 } +}; +/* end of stage 1 table for ISO-8859-15 }}} */ + +/* {{{ Mappings *to* Unicode for Windows-1252 */ + +/* {{{ Stage 2 tables for Windows-1252 */ + +static const enc_to_uni_stage2 enc_to_uni_s2_win1252_80 = { { + 0x20AC, 0xFFFF, 0x201A, 0x0192, 0x201E, 0x2026, + 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, + 0x0152, 0xFFFF, 0x017D, 0xFFFF, 0xFFFF, 0x2018, + 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0xFFFF, + 0x017E, 0x0178, 0x00A0, 0x00A1, 0x00A2, 0x00A3, + 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, + 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, + 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, + 0x00BC, 0x00BD, 0x00BE, 0x00BF, +} }; + +/* end of stage 2 tables for Windows-1252 }}} */ + +/* {{{ Stage 1 table for Windows-1252 */ +static const enc_to_uni enc_to_uni_win1252 = { { + &enc_to_uni_s2_iso88591_00, + &enc_to_uni_s2_iso88591_40, + &enc_to_uni_s2_win1252_80, + &enc_to_uni_s2_iso88591_C0 } +}; +/* end of stage 1 table for Windows-1252 }}} */ + +/* {{{ Mappings *to* Unicode for Windows-1251 */ + +/* {{{ Stage 2 tables for Windows-1251 */ + +static const enc_to_uni_stage2 enc_to_uni_s2_win1251_80 = { { + 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, + 0x2020, 0x2021, 0x20AC, 0x2030, 0x0409, 0x2039, + 0x040A, 0x040C, 0x040B, 0x040F, 0x0452, 0x2018, + 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0xFFFF, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, + 0x045B, 0x045F, 0x00A0, 0x040E, 0x045E, 0x0408, + 0x00A4, 0x0490, 0x00A6, 0x00A7, 0x0401, 0x00A9, + 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407, + 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, + 0x00B6, 0x00B7, 0x0451, 0x2116, 0x0454, 0x00BB, + 0x0458, 0x0405, 0x0455, 0x0457, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_win1251_C0 = { { + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, + 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, + 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, + 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, + 0x042E, 0x042F, 0x0430, 0x0431, 0x0432, 0x0433, + 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, + 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, + 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, + 0x044C, 0x044D, 0x044E, 0x044F, +} }; + +/* end of stage 2 tables for Windows-1251 }}} */ + +/* {{{ Stage 1 table for Windows-1251 */ +static const enc_to_uni enc_to_uni_win1251 = { { + &enc_to_uni_s2_iso88591_00, + &enc_to_uni_s2_iso88591_40, + &enc_to_uni_s2_win1251_80, + &enc_to_uni_s2_win1251_C0 } +}; +/* end of stage 1 table for Windows-1251 }}} */ + +/* {{{ Mappings *to* Unicode for KOI8-R */ + +/* {{{ Stage 2 tables for KOI8-R */ + +static const enc_to_uni_stage2 enc_to_uni_s2_koi8r_80 = { { + 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, + 0x251C, 0x2524, 0x252C, 0x2534, 0x253C, 0x2580, + 0x2584, 0x2588, 0x258C, 0x2590, 0x2591, 0x2592, + 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248, + 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, + 0x00B7, 0x00F7, 0x2550, 0x2551, 0x2552, 0x0451, + 0x2553, 0x2554, 0x2555, 0x2556, 0x2557, 0x2558, + 0x2559, 0x255A, 0x255B, 0x255C, 0x255D, 0x255E, + 0x255F, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, + 0x2564, 0x2565, 0x2566, 0x2567, 0x2568, 0x2569, + 0x256A, 0x256B, 0x256C, 0x00A9, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_koi8r_C0 = { { + 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, + 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043A, + 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x044F, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, + 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, + 0x0447, 0x044A, 0x042E, 0x0410, 0x0411, 0x0426, + 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, + 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, + 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, + 0x0416, 0x0412, 0x042C, 0x042B, 0x0417, 0x0428, + 0x042D, 0x0429, 0x0427, 0x042A, +} }; + +/* end of stage 2 tables for KOI8-R }}} */ + +/* {{{ Stage 1 table for KOI8-R */ +static const enc_to_uni enc_to_uni_koi8r = { { + &enc_to_uni_s2_iso88591_00, + &enc_to_uni_s2_iso88591_40, + &enc_to_uni_s2_koi8r_80, + &enc_to_uni_s2_koi8r_C0 } +}; +/* end of stage 1 table for KOI8-R }}} */ + +/* {{{ Mappings *to* Unicode for CP-866 */ + +/* {{{ Stage 2 tables for CP-866 */ + +static const enc_to_uni_stage2 enc_to_uni_s2_cp866_80 = { { + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, + 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, + 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, + 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, + 0x042E, 0x042F, 0x0430, 0x0431, 0x0432, 0x0433, + 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, + 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, + 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, + 0x255D, 0x255C, 0x255B, 0x2510, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_cp866_C0 = { { + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, + 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, + 0x2560, 0x2550, 0x256C, 0x2567, 0x2568, 0x2564, + 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, + 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, + 0x2590, 0x2580, 0x0440, 0x0441, 0x0442, 0x0443, + 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, + 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, + 0x040E, 0x045E, 0x00B0, 0x2219, 0x00B7, 0x221A, + 0x2116, 0x00A4, 0x25A0, 0x00A0, +} }; + +/* end of stage 2 tables for CP-866 }}} */ + +/* {{{ Stage 1 table for CP-866 */ +static const enc_to_uni enc_to_uni_cp866 = { { + &enc_to_uni_s2_iso88591_00, + &enc_to_uni_s2_iso88591_40, + &enc_to_uni_s2_cp866_80, + &enc_to_uni_s2_cp866_C0 } +}; +/* end of stage 1 table for CP-866 }}} */ + +/* {{{ Mappings *to* Unicode for MacRoman */ + +/* {{{ Stage 2 tables for MacRoman */ + +static const enc_to_uni_stage2 enc_to_uni_s2_macroman_00 = { { + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0x0020, 0x0021, 0x0022, 0x0023, + 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, + 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, + 0x003C, 0x003D, 0x003E, 0x003F, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_macroman_40 = { { + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, + 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, + 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, + 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, + 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, + 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, + 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, + 0x007C, 0x007D, 0x007E, 0xFFFF, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_macroman_80 = { { + 0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, + 0x00DC, 0x00E1, 0x00E0, 0x00E2, 0x00E4, 0x00E3, + 0x00E5, 0x00E7, 0x00E9, 0x00E8, 0x00EA, 0x00EB, + 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3, + 0x00F2, 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, + 0x00FB, 0x00FC, 0x2020, 0x00B0, 0x00A2, 0x00A3, + 0x00A7, 0x2022, 0x00B6, 0x00DF, 0x00AE, 0x00A9, + 0x2122, 0x00B4, 0x00A8, 0x2260, 0x00C6, 0x00D8, + 0x221E, 0x00B1, 0x2264, 0x2265, 0x00A5, 0x00B5, + 0x2202, 0x2211, 0x220F, 0x03C0, 0x222B, 0x00AA, + 0x00BA, 0x03A9, 0x00E6, 0x00F8, +} }; + +static const enc_to_uni_stage2 enc_to_uni_s2_macroman_C0 = { { + 0x00BF, 0x00A1, 0x00AC, 0x221A, 0x0192, 0x2248, + 0x2206, 0x00AB, 0x00BB, 0x2026, 0x00A0, 0x00C0, + 0x00C3, 0x00D5, 0x0152, 0x0153, 0x2013, 0x2014, + 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x25CA, + 0x00FF, 0x0178, 0x2044, 0x20AC, 0x2039, 0x203A, + 0xFB01, 0xFB02, 0x2021, 0x00B7, 0x201A, 0x201E, + 0x2030, 0x00C2, 0x00CA, 0x00C1, 0x00CB, 0x00C8, + 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x00D3, 0x00D4, + 0xF8FF, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, + 0x02C6, 0x02DC, 0x00AF, 0x02D8, 0x02D9, 0x02DA, + 0x00B8, 0x02DD, 0x02DB, 0x02C7, +} }; + +/* end of stage 2 tables for MacRoman }}} */ + +/* {{{ Stage 1 table for MacRoman */ +static const enc_to_uni enc_to_uni_macroman = { { + &enc_to_uni_s2_macroman_00, + &enc_to_uni_s2_macroman_40, + &enc_to_uni_s2_macroman_80, + &enc_to_uni_s2_macroman_C0 } +}; +/* end of stage 1 table for MacRoman }}} */ + +/* {{{ Index of tables for encoding conversion */ +static const enc_to_uni *const enc_to_uni_index[cs_numelems] = { + NULL, + &enc_to_uni_iso88591, + &enc_to_uni_win1252, + &enc_to_uni_iso885915, + &enc_to_uni_win1251, + &enc_to_uni_iso88595, + &enc_to_uni_cp866, + &enc_to_uni_macroman, + &enc_to_uni_koi8r, +}; +/* }}} */ + +/* Definitions for mappings *from* Unicode */ + +typedef struct { + unsigned short un_code_point; /* we don't need bigger */ + unsigned char cs_code; /* currently, we only have maps to single-byte encodings */ +} uni_to_enc; + +/* {{{ Mappings *from* Unicode for ISO-8859-15 */ +static const uni_to_enc unimap_iso885915[] = { + { 0x00A5, 0xA5 }, /* yen sign */ + { 0x00A7, 0xA7 }, /* section sign */ + { 0x00A9, 0xA9 }, /* copyright sign */ + { 0x00AA, 0xAA }, /* feminine ordinal indicator */ + { 0x00AB, 0xAB }, /* left-pointing double angle quotation mark */ + { 0x00AC, 0xAC }, /* not sign */ + { 0x00AD, 0xAD }, /* soft hyphen */ + { 0x00AE, 0xAE }, /* registered sign */ + { 0x00AF, 0xAF }, /* macron */ + { 0x00B0, 0xB0 }, /* degree sign */ + { 0x00B1, 0xB1 }, /* plus-minus sign */ + { 0x00B2, 0xB2 }, /* superscript two */ + { 0x00B3, 0xB3 }, /* superscript three */ + { 0x00B5, 0xB5 }, /* micro sign */ + { 0x00B6, 0xB6 }, /* pilcrow sign */ + { 0x00B7, 0xB7 }, /* middle dot */ + { 0x00B9, 0xB9 }, /* superscript one */ + { 0x00BA, 0xBA }, /* masculine ordinal indicator */ + { 0x00BB, 0xBB }, /* right-pointing double angle quotation mark */ + { 0x0152, 0xBC }, /* latin capital ligature oe */ + { 0x0153, 0xBD }, /* latin small ligature oe */ + { 0x0160, 0xA6 }, /* latin capital letter s with caron */ + { 0x0161, 0xA8 }, /* latin small letter s with caron */ + { 0x0178, 0xBE }, /* latin capital letter y with diaeresis */ + { 0x017D, 0xB4 }, /* latin capital letter z with caron */ + { 0x017E, 0xB8 }, /* latin small letter z with caron */ + { 0x20AC, 0xA4 }, /* euro sign */ +}; +/* {{{ end of mappings *from* Unicode for ISO-8859-15 */ + +/* {{{ Mappings *from* Unicode for Windows-1252 */ +static const uni_to_enc unimap_win1252[] = { + { 0x0152, 0x8C }, /* latin capital ligature oe */ + { 0x0153, 0x9C }, /* latin small ligature oe */ + { 0x0160, 0x8A }, /* latin capital letter s with caron */ + { 0x0161, 0x9A }, /* latin small letter s with caron */ + { 0x0178, 0x9F }, /* latin capital letter y with diaeresis */ + { 0x017D, 0x8E }, /* latin capital letter z with caron */ + { 0x017E, 0x9E }, /* latin small letter z with caron */ + { 0x0192, 0x83 }, /* latin small letter f with hook */ + { 0x02C6, 0x88 }, /* modifier letter circumflex accent */ + { 0x02DC, 0x98 }, /* small tilde */ + { 0x2013, 0x96 }, /* en dash */ + { 0x2014, 0x97 }, /* em dash */ + { 0x2018, 0x91 }, /* left single quotation mark */ + { 0x2019, 0x92 }, /* right single quotation mark */ + { 0x201A, 0x82 }, /* single low-9 quotation mark */ + { 0x201C, 0x93 }, /* left double quotation mark */ + { 0x201D, 0x94 }, /* right double quotation mark */ + { 0x201E, 0x84 }, /* double low-9 quotation mark */ + { 0x2020, 0x86 }, /* dagger */ + { 0x2021, 0x87 }, /* double dagger */ + { 0x2022, 0x95 }, /* bullet */ + { 0x2026, 0x85 }, /* horizontal ellipsis */ + { 0x2030, 0x89 }, /* per mille sign */ + { 0x2039, 0x8B }, /* single left-pointing angle quotation mark */ + { 0x203A, 0x9B }, /* single right-pointing angle quotation mark */ + { 0x20AC, 0x80 }, /* euro sign */ + { 0x2122, 0x99 }, /* trade mark sign */ +}; +/* {{{ end of mappings *from* Unicode for Windows-1252 */ + +/* {{{ Mappings *from* Unicode for Windows-1251 */ +static const uni_to_enc unimap_win1251[] = { + { 0x00A0, 0xA0 }, /* no-break space */ + { 0x00A4, 0xA4 }, /* currency sign */ + { 0x00A6, 0xA6 }, /* broken bar */ + { 0x00A7, 0xA7 }, /* section sign */ + { 0x00A9, 0xA9 }, /* copyright sign */ + { 0x00AB, 0xAB }, /* left-pointing double angle quotation mark */ + { 0x00AC, 0xAC }, /* not sign */ + { 0x00AD, 0xAD }, /* soft hyphen */ + { 0x00AE, 0xAE }, /* registered sign */ + { 0x00B0, 0xB0 }, /* degree sign */ + { 0x00B1, 0xB1 }, /* plus-minus sign */ + { 0x00B5, 0xB5 }, /* micro sign */ + { 0x00B6, 0xB6 }, /* pilcrow sign */ + { 0x00B7, 0xB7 }, /* middle dot */ + { 0x00BB, 0xBB }, /* right-pointing double angle quotation mark */ + { 0x0401, 0xA8 }, /* cyrillic capital letter io */ + { 0x0402, 0x80 }, /* cyrillic capital letter dje */ + { 0x0403, 0x81 }, /* cyrillic capital letter gje */ + { 0x0404, 0xAA }, /* cyrillic capital letter ukrainian ie */ + { 0x0405, 0xBD }, /* cyrillic capital letter dze */ + { 0x0406, 0xB2 }, /* cyrillic capital letter byelorussian-ukrainian i */ + { 0x0407, 0xAF }, /* cyrillic capital letter yi */ + { 0x0408, 0xA3 }, /* cyrillic capital letter je */ + { 0x0409, 0x8A }, /* cyrillic capital letter lje */ + { 0x040A, 0x8C }, /* cyrillic capital letter nje */ + { 0x040B, 0x8E }, /* cyrillic capital letter tshe */ + { 0x040C, 0x8D }, /* cyrillic capital letter kje */ + { 0x040E, 0xA1 }, /* cyrillic capital letter short u */ + { 0x040F, 0x8F }, /* cyrillic capital letter dzhe */ + { 0x0410, 0xC0 }, /* cyrillic capital letter a */ + { 0x0411, 0xC1 }, /* cyrillic capital letter be */ + { 0x0412, 0xC2 }, /* cyrillic capital letter ve */ + { 0x0413, 0xC3 }, /* cyrillic capital letter ghe */ + { 0x0414, 0xC4 }, /* cyrillic capital letter de */ + { 0x0415, 0xC5 }, /* cyrillic capital letter ie */ + { 0x0416, 0xC6 }, /* cyrillic capital letter zhe */ + { 0x0417, 0xC7 }, /* cyrillic capital letter ze */ + { 0x0418, 0xC8 }, /* cyrillic capital letter i */ + { 0x0419, 0xC9 }, /* cyrillic capital letter short i */ + { 0x041A, 0xCA }, /* cyrillic capital letter ka */ + { 0x041B, 0xCB }, /* cyrillic capital letter el */ + { 0x041C, 0xCC }, /* cyrillic capital letter em */ + { 0x041D, 0xCD }, /* cyrillic capital letter en */ + { 0x041E, 0xCE }, /* cyrillic capital letter o */ + { 0x041F, 0xCF }, /* cyrillic capital letter pe */ + { 0x0420, 0xD0 }, /* cyrillic capital letter er */ + { 0x0421, 0xD1 }, /* cyrillic capital letter es */ + { 0x0422, 0xD2 }, /* cyrillic capital letter te */ + { 0x0423, 0xD3 }, /* cyrillic capital letter u */ + { 0x0424, 0xD4 }, /* cyrillic capital letter ef */ + { 0x0425, 0xD5 }, /* cyrillic capital letter ha */ + { 0x0426, 0xD6 }, /* cyrillic capital letter tse */ + { 0x0427, 0xD7 }, /* cyrillic capital letter che */ + { 0x0428, 0xD8 }, /* cyrillic capital letter sha */ + { 0x0429, 0xD9 }, /* cyrillic capital letter shcha */ + { 0x042A, 0xDA }, /* cyrillic capital letter hard sign */ + { 0x042B, 0xDB }, /* cyrillic capital letter yeru */ + { 0x042C, 0xDC }, /* cyrillic capital letter soft sign */ + { 0x042D, 0xDD }, /* cyrillic capital letter e */ + { 0x042E, 0xDE }, /* cyrillic capital letter yu */ + { 0x042F, 0xDF }, /* cyrillic capital letter ya */ + { 0x0430, 0xE0 }, /* cyrillic small letter a */ + { 0x0431, 0xE1 }, /* cyrillic small letter be */ + { 0x0432, 0xE2 }, /* cyrillic small letter ve */ + { 0x0433, 0xE3 }, /* cyrillic small letter ghe */ + { 0x0434, 0xE4 }, /* cyrillic small letter de */ + { 0x0435, 0xE5 }, /* cyrillic small letter ie */ + { 0x0436, 0xE6 }, /* cyrillic small letter zhe */ + { 0x0437, 0xE7 }, /* cyrillic small letter ze */ + { 0x0438, 0xE8 }, /* cyrillic small letter i */ + { 0x0439, 0xE9 }, /* cyrillic small letter short i */ + { 0x043A, 0xEA }, /* cyrillic small letter ka */ + { 0x043B, 0xEB }, /* cyrillic small letter el */ + { 0x043C, 0xEC }, /* cyrillic small letter em */ + { 0x043D, 0xED }, /* cyrillic small letter en */ + { 0x043E, 0xEE }, /* cyrillic small letter o */ + { 0x043F, 0xEF }, /* cyrillic small letter pe */ + { 0x0440, 0xF0 }, /* cyrillic small letter er */ + { 0x0441, 0xF1 }, /* cyrillic small letter es */ + { 0x0442, 0xF2 }, /* cyrillic small letter te */ + { 0x0443, 0xF3 }, /* cyrillic small letter u */ + { 0x0444, 0xF4 }, /* cyrillic small letter ef */ + { 0x0445, 0xF5 }, /* cyrillic small letter ha */ + { 0x0446, 0xF6 }, /* cyrillic small letter tse */ + { 0x0447, 0xF7 }, /* cyrillic small letter che */ + { 0x0448, 0xF8 }, /* cyrillic small letter sha */ + { 0x0449, 0xF9 }, /* cyrillic small letter shcha */ + { 0x044A, 0xFA }, /* cyrillic small letter hard sign */ + { 0x044B, 0xFB }, /* cyrillic small letter yeru */ + { 0x044C, 0xFC }, /* cyrillic small letter soft sign */ + { 0x044D, 0xFD }, /* cyrillic small letter e */ + { 0x044E, 0xFE }, /* cyrillic small letter yu */ + { 0x044F, 0xFF }, /* cyrillic small letter ya */ + { 0x0451, 0xB8 }, /* cyrillic small letter io */ + { 0x0452, 0x90 }, /* cyrillic small letter dje */ + { 0x0453, 0x83 }, /* cyrillic small letter gje */ + { 0x0454, 0xBA }, /* cyrillic small letter ukrainian ie */ + { 0x0455, 0xBE }, /* cyrillic small letter dze */ + { 0x0456, 0xB3 }, /* cyrillic small letter byelorussian-ukrainian i */ + { 0x0457, 0xBF }, /* cyrillic small letter yi */ + { 0x0458, 0xBC }, /* cyrillic small letter je */ + { 0x0459, 0x9A }, /* cyrillic small letter lje */ + { 0x045A, 0x9C }, /* cyrillic small letter nje */ + { 0x045B, 0x9E }, /* cyrillic small letter tshe */ + { 0x045C, 0x9D }, /* cyrillic small letter kje */ + { 0x045E, 0xA2 }, /* cyrillic small letter short u */ + { 0x045F, 0x9F }, /* cyrillic small letter dzhe */ + { 0x0490, 0xA5 }, /* cyrillic capital letter ghe with upturn */ + { 0x0491, 0xB4 }, /* cyrillic small letter ghe with upturn */ + { 0x2013, 0x96 }, /* en dash */ + { 0x2014, 0x97 }, /* em dash */ + { 0x2018, 0x91 }, /* left single quotation mark */ + { 0x2019, 0x92 }, /* right single quotation mark */ + { 0x201A, 0x82 }, /* single low-9 quotation mark */ + { 0x201C, 0x93 }, /* left double quotation mark */ + { 0x201D, 0x94 }, /* right double quotation mark */ + { 0x201E, 0x84 }, /* double low-9 quotation mark */ + { 0x2020, 0x86 }, /* dagger */ + { 0x2021, 0x87 }, /* double dagger */ + { 0x2022, 0x95 }, /* bullet */ + { 0x2026, 0x85 }, /* horizontal ellipsis */ + { 0x2030, 0x89 }, /* per mille sign */ + { 0x2039, 0x8B }, /* single left-pointing angle quotation mark */ + { 0x203A, 0x9B }, /* single right-pointing angle quotation mark */ + { 0x20AC, 0x88 }, /* euro sign */ + { 0x2116, 0xB9 }, /* numero sign */ + { 0x2122, 0x99 }, /* trade mark sign */ +}; +/* {{{ end of mappings *from* Unicode for Windows-1251 */ + +/* {{{ Mappings *from* Unicode for KOI8-R */ +static const uni_to_enc unimap_koi8r[] = { + { 0x00A0, 0x9A }, /* no-break space */ + { 0x00A9, 0xBF }, /* copyright sign */ + { 0x00B0, 0x9C }, /* degree sign */ + { 0x00B2, 0x9D }, /* superscript two */ + { 0x00B7, 0x9E }, /* middle dot */ + { 0x00F7, 0x9F }, /* division sign */ + { 0x0401, 0xB3 }, /* cyrillic capital letter io */ + { 0x0410, 0xE1 }, /* cyrillic capital letter a */ + { 0x0411, 0xE2 }, /* cyrillic capital letter be */ + { 0x0412, 0xF7 }, /* cyrillic capital letter ve */ + { 0x0413, 0xE7 }, /* cyrillic capital letter ghe */ + { 0x0414, 0xE4 }, /* cyrillic capital letter de */ + { 0x0415, 0xE5 }, /* cyrillic capital letter ie */ + { 0x0416, 0xF6 }, /* cyrillic capital letter zhe */ + { 0x0417, 0xFA }, /* cyrillic capital letter ze */ + { 0x0418, 0xE9 }, /* cyrillic capital letter i */ + { 0x0419, 0xEA }, /* cyrillic capital letter short i */ + { 0x041A, 0xEB }, /* cyrillic capital letter ka */ + { 0x041B, 0xEC }, /* cyrillic capital letter el */ + { 0x041C, 0xED }, /* cyrillic capital letter em */ + { 0x041D, 0xEE }, /* cyrillic capital letter en */ + { 0x041E, 0xEF }, /* cyrillic capital letter o */ + { 0x041F, 0xF0 }, /* cyrillic capital letter pe */ + { 0x0420, 0xF2 }, /* cyrillic capital letter er */ + { 0x0421, 0xF3 }, /* cyrillic capital letter es */ + { 0x0422, 0xF4 }, /* cyrillic capital letter te */ + { 0x0423, 0xF5 }, /* cyrillic capital letter u */ + { 0x0424, 0xE6 }, /* cyrillic capital letter ef */ + { 0x0425, 0xE8 }, /* cyrillic capital letter ha */ + { 0x0426, 0xE3 }, /* cyrillic capital letter tse */ + { 0x0427, 0xFE }, /* cyrillic capital letter che */ + { 0x0428, 0xFB }, /* cyrillic capital letter sha */ + { 0x0429, 0xFD }, /* cyrillic capital letter shcha */ + { 0x042A, 0xFF }, /* cyrillic capital letter hard sign */ + { 0x042B, 0xF9 }, /* cyrillic capital letter yeru */ + { 0x042C, 0xF8 }, /* cyrillic capital letter soft sign */ + { 0x042D, 0xFC }, /* cyrillic capital letter e */ + { 0x042E, 0xE0 }, /* cyrillic capital letter yu */ + { 0x042F, 0xF1 }, /* cyrillic capital letter ya */ + { 0x0430, 0xC1 }, /* cyrillic small letter a */ + { 0x0431, 0xC2 }, /* cyrillic small letter be */ + { 0x0432, 0xD7 }, /* cyrillic small letter ve */ + { 0x0433, 0xC7 }, /* cyrillic small letter ghe */ + { 0x0434, 0xC4 }, /* cyrillic small letter de */ + { 0x0435, 0xC5 }, /* cyrillic small letter ie */ + { 0x0436, 0xD6 }, /* cyrillic small letter zhe */ + { 0x0437, 0xDA }, /* cyrillic small letter ze */ + { 0x0438, 0xC9 }, /* cyrillic small letter i */ + { 0x0439, 0xCA }, /* cyrillic small letter short i */ + { 0x043A, 0xCB }, /* cyrillic small letter ka */ + { 0x043B, 0xCC }, /* cyrillic small letter el */ + { 0x043C, 0xCD }, /* cyrillic small letter em */ + { 0x043D, 0xCE }, /* cyrillic small letter en */ + { 0x043E, 0xCF }, /* cyrillic small letter o */ + { 0x043F, 0xD0 }, /* cyrillic small letter pe */ + { 0x0440, 0xD2 }, /* cyrillic small letter er */ + { 0x0441, 0xD3 }, /* cyrillic small letter es */ + { 0x0442, 0xD4 }, /* cyrillic small letter te */ + { 0x0443, 0xD5 }, /* cyrillic small letter u */ + { 0x0444, 0xC6 }, /* cyrillic small letter ef */ + { 0x0445, 0xC8 }, /* cyrillic small letter ha */ + { 0x0446, 0xC3 }, /* cyrillic small letter tse */ + { 0x0447, 0xDE }, /* cyrillic small letter che */ + { 0x0448, 0xDB }, /* cyrillic small letter sha */ + { 0x0449, 0xDD }, /* cyrillic small letter shcha */ + { 0x044A, 0xDF }, /* cyrillic small letter hard sign */ + { 0x044B, 0xD9 }, /* cyrillic small letter yeru */ + { 0x044C, 0xD8 }, /* cyrillic small letter soft sign */ + { 0x044D, 0xDC }, /* cyrillic small letter e */ + { 0x044E, 0xC0 }, /* cyrillic small letter yu */ + { 0x044F, 0xD1 }, /* cyrillic small letter ya */ + { 0x0451, 0xA3 }, /* cyrillic small letter io */ + { 0x2219, 0x95 }, /* bullet operator */ + { 0x221A, 0x96 }, /* square root */ + { 0x2248, 0x97 }, /* almost equal to */ + { 0x2264, 0x98 }, /* less-than or equal to */ + { 0x2265, 0x99 }, /* greater-than or equal to */ + { 0x2320, 0x93 }, /* top half integral */ + { 0x2321, 0x9B }, /* bottom half integral */ + { 0x2500, 0x80 }, /* box drawings light horizontal */ + { 0x2502, 0x81 }, /* box drawings light vertical */ + { 0x250C, 0x82 }, /* box drawings light down and right */ + { 0x2510, 0x83 }, /* box drawings light down and left */ + { 0x2514, 0x84 }, /* box drawings light up and right */ + { 0x2518, 0x85 }, /* box drawings light up and left */ + { 0x251C, 0x86 }, /* box drawings light vertical and right */ + { 0x2524, 0x87 }, /* box drawings light vertical and left */ + { 0x252C, 0x88 }, /* box drawings light down and horizontal */ + { 0x2534, 0x89 }, /* box drawings light up and horizontal */ + { 0x253C, 0x8A }, /* box drawings light vertical and horizontal */ + { 0x2550, 0xA0 }, /* box drawings double horizontal */ + { 0x2551, 0xA1 }, /* box drawings double vertical */ + { 0x2552, 0xA2 }, /* box drawings down single and right double */ + { 0x2553, 0xA4 }, /* box drawings down double and right single */ + { 0x2554, 0xA5 }, /* box drawings double down and right */ + { 0x2555, 0xA6 }, /* box drawings down single and left double */ + { 0x2556, 0xA7 }, /* box drawings down double and left single */ + { 0x2557, 0xA8 }, /* box drawings double down and left */ + { 0x2558, 0xA9 }, /* box drawings up single and right double */ + { 0x2559, 0xAA }, /* box drawings up double and right single */ + { 0x255A, 0xAB }, /* box drawings double up and right */ + { 0x255B, 0xAC }, /* box drawings up single and left double */ + { 0x255C, 0xAD }, /* box drawings up double and left single */ + { 0x255D, 0xAE }, /* box drawings double up and left */ + { 0x255E, 0xAF }, /* box drawings vertical single and right double */ + { 0x255F, 0xB0 }, /* box drawings vertical double and right single */ + { 0x2560, 0xB1 }, /* box drawings double vertical and right */ + { 0x2561, 0xB2 }, /* box drawings vertical single and left double */ + { 0x2562, 0xB4 }, /* box drawings vertical double and left single */ + { 0x2563, 0xB5 }, /* box drawings double vertical and left */ + { 0x2564, 0xB6 }, /* box drawings down single and horizontal double */ + { 0x2565, 0xB7 }, /* box drawings down double and horizontal single */ + { 0x2566, 0xB8 }, /* box drawings double down and horizontal */ + { 0x2567, 0xB9 }, /* box drawings up single and horizontal double */ + { 0x2568, 0xBA }, /* box drawings up double and horizontal single */ + { 0x2569, 0xBB }, /* box drawings double up and horizontal */ + { 0x256A, 0xBC }, /* box drawings vertical single and horizontal double */ + { 0x256B, 0xBD }, /* box drawings vertical double and horizontal single */ + { 0x256C, 0xBE }, /* box drawings double vertical and horizontal */ + { 0x2580, 0x8B }, /* upper half block */ + { 0x2584, 0x8C }, /* lower half block */ + { 0x2588, 0x8D }, /* full block */ + { 0x258C, 0x8E }, /* left half block */ + { 0x2590, 0x8F }, /* right half block */ + { 0x2591, 0x90 }, /* light shade */ + { 0x2592, 0x91 }, /* medium shade */ + { 0x2593, 0x92 }, /* dark shade */ + { 0x25A0, 0x94 }, /* black square */ +}; +/* {{{ end of mappings *from* Unicode for KOI8-R */ + +/* {{{ Mappings *from* Unicode for CP-866 */ +static const uni_to_enc unimap_cp866[] = { + { 0x00A0, 0xFF }, /* no-break space */ + { 0x00A4, 0xFD }, /* currency sign */ + { 0x00B0, 0xF8 }, /* degree sign */ + { 0x00B7, 0xFA }, /* middle dot */ + { 0x0401, 0xF0 }, /* cyrillic capital letter io */ + { 0x0404, 0xF2 }, /* cyrillic capital letter ukrainian ie */ + { 0x0407, 0xF4 }, /* cyrillic capital letter yi */ + { 0x040E, 0xF6 }, /* cyrillic capital letter short u */ + { 0x0410, 0x80 }, /* cyrillic capital letter a */ + { 0x0411, 0x81 }, /* cyrillic capital letter be */ + { 0x0412, 0x82 }, /* cyrillic capital letter ve */ + { 0x0413, 0x83 }, /* cyrillic capital letter ghe */ + { 0x0414, 0x84 }, /* cyrillic capital letter de */ + { 0x0415, 0x85 }, /* cyrillic capital letter ie */ + { 0x0416, 0x86 }, /* cyrillic capital letter zhe */ + { 0x0417, 0x87 }, /* cyrillic capital letter ze */ + { 0x0418, 0x88 }, /* cyrillic capital letter i */ + { 0x0419, 0x89 }, /* cyrillic capital letter short i */ + { 0x041A, 0x8A }, /* cyrillic capital letter ka */ + { 0x041B, 0x8B }, /* cyrillic capital letter el */ + { 0x041C, 0x8C }, /* cyrillic capital letter em */ + { 0x041D, 0x8D }, /* cyrillic capital letter en */ + { 0x041E, 0x8E }, /* cyrillic capital letter o */ + { 0x041F, 0x8F }, /* cyrillic capital letter pe */ + { 0x0420, 0x90 }, /* cyrillic capital letter er */ + { 0x0421, 0x91 }, /* cyrillic capital letter es */ + { 0x0422, 0x92 }, /* cyrillic capital letter te */ + { 0x0423, 0x93 }, /* cyrillic capital letter u */ + { 0x0424, 0x94 }, /* cyrillic capital letter ef */ + { 0x0425, 0x95 }, /* cyrillic capital letter ha */ + { 0x0426, 0x96 }, /* cyrillic capital letter tse */ + { 0x0427, 0x97 }, /* cyrillic capital letter che */ + { 0x0428, 0x98 }, /* cyrillic capital letter sha */ + { 0x0429, 0x99 }, /* cyrillic capital letter shcha */ + { 0x042A, 0x9A }, /* cyrillic capital letter hard sign */ + { 0x042B, 0x9B }, /* cyrillic capital letter yeru */ + { 0x042C, 0x9C }, /* cyrillic capital letter soft sign */ + { 0x042D, 0x9D }, /* cyrillic capital letter e */ + { 0x042E, 0x9E }, /* cyrillic capital letter yu */ + { 0x042F, 0x9F }, /* cyrillic capital letter ya */ + { 0x0430, 0xA0 }, /* cyrillic small letter a */ + { 0x0431, 0xA1 }, /* cyrillic small letter be */ + { 0x0432, 0xA2 }, /* cyrillic small letter ve */ + { 0x0433, 0xA3 }, /* cyrillic small letter ghe */ + { 0x0434, 0xA4 }, /* cyrillic small letter de */ + { 0x0435, 0xA5 }, /* cyrillic small letter ie */ + { 0x0436, 0xA6 }, /* cyrillic small letter zhe */ + { 0x0437, 0xA7 }, /* cyrillic small letter ze */ + { 0x0438, 0xA8 }, /* cyrillic small letter i */ + { 0x0439, 0xA9 }, /* cyrillic small letter short i */ + { 0x043A, 0xAA }, /* cyrillic small letter ka */ + { 0x043B, 0xAB }, /* cyrillic small letter el */ + { 0x043C, 0xAC }, /* cyrillic small letter em */ + { 0x043D, 0xAD }, /* cyrillic small letter en */ + { 0x043E, 0xAE }, /* cyrillic small letter o */ + { 0x043F, 0xAF }, /* cyrillic small letter pe */ + { 0x0440, 0xE0 }, /* cyrillic small letter er */ + { 0x0441, 0xE1 }, /* cyrillic small letter es */ + { 0x0442, 0xE2 }, /* cyrillic small letter te */ + { 0x0443, 0xE3 }, /* cyrillic small letter u */ + { 0x0444, 0xE4 }, /* cyrillic small letter ef */ + { 0x0445, 0xE5 }, /* cyrillic small letter ha */ + { 0x0446, 0xE6 }, /* cyrillic small letter tse */ + { 0x0447, 0xE7 }, /* cyrillic small letter che */ + { 0x0448, 0xE8 }, /* cyrillic small letter sha */ + { 0x0449, 0xE9 }, /* cyrillic small letter shcha */ + { 0x044A, 0xEA }, /* cyrillic small letter hard sign */ + { 0x044B, 0xEB }, /* cyrillic small letter yeru */ + { 0x044C, 0xEC }, /* cyrillic small letter soft sign */ + { 0x044D, 0xED }, /* cyrillic small letter e */ + { 0x044E, 0xEE }, /* cyrillic small letter yu */ + { 0x044F, 0xEF }, /* cyrillic small letter ya */ + { 0x0451, 0xF1 }, /* cyrillic small letter io */ + { 0x0454, 0xF3 }, /* cyrillic small letter ukrainian ie */ + { 0x0457, 0xF5 }, /* cyrillic small letter yi */ + { 0x045E, 0xF7 }, /* cyrillic small letter short u */ + { 0x2116, 0xFC }, /* numero sign */ + { 0x2219, 0xF9 }, /* bullet operator */ + { 0x221A, 0xFB }, /* square root */ + { 0x2500, 0xC4 }, /* box drawings light horizontal */ + { 0x2502, 0xB3 }, /* box drawings light vertical */ + { 0x250C, 0xDA }, /* box drawings light down and right */ + { 0x2510, 0xBF }, /* box drawings light down and left */ + { 0x2514, 0xC0 }, /* box drawings light up and right */ + { 0x2518, 0xD9 }, /* box drawings light up and left */ + { 0x251C, 0xC3 }, /* box drawings light vertical and right */ + { 0x2524, 0xB4 }, /* box drawings light vertical and left */ + { 0x252C, 0xC2 }, /* box drawings light down and horizontal */ + { 0x2534, 0xC1 }, /* box drawings light up and horizontal */ + { 0x253C, 0xC5 }, /* box drawings light vertical and horizontal */ + { 0x2550, 0xCD }, /* box drawings double horizontal */ + { 0x2551, 0xBA }, /* box drawings double vertical */ + { 0x2552, 0xD5 }, /* box drawings down single and right double */ + { 0x2553, 0xD6 }, /* box drawings down double and right single */ + { 0x2554, 0xC9 }, /* box drawings double down and right */ + { 0x2555, 0xB8 }, /* box drawings down single and left double */ + { 0x2556, 0xB7 }, /* box drawings down double and left single */ + { 0x2557, 0xBB }, /* box drawings double down and left */ + { 0x2558, 0xD4 }, /* box drawings up single and right double */ + { 0x2559, 0xD3 }, /* box drawings up double and right single */ + { 0x255A, 0xC8 }, /* box drawings double up and right */ + { 0x255B, 0xBE }, /* box drawings up single and left double */ + { 0x255C, 0xBD }, /* box drawings up double and left single */ + { 0x255D, 0xBC }, /* box drawings double up and left */ + { 0x255E, 0xC6 }, /* box drawings vertical single and right double */ + { 0x255F, 0xC7 }, /* box drawings vertical double and right single */ + { 0x2560, 0xCC }, /* box drawings double vertical and right */ + { 0x2561, 0xB5 }, /* box drawings vertical single and left double */ + { 0x2562, 0xB6 }, /* box drawings vertical double and left single */ + { 0x2563, 0xB9 }, /* box drawings double vertical and left */ + { 0x2564, 0xD1 }, /* box drawings down single and horizontal double */ + { 0x2565, 0xD2 }, /* box drawings down double and horizontal single */ + { 0x2566, 0xCB }, /* box drawings double down and horizontal */ + { 0x2567, 0xCF }, /* box drawings up single and horizontal double */ + { 0x2568, 0xD0 }, /* box drawings up double and horizontal single */ + { 0x2569, 0xCA }, /* box drawings double up and horizontal */ + { 0x256A, 0xD8 }, /* box drawings vertical single and horizontal double */ + { 0x256B, 0xD7 }, /* box drawings vertical double and horizontal single */ + { 0x256C, 0xCE }, /* box drawings double vertical and horizontal */ + { 0x2580, 0xDF }, /* upper half block */ + { 0x2584, 0xDC }, /* lower half block */ + { 0x2588, 0xDB }, /* full block */ + { 0x258C, 0xDD }, /* left half block */ + { 0x2590, 0xDE }, /* right half block */ + { 0x2591, 0xB0 }, /* light shade */ + { 0x2592, 0xB1 }, /* medium shade */ + { 0x2593, 0xB2 }, /* dark shade */ + { 0x25A0, 0xFE }, /* black square */ +}; +/* {{{ end of mappings *from* Unicode for CP-866 */ + +/* {{{ Mappings *from* Unicode for MacRoman */ +static const uni_to_enc unimap_macroman[] = { + { 0x00A0, 0xCA }, /* no-break space */ + { 0x00A1, 0xC1 }, /* inverted exclamation mark */ + { 0x00A2, 0xA2 }, /* cent sign */ + { 0x00A3, 0xA3 }, /* pound sign */ + { 0x00A5, 0xB4 }, /* yen sign */ + { 0x00A7, 0xA4 }, /* section sign */ + { 0x00A8, 0xAC }, /* diaeresis */ + { 0x00A9, 0xA9 }, /* copyright sign */ + { 0x00AA, 0xBB }, /* feminine ordinal indicator */ + { 0x00AB, 0xC7 }, /* left-pointing double angle quotation mark */ + { 0x00AC, 0xC2 }, /* not sign */ + { 0x00AE, 0xA8 }, /* registered sign */ + { 0x00AF, 0xF8 }, /* macron */ + { 0x00B0, 0xA1 }, /* degree sign */ + { 0x00B1, 0xB1 }, /* plus-minus sign */ + { 0x00B4, 0xAB }, /* acute accent */ + { 0x00B5, 0xB5 }, /* micro sign */ + { 0x00B6, 0xA6 }, /* pilcrow sign */ + { 0x00B7, 0xE1 }, /* middle dot */ + { 0x00B8, 0xFC }, /* cedilla */ + { 0x00BA, 0xBC }, /* masculine ordinal indicator */ + { 0x00BB, 0xC8 }, /* right-pointing double angle quotation mark */ + { 0x00BF, 0xC0 }, /* inverted question mark */ + { 0x00C0, 0xCB }, /* latin capital letter a with grave */ + { 0x00C1, 0xE7 }, /* latin capital letter a with acute */ + { 0x00C2, 0xE5 }, /* latin capital letter a with circumflex */ + { 0x00C3, 0xCC }, /* latin capital letter a with tilde */ + { 0x00C4, 0x80 }, /* latin capital letter a with diaeresis */ + { 0x00C5, 0x81 }, /* latin capital letter a with ring above */ + { 0x00C6, 0xAE }, /* latin capital letter ae */ + { 0x00C7, 0x82 }, /* latin capital letter c with cedilla */ + { 0x00C8, 0xE9 }, /* latin capital letter e with grave */ + { 0x00C9, 0x83 }, /* latin capital letter e with acute */ + { 0x00CA, 0xE6 }, /* latin capital letter e with circumflex */ + { 0x00CB, 0xE8 }, /* latin capital letter e with diaeresis */ + { 0x00CC, 0xED }, /* latin capital letter i with grave */ + { 0x00CD, 0xEA }, /* latin capital letter i with acute */ + { 0x00CE, 0xEB }, /* latin capital letter i with circumflex */ + { 0x00CF, 0xEC }, /* latin capital letter i with diaeresis */ + { 0x00D1, 0x84 }, /* latin capital letter n with tilde */ + { 0x00D2, 0xF1 }, /* latin capital letter o with grave */ + { 0x00D3, 0xEE }, /* latin capital letter o with acute */ + { 0x00D4, 0xEF }, /* latin capital letter o with circumflex */ + { 0x00D5, 0xCD }, /* latin capital letter o with tilde */ + { 0x00D6, 0x85 }, /* latin capital letter o with diaeresis */ + { 0x00D8, 0xAF }, /* latin capital letter o with stroke */ + { 0x00D9, 0xF4 }, /* latin capital letter u with grave */ + { 0x00DA, 0xF2 }, /* latin capital letter u with acute */ + { 0x00DB, 0xF3 }, /* latin capital letter u with circumflex */ + { 0x00DC, 0x86 }, /* latin capital letter u with diaeresis */ + { 0x00DF, 0xA7 }, /* latin small letter sharp s */ + { 0x00E0, 0x88 }, /* latin small letter a with grave */ + { 0x00E1, 0x87 }, /* latin small letter a with acute */ + { 0x00E2, 0x89 }, /* latin small letter a with circumflex */ + { 0x00E3, 0x8B }, /* latin small letter a with tilde */ + { 0x00E4, 0x8A }, /* latin small letter a with diaeresis */ + { 0x00E5, 0x8C }, /* latin small letter a with ring above */ + { 0x00E6, 0xBE }, /* latin small letter ae */ + { 0x00E7, 0x8D }, /* latin small letter c with cedilla */ + { 0x00E8, 0x8F }, /* latin small letter e with grave */ + { 0x00E9, 0x8E }, /* latin small letter e with acute */ + { 0x00EA, 0x90 }, /* latin small letter e with circumflex */ + { 0x00EB, 0x91 }, /* latin small letter e with diaeresis */ + { 0x00EC, 0x93 }, /* latin small letter i with grave */ + { 0x00ED, 0x92 }, /* latin small letter i with acute */ + { 0x00EE, 0x94 }, /* latin small letter i with circumflex */ + { 0x00EF, 0x95 }, /* latin small letter i with diaeresis */ + { 0x00F1, 0x96 }, /* latin small letter n with tilde */ + { 0x00F2, 0x98 }, /* latin small letter o with grave */ + { 0x00F3, 0x97 }, /* latin small letter o with acute */ + { 0x00F4, 0x99 }, /* latin small letter o with circumflex */ + { 0x00F5, 0x9B }, /* latin small letter o with tilde */ + { 0x00F6, 0x9A }, /* latin small letter o with diaeresis */ + { 0x00F7, 0xD6 }, /* division sign */ + { 0x00F8, 0xBF }, /* latin small letter o with stroke */ + { 0x00F9, 0x9D }, /* latin small letter u with grave */ + { 0x00FA, 0x9C }, /* latin small letter u with acute */ + { 0x00FB, 0x9E }, /* latin small letter u with circumflex */ + { 0x00FC, 0x9F }, /* latin small letter u with diaeresis */ + { 0x00FF, 0xD8 }, /* latin small letter y with diaeresis */ + { 0x0131, 0xF5 }, /* latin small letter dotless i */ + { 0x0152, 0xCE }, /* latin capital ligature oe */ + { 0x0153, 0xCF }, /* latin small ligature oe */ + { 0x0178, 0xD9 }, /* latin capital letter y with diaeresis */ + { 0x0192, 0xC4 }, /* latin small letter f with hook */ + { 0x02C6, 0xF6 }, /* modifier letter circumflex accent */ + { 0x02C7, 0xFF }, /* caron */ + { 0x02D8, 0xF9 }, /* breve */ + { 0x02D9, 0xFA }, /* dot above */ + { 0x02DA, 0xFB }, /* ring above */ + { 0x02DB, 0xFE }, /* ogonek */ + { 0x02DC, 0xF7 }, /* small tilde */ + { 0x02DD, 0xFD }, /* double acute accent */ + { 0x03A9, 0xBD }, /* greek capital letter omega */ + { 0x03C0, 0xB9 }, /* greek small letter pi */ + { 0x2013, 0xD0 }, /* en dash */ + { 0x2014, 0xD1 }, /* em dash */ + { 0x2018, 0xD4 }, /* left single quotation mark */ + { 0x2019, 0xD5 }, /* right single quotation mark */ + { 0x201A, 0xE2 }, /* single low-9 quotation mark */ + { 0x201C, 0xD2 }, /* left double quotation mark */ + { 0x201D, 0xD3 }, /* right double quotation mark */ + { 0x201E, 0xE3 }, /* double low-9 quotation mark */ + { 0x2020, 0xA0 }, /* dagger */ + { 0x2021, 0xE0 }, /* double dagger */ + { 0x2022, 0xA5 }, /* bullet */ + { 0x2026, 0xC9 }, /* horizontal ellipsis */ + { 0x2030, 0xE4 }, /* per mille sign */ + { 0x2039, 0xDC }, /* single left-pointing angle quotation mark */ + { 0x203A, 0xDD }, /* single right-pointing angle quotation mark */ + { 0x2044, 0xDA }, /* fraction slash */ + { 0x20AC, 0xDB }, /* euro sign */ + { 0x2122, 0xAA }, /* trade mark sign */ + { 0x2202, 0xB6 }, /* partial differential */ + { 0x2206, 0xC6 }, /* increment */ + { 0x220F, 0xB8 }, /* n-ary product */ + { 0x2211, 0xB7 }, /* n-ary summation */ + { 0x221A, 0xC3 }, /* square root */ + { 0x221E, 0xB0 }, /* infinity */ + { 0x222B, 0xBA }, /* integral */ + { 0x2248, 0xC5 }, /* almost equal to */ + { 0x2260, 0xAD }, /* not equal to */ + { 0x2264, 0xB2 }, /* less-than or equal to */ + { 0x2265, 0xB3 }, /* greater-than or equal to */ + { 0x25CA, 0xD7 }, /* lozenge */ + { 0xF8FF, 0xF0 }, /* apple logo */ + { 0xFB01, 0xDE }, /* latin small ligature fi */ + { 0xFB02, 0xDF }, /* latin small ligature fl */ +}; +/* {{{ end of mappings *from* Unicode for MacRoman */ + +/* HTML 5 has many more named entities. + * Some of them map to two unicode code points, not one. + * We're going to use a three-stage table (with an extra one for the entities + * with two code points). */ + +#define ENT_STAGE1_INDEX(k) (((k) & 0xFFF000) >> 12) /* > 1D, we have no mapping */ +#define ENT_STAGE2_INDEX(k) (((k) & 0xFC0) >> 6) +#define ENT_STAGE3_INDEX(k) ((k) & 0x3F) +#define ENT_CODE_POINT_FROM_STAGES(i,j,k) (((i) << 12) | ((j) << 6) | (k)) + +/* The default entity may be NULL. Binary search is still possible while + is senseless as there are just two rows (see also find_entity_for_char()). */ +typedef union { + struct { + const char *default_entity; + unsigned size; /* number of remaining entries in the table */ + unsigned short default_entity_len; + } leading_entry; + struct { + const char *entity; + unsigned second_cp; /* second code point */ + unsigned short entity_len; + } normal_entry; +} entity_multicodepoint_row; + +/* blocks of these should start at code points k where k % 0xFC0 == 0 */ +typedef struct { + char ambiguous; /* if 0 look into entity */ + union { + struct { + const char *entity; /* may be NULL */ + unsigned short entity_len; + } ent; + const entity_multicodepoint_row *multicodepoint_table; + } data; +} entity_stage3_row; + +/* Calculate k & 0x3F Use as offset */ +typedef const entity_stage3_row *entity_stage2_row; /* 64 elements */ + +/* Calculate k & 0xFC0 >> 6. Use as offset */ +typedef const entity_stage3_row *const *entity_stage1_row; /* 64 elements */ + +/* For stage 1, Calculate k & 0xFFF000 >> 3*4. + * If larger than 1D, we have no mapping. Otherwise lookup that index */ + +typedef struct { + const entity_stage1_row *ms_table; + /* for tables with only basic entities, this member is to be accessed + * directly for better performance: */ + const entity_stage3_row *table; +} entity_table_opt; + +/* Replaced "GT" > "gt" and "QUOT" > "quot" for consistency's sake. */ + +/* {{{ Start of HTML5 multi-stage table for codepoint -> entity */ + +/* {{{ Start of double code point tables for HTML5 */ + +static const entity_multicodepoint_row multi_cp_html5_0003C[] = { + { {"lt", 01, 2} }, + { {"nvlt", 0x020D2, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0003D[] = { + { {"equals", 01, 6} }, + { {"bne", 0x020E5, 3} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0003E[] = { + { {"gt", 01, 2} }, + { {"nvgt", 0x020D2, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_00066[] = { + { {NULL, 01, 0} }, + { {"fjlig", 0x0006A, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0205F[] = { + { {"MediumSpace", 01, 11} }, + { {"ThickSpace", 0x0200A, 10} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0219D[] = { + { {"rarrw", 01, 5} }, + { {"nrarrw", 0x00338, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02202[] = { + { {"part", 01, 4} }, + { {"npart", 0x00338, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02220[] = { + { {"angle", 01, 5} }, + { {"nang", 0x020D2, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02229[] = { + { {"cap", 01, 3} }, + { {"caps", 0x0FE00, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0222A[] = { + { {"cup", 01, 3} }, + { {"cups", 0x0FE00, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0223C[] = { + { {"sim", 01, 3} }, + { {"nvsim", 0x020D2, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0223D[] = { + { {"bsim", 01, 4} }, + { {"race", 0x00331, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0223E[] = { + { {"ac", 01, 2} }, + { {"acE", 0x00333, 3} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02242[] = { + { {"esim", 01, 4} }, + { {"nesim", 0x00338, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0224B[] = { + { {"apid", 01, 4} }, + { {"napid", 0x00338, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0224D[] = { + { {"CupCap", 01, 6} }, + { {"nvap", 0x020D2, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0224E[] = { + { {"bump", 01, 4} }, + { {"nbump", 0x00338, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0224F[] = { + { {"HumpEqual", 01, 9} }, + { {"nbumpe", 0x00338, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02250[] = { + { {"esdot", 01, 5} }, + { {"nedot", 0x00338, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02261[] = { + { {"Congruent", 01, 9} }, + { {"bnequiv", 0x020E5, 7} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02264[] = { + { {"leq", 01, 3} }, + { {"nvle", 0x020D2, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02265[] = { + { {"ge", 01, 2} }, + { {"nvge", 0x020D2, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02266[] = { + { {"lE", 01, 2} }, + { {"nlE", 0x00338, 3} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02267[] = { + { {"geqq", 01, 4} }, + { {"NotGreaterFullEqual", 0x00338, 19} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02268[] = { + { {"lneqq", 01, 5} }, + { {"lvertneqq", 0x0FE00, 9} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02269[] = { + { {"gneqq", 01, 5} }, + { {"gvertneqq", 0x0FE00, 9} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0226A[] = { + { {"ll", 02, 2} }, + { {"nLtv", 0x00338, 4} }, + { {"nLt", 0x020D2, 3} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0226B[] = { + { {"gg", 02, 2} }, + { {"NotGreaterGreater", 0x00338, 17} }, + { {"nGt", 0x020D2, 3} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0227F[] = { + { {"SucceedsTilde", 01, 13} }, + { {"NotSucceedsTilde", 0x00338, 16} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02282[] = { + { {"sub", 01, 3} }, + { {"vnsub", 0x020D2, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02283[] = { + { {"sup", 01, 3} }, + { {"nsupset", 0x020D2, 7} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0228A[] = { + { {"subsetneq", 01, 9} }, + { {"vsubne", 0x0FE00, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0228B[] = { + { {"supsetneq", 01, 9} }, + { {"vsupne", 0x0FE00, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_0228F[] = { + { {"sqsub", 01, 5} }, + { {"NotSquareSubset", 0x00338, 15} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02290[] = { + { {"sqsupset", 01, 8} }, + { {"NotSquareSuperset", 0x00338, 17} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02293[] = { + { {"sqcap", 01, 5} }, + { {"sqcaps", 0x0FE00, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02294[] = { + { {"sqcup", 01, 5} }, + { {"sqcups", 0x0FE00, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_022B4[] = { + { {"LeftTriangleEqual", 01, 17} }, + { {"nvltrie", 0x020D2, 7} }, +}; +static const entity_multicodepoint_row multi_cp_html5_022B5[] = { + { {"RightTriangleEqual", 01, 18} }, + { {"nvrtrie", 0x020D2, 7} }, +}; +static const entity_multicodepoint_row multi_cp_html5_022D8[] = { + { {"Ll", 01, 2} }, + { {"nLl", 0x00338, 3} }, +}; +static const entity_multicodepoint_row multi_cp_html5_022D9[] = { + { {"Gg", 01, 2} }, + { {"nGg", 0x00338, 3} }, +}; +static const entity_multicodepoint_row multi_cp_html5_022DA[] = { + { {"lesseqgtr", 01, 9} }, + { {"lesg", 0x0FE00, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_022DB[] = { + { {"gtreqless", 01, 9} }, + { {"gesl", 0x0FE00, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_022F5[] = { + { {"isindot", 01, 7} }, + { {"notindot", 0x00338, 8} }, +}; +static const entity_multicodepoint_row multi_cp_html5_022F9[] = { + { {"isinE", 01, 5} }, + { {"notinE", 0x00338, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02933[] = { + { {"rarrc", 01, 5} }, + { {"nrarrc", 0x00338, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_029CF[] = { + { {"LeftTriangleBar", 01, 15} }, + { {"NotLeftTriangleBar", 0x00338, 18} }, +}; +static const entity_multicodepoint_row multi_cp_html5_029D0[] = { + { {"RightTriangleBar", 01, 16} }, + { {"NotRightTriangleBar", 0x00338, 19} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02A6D[] = { + { {"congdot", 01, 7} }, + { {"ncongdot", 0x00338, 8} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02A70[] = { + { {"apE", 01, 3} }, + { {"napE", 0x00338, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02A7D[] = { + { {"les", 01, 3} }, + { {"nles", 0x00338, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02A7E[] = { + { {"ges", 01, 3} }, + { {"nges", 0x00338, 4} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AA1[] = { + { {"LessLess", 01, 8} }, + { {"NotNestedLessLess", 0x00338, 17} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AA2[] = { + { {"GreaterGreater", 01, 14} }, + { {"NotNestedGreaterGreater", 0x00338, 23} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AAC[] = { + { {"smte", 01, 4} }, + { {"smtes", 0x0FE00, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AAD[] = { + { {"late", 01, 4} }, + { {"lates", 0x0FE00, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AAF[] = { + { {"preceq", 01, 6} }, + { {"NotPrecedesEqual", 0x00338, 16} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AB0[] = { + { {"SucceedsEqual", 01, 13} }, + { {"NotSucceedsEqual", 0x00338, 16} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AC5[] = { + { {"subE", 01, 4} }, + { {"nsubE", 0x00338, 5} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AC6[] = { + { {"supseteqq", 01, 9} }, + { {"nsupseteqq", 0x00338, 10} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02ACB[] = { + { {"subsetneqq", 01, 10} }, + { {"vsubnE", 0x0FE00, 6} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02ACC[] = { + { {"supnE", 01, 5} }, + { {"varsupsetneqq", 0x0FE00, 13} }, +}; +static const entity_multicodepoint_row multi_cp_html5_02AFD[] = { + { {"parsl", 01, 5} }, + { {"nparsl", 0x020E5, 6} }, +}; + +/* End of double code point tables }}} */ + +/* {{{ Stage 3 Tables for HTML5 */ + +static const entity_stage3_row empty_stage3_table[] = { + /* 64 elements */ + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; +static const entity_stage3_row stage3_table_html5_00000[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"Tab", 3} } }, {0, { {"NewLine", 7} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"excl", 4} } }, {0, { {"quot", 4} } }, {0, { {"num", 3} } }, + {0, { {"dollar", 6} } }, {0, { {"percnt", 6} } }, {0, { {"amp", 3} } }, {0, { {"apos", 4} } }, + {0, { {"lpar", 4} } }, {0, { {"rpar", 4} } }, {0, { {"ast", 3} } }, {0, { {"plus", 4} } }, + {0, { {"comma", 5} } }, {0, { {NULL, 0} } }, {0, { {"period", 6} } }, {0, { {"sol", 3} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"colon", 5} } }, {0, { {"semi", 4} } }, + {1, { {(void *)multi_cp_html5_0003C, 0} } }, {1, { {(void *)multi_cp_html5_0003D, 0} } }, {1, { {(void *)multi_cp_html5_0003E, 0} } }, {0, { {"quest", 5} } }, +}; + +static const entity_stage3_row stage3_table_html5_00040[] = { + {0, { {"commat", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lbrack", 6} } }, + {0, { {"bsol", 4} } }, {0, { {"rsqb", 4} } }, {0, { {"Hat", 3} } }, {0, { {"lowbar", 6} } }, + {0, { {"grave", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {1, { {(void *)multi_cp_html5_00066, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lbrace", 6} } }, + {0, { {"vert", 4} } }, {0, { {"rcub", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_00080[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"nbsp", 4} } }, {0, { {"iexcl", 5} } }, {0, { {"cent", 4} } }, {0, { {"pound", 5} } }, + {0, { {"curren", 6} } }, {0, { {"yen", 3} } }, {0, { {"brvbar", 6} } }, {0, { {"sect", 4} } }, + {0, { {"DoubleDot", 9} } }, {0, { {"copy", 4} } }, {0, { {"ordf", 4} } }, {0, { {"laquo", 5} } }, + {0, { {"not", 3} } }, {0, { {"shy", 3} } }, {0, { {"reg", 3} } }, {0, { {"macr", 4} } }, + {0, { {"deg", 3} } }, {0, { {"plusmn", 6} } }, {0, { {"sup2", 4} } }, {0, { {"sup3", 4} } }, + {0, { {"DiacriticalAcute", 16} } }, {0, { {"micro", 5} } }, {0, { {"para", 4} } }, {0, { {"CenterDot", 9} } }, + {0, { {"Cedilla", 7} } }, {0, { {"sup1", 4} } }, {0, { {"ordm", 4} } }, {0, { {"raquo", 5} } }, + {0, { {"frac14", 6} } }, {0, { {"half", 4} } }, {0, { {"frac34", 6} } }, {0, { {"iquest", 6} } }, +}; + +static const entity_stage3_row stage3_table_html5_000C0[] = { + {0, { {"Agrave", 6} } }, {0, { {"Aacute", 6} } }, {0, { {"Acirc", 5} } }, {0, { {"Atilde", 6} } }, + {0, { {"Auml", 4} } }, {0, { {"Aring", 5} } }, {0, { {"AElig", 5} } }, {0, { {"Ccedil", 6} } }, + {0, { {"Egrave", 6} } }, {0, { {"Eacute", 6} } }, {0, { {"Ecirc", 5} } }, {0, { {"Euml", 4} } }, + {0, { {"Igrave", 6} } }, {0, { {"Iacute", 6} } }, {0, { {"Icirc", 5} } }, {0, { {"Iuml", 4} } }, + {0, { {"ETH", 3} } }, {0, { {"Ntilde", 6} } }, {0, { {"Ograve", 6} } }, {0, { {"Oacute", 6} } }, + {0, { {"Ocirc", 5} } }, {0, { {"Otilde", 6} } }, {0, { {"Ouml", 4} } }, {0, { {"times", 5} } }, + {0, { {"Oslash", 6} } }, {0, { {"Ugrave", 6} } }, {0, { {"Uacute", 6} } }, {0, { {"Ucirc", 5} } }, + {0, { {"Uuml", 4} } }, {0, { {"Yacute", 6} } }, {0, { {"THORN", 5} } }, {0, { {"szlig", 5} } }, + {0, { {"agrave", 6} } }, {0, { {"aacute", 6} } }, {0, { {"acirc", 5} } }, {0, { {"atilde", 6} } }, + {0, { {"auml", 4} } }, {0, { {"aring", 5} } }, {0, { {"aelig", 5} } }, {0, { {"ccedil", 6} } }, + {0, { {"egrave", 6} } }, {0, { {"eacute", 6} } }, {0, { {"ecirc", 5} } }, {0, { {"euml", 4} } }, + {0, { {"igrave", 6} } }, {0, { {"iacute", 6} } }, {0, { {"icirc", 5} } }, {0, { {"iuml", 4} } }, + {0, { {"eth", 3} } }, {0, { {"ntilde", 6} } }, {0, { {"ograve", 6} } }, {0, { {"oacute", 6} } }, + {0, { {"ocirc", 5} } }, {0, { {"otilde", 6} } }, {0, { {"ouml", 4} } }, {0, { {"divide", 6} } }, + {0, { {"oslash", 6} } }, {0, { {"ugrave", 6} } }, {0, { {"uacute", 6} } }, {0, { {"ucirc", 5} } }, + {0, { {"uuml", 4} } }, {0, { {"yacute", 6} } }, {0, { {"thorn", 5} } }, {0, { {"yuml", 4} } }, +}; + +static const entity_stage3_row stage3_table_html5_00100[] = { + {0, { {"Amacr", 5} } }, {0, { {"amacr", 5} } }, {0, { {"Abreve", 6} } }, {0, { {"abreve", 6} } }, + {0, { {"Aogon", 5} } }, {0, { {"aogon", 5} } }, {0, { {"Cacute", 6} } }, {0, { {"cacute", 6} } }, + {0, { {"Ccirc", 5} } }, {0, { {"ccirc", 5} } }, {0, { {"Cdot", 4} } }, {0, { {"cdot", 4} } }, + {0, { {"Ccaron", 6} } }, {0, { {"ccaron", 6} } }, {0, { {"Dcaron", 6} } }, {0, { {"dcaron", 6} } }, + {0, { {"Dstrok", 6} } }, {0, { {"dstrok", 6} } }, {0, { {"Emacr", 5} } }, {0, { {"emacr", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"Edot", 4} } }, {0, { {"edot", 4} } }, + {0, { {"Eogon", 5} } }, {0, { {"eogon", 5} } }, {0, { {"Ecaron", 6} } }, {0, { {"ecaron", 6} } }, + {0, { {"Gcirc", 5} } }, {0, { {"gcirc", 5} } }, {0, { {"Gbreve", 6} } }, {0, { {"gbreve", 6} } }, + {0, { {"Gdot", 4} } }, {0, { {"gdot", 4} } }, {0, { {"Gcedil", 6} } }, {0, { {NULL, 0} } }, + {0, { {"Hcirc", 5} } }, {0, { {"hcirc", 5} } }, {0, { {"Hstrok", 6} } }, {0, { {"hstrok", 6} } }, + {0, { {"Itilde", 6} } }, {0, { {"itilde", 6} } }, {0, { {"Imacr", 5} } }, {0, { {"imacr", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"Iogon", 5} } }, {0, { {"iogon", 5} } }, + {0, { {"Idot", 4} } }, {0, { {"inodot", 6} } }, {0, { {"IJlig", 5} } }, {0, { {"ijlig", 5} } }, + {0, { {"Jcirc", 5} } }, {0, { {"jcirc", 5} } }, {0, { {"Kcedil", 6} } }, {0, { {"kcedil", 6} } }, + {0, { {"kgreen", 6} } }, {0, { {"Lacute", 6} } }, {0, { {"lacute", 6} } }, {0, { {"Lcedil", 6} } }, + {0, { {"lcedil", 6} } }, {0, { {"Lcaron", 6} } }, {0, { {"lcaron", 6} } }, {0, { {"Lmidot", 6} } }, +}; + +static const entity_stage3_row stage3_table_html5_00140[] = { + {0, { {"lmidot", 6} } }, {0, { {"Lstrok", 6} } }, {0, { {"lstrok", 6} } }, {0, { {"Nacute", 6} } }, + {0, { {"nacute", 6} } }, {0, { {"Ncedil", 6} } }, {0, { {"ncedil", 6} } }, {0, { {"Ncaron", 6} } }, + {0, { {"ncaron", 6} } }, {0, { {"napos", 5} } }, {0, { {"ENG", 3} } }, {0, { {"eng", 3} } }, + {0, { {"Omacr", 5} } }, {0, { {"omacr", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Odblac", 6} } }, {0, { {"odblac", 6} } }, {0, { {"OElig", 5} } }, {0, { {"oelig", 5} } }, + {0, { {"Racute", 6} } }, {0, { {"racute", 6} } }, {0, { {"Rcedil", 6} } }, {0, { {"rcedil", 6} } }, + {0, { {"Rcaron", 6} } }, {0, { {"rcaron", 6} } }, {0, { {"Sacute", 6} } }, {0, { {"sacute", 6} } }, + {0, { {"Scirc", 5} } }, {0, { {"scirc", 5} } }, {0, { {"Scedil", 6} } }, {0, { {"scedil", 6} } }, + {0, { {"Scaron", 6} } }, {0, { {"scaron", 6} } }, {0, { {"Tcedil", 6} } }, {0, { {"tcedil", 6} } }, + {0, { {"Tcaron", 6} } }, {0, { {"tcaron", 6} } }, {0, { {"Tstrok", 6} } }, {0, { {"tstrok", 6} } }, + {0, { {"Utilde", 6} } }, {0, { {"utilde", 6} } }, {0, { {"Umacr", 5} } }, {0, { {"umacr", 5} } }, + {0, { {"Ubreve", 6} } }, {0, { {"ubreve", 6} } }, {0, { {"Uring", 5} } }, {0, { {"uring", 5} } }, + {0, { {"Udblac", 6} } }, {0, { {"udblac", 6} } }, {0, { {"Uogon", 5} } }, {0, { {"uogon", 5} } }, + {0, { {"Wcirc", 5} } }, {0, { {"wcirc", 5} } }, {0, { {"Ycirc", 5} } }, {0, { {"ycirc", 5} } }, + {0, { {"Yuml", 4} } }, {0, { {"Zacute", 6} } }, {0, { {"zacute", 6} } }, {0, { {"Zdot", 4} } }, + {0, { {"zdot", 4} } }, {0, { {"Zcaron", 6} } }, {0, { {"zcaron", 6} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_00180[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"fnof", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"imped", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_001C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"gacute", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_00200[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"jmath", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_002C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"circ", 4} } }, {0, { {"Hacek", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Breve", 5} } }, {0, { {"dot", 3} } }, {0, { {"ring", 4} } }, {0, { {"ogon", 4} } }, + {0, { {"DiacriticalTilde", 16} } }, {0, { {"DiacriticalDoubleAcute", 22} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_00300[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"DownBreve", 9} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_00380[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"Alpha", 5} } }, {0, { {"Beta", 4} } }, {0, { {"Gamma", 5} } }, + {0, { {"Delta", 5} } }, {0, { {"Epsilon", 7} } }, {0, { {"Zeta", 4} } }, {0, { {"Eta", 3} } }, + {0, { {"Theta", 5} } }, {0, { {"Iota", 4} } }, {0, { {"Kappa", 5} } }, {0, { {"Lambda", 6} } }, + {0, { {"Mu", 2} } }, {0, { {"Nu", 2} } }, {0, { {"Xi", 2} } }, {0, { {"Omicron", 7} } }, + {0, { {"Pi", 2} } }, {0, { {"Rho", 3} } }, {0, { {NULL, 0} } }, {0, { {"Sigma", 5} } }, + {0, { {"Tau", 3} } }, {0, { {"Upsilon", 7} } }, {0, { {"Phi", 3} } }, {0, { {"Chi", 3} } }, + {0, { {"Psi", 3} } }, {0, { {"Omega", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"alpha", 5} } }, {0, { {"beta", 4} } }, {0, { {"gamma", 5} } }, + {0, { {"delta", 5} } }, {0, { {"epsi", 4} } }, {0, { {"zeta", 4} } }, {0, { {"eta", 3} } }, + {0, { {"theta", 5} } }, {0, { {"iota", 4} } }, {0, { {"kappa", 5} } }, {0, { {"lambda", 6} } }, + {0, { {"mu", 2} } }, {0, { {"nu", 2} } }, {0, { {"xi", 2} } }, {0, { {"omicron", 7} } }, +}; + +static const entity_stage3_row stage3_table_html5_003C0[] = { + {0, { {"pi", 2} } }, {0, { {"rho", 3} } }, {0, { {"sigmav", 6} } }, {0, { {"sigma", 5} } }, + {0, { {"tau", 3} } }, {0, { {"upsi", 4} } }, {0, { {"phi", 3} } }, {0, { {"chi", 3} } }, + {0, { {"psi", 3} } }, {0, { {"omega", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"thetasym", 8} } }, {0, { {"upsih", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"straightphi", 11} } }, {0, { {"piv", 3} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Gammad", 6} } }, {0, { {"gammad", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"varkappa", 8} } }, {0, { {"rhov", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"straightepsilon", 15} } }, {0, { {"backepsilon", 11} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_00400[] = { + {0, { {NULL, 0} } }, {0, { {"IOcy", 4} } }, {0, { {"DJcy", 4} } }, {0, { {"GJcy", 4} } }, + {0, { {"Jukcy", 5} } }, {0, { {"DScy", 4} } }, {0, { {"Iukcy", 5} } }, {0, { {"YIcy", 4} } }, + {0, { {"Jsercy", 6} } }, {0, { {"LJcy", 4} } }, {0, { {"NJcy", 4} } }, {0, { {"TSHcy", 5} } }, + {0, { {"KJcy", 4} } }, {0, { {NULL, 0} } }, {0, { {"Ubrcy", 5} } }, {0, { {"DZcy", 4} } }, + {0, { {"Acy", 3} } }, {0, { {"Bcy", 3} } }, {0, { {"Vcy", 3} } }, {0, { {"Gcy", 3} } }, + {0, { {"Dcy", 3} } }, {0, { {"IEcy", 4} } }, {0, { {"ZHcy", 4} } }, {0, { {"Zcy", 3} } }, + {0, { {"Icy", 3} } }, {0, { {"Jcy", 3} } }, {0, { {"Kcy", 3} } }, {0, { {"Lcy", 3} } }, + {0, { {"Mcy", 3} } }, {0, { {"Ncy", 3} } }, {0, { {"Ocy", 3} } }, {0, { {"Pcy", 3} } }, + {0, { {"Rcy", 3} } }, {0, { {"Scy", 3} } }, {0, { {"Tcy", 3} } }, {0, { {"Ucy", 3} } }, + {0, { {"Fcy", 3} } }, {0, { {"KHcy", 4} } }, {0, { {"TScy", 4} } }, {0, { {"CHcy", 4} } }, + {0, { {"SHcy", 4} } }, {0, { {"SHCHcy", 6} } }, {0, { {"HARDcy", 6} } }, {0, { {"Ycy", 3} } }, + {0, { {"SOFTcy", 6} } }, {0, { {"Ecy", 3} } }, {0, { {"YUcy", 4} } }, {0, { {"YAcy", 4} } }, + {0, { {"acy", 3} } }, {0, { {"bcy", 3} } }, {0, { {"vcy", 3} } }, {0, { {"gcy", 3} } }, + {0, { {"dcy", 3} } }, {0, { {"iecy", 4} } }, {0, { {"zhcy", 4} } }, {0, { {"zcy", 3} } }, + {0, { {"icy", 3} } }, {0, { {"jcy", 3} } }, {0, { {"kcy", 3} } }, {0, { {"lcy", 3} } }, + {0, { {"mcy", 3} } }, {0, { {"ncy", 3} } }, {0, { {"ocy", 3} } }, {0, { {"pcy", 3} } }, +}; + +static const entity_stage3_row stage3_table_html5_00440[] = { + {0, { {"rcy", 3} } }, {0, { {"scy", 3} } }, {0, { {"tcy", 3} } }, {0, { {"ucy", 3} } }, + {0, { {"fcy", 3} } }, {0, { {"khcy", 4} } }, {0, { {"tscy", 4} } }, {0, { {"chcy", 4} } }, + {0, { {"shcy", 4} } }, {0, { {"shchcy", 6} } }, {0, { {"hardcy", 6} } }, {0, { {"ycy", 3} } }, + {0, { {"softcy", 6} } }, {0, { {"ecy", 3} } }, {0, { {"yucy", 4} } }, {0, { {"yacy", 4} } }, + {0, { {NULL, 0} } }, {0, { {"iocy", 4} } }, {0, { {"djcy", 4} } }, {0, { {"gjcy", 4} } }, + {0, { {"jukcy", 5} } }, {0, { {"dscy", 4} } }, {0, { {"iukcy", 5} } }, {0, { {"yicy", 4} } }, + {0, { {"jsercy", 6} } }, {0, { {"ljcy", 4} } }, {0, { {"njcy", 4} } }, {0, { {"tshcy", 5} } }, + {0, { {"kjcy", 4} } }, {0, { {NULL, 0} } }, {0, { {"ubrcy", 5} } }, {0, { {"dzcy", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02000[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"ensp", 4} } }, {0, { {"emsp", 4} } }, + {0, { {"emsp13", 6} } }, {0, { {"emsp14", 6} } }, {0, { {NULL, 0} } }, {0, { {"numsp", 5} } }, + {0, { {"puncsp", 6} } }, {0, { {"ThinSpace", 9} } }, {0, { {"hairsp", 6} } }, {0, { {"ZeroWidthSpace", 14} } }, + {0, { {"zwnj", 4} } }, {0, { {"zwj", 3} } }, {0, { {"lrm", 3} } }, {0, { {"rlm", 3} } }, + {0, { {"hyphen", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"ndash", 5} } }, + {0, { {"mdash", 5} } }, {0, { {"horbar", 6} } }, {0, { {"Verbar", 6} } }, {0, { {NULL, 0} } }, + {0, { {"OpenCurlyQuote", 14} } }, {0, { {"rsquo", 5} } }, {0, { {"sbquo", 5} } }, {0, { {NULL, 0} } }, + {0, { {"OpenCurlyDoubleQuote", 20} } }, {0, { {"rdquo", 5} } }, {0, { {"bdquo", 5} } }, {0, { {NULL, 0} } }, + {0, { {"dagger", 6} } }, {0, { {"Dagger", 6} } }, {0, { {"bull", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"nldr", 4} } }, {0, { {"hellip", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"permil", 6} } }, {0, { {"pertenk", 7} } }, {0, { {"prime", 5} } }, {0, { {"Prime", 5} } }, + {0, { {"tprime", 6} } }, {0, { {"backprime", 9} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"lsaquo", 6} } }, {0, { {"rsaquo", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"oline", 5} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02040[] = { + {0, { {NULL, 0} } }, {0, { {"caret", 5} } }, {0, { {NULL, 0} } }, {0, { {"hybull", 6} } }, + {0, { {"frasl", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"bsemi", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"qprime", 6} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {1, { {(void *)multi_cp_html5_0205F, 0} } }, + {0, { {"NoBreak", 7} } }, {0, { {"af", 2} } }, {0, { {"InvisibleTimes", 14} } }, {0, { {"ic", 2} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02080[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"euro", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_020C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"TripleDot", 9} } }, + {0, { {"DotDot", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02100[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"complexes", 9} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"incare", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"gscr", 4} } }, {0, { {"HilbertSpace", 12} } }, + {0, { {"Hfr", 3} } }, {0, { {"Hopf", 4} } }, {0, { {"planckh", 7} } }, {0, { {"planck", 6} } }, + {0, { {"imagline", 8} } }, {0, { {"Ifr", 3} } }, {0, { {"lagran", 6} } }, {0, { {"ell", 3} } }, + {0, { {NULL, 0} } }, {0, { {"naturals", 8} } }, {0, { {"numero", 6} } }, {0, { {"copysr", 6} } }, + {0, { {"wp", 2} } }, {0, { {"primes", 6} } }, {0, { {"rationals", 9} } }, {0, { {"realine", 7} } }, + {0, { {"Rfr", 3} } }, {0, { {"Ropf", 4} } }, {0, { {"rx", 2} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"trade", 5} } }, {0, { {NULL, 0} } }, + {0, { {"Zopf", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"mho", 3} } }, + {0, { {"Zfr", 3} } }, {0, { {"iiota", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Bscr", 4} } }, {0, { {"Cfr", 3} } }, {0, { {NULL, 0} } }, {0, { {"escr", 4} } }, + {0, { {"expectation", 11} } }, {0, { {"Fouriertrf", 10} } }, {0, { {NULL, 0} } }, {0, { {"Mellintrf", 9} } }, + {0, { {"orderof", 7} } }, {0, { {"aleph", 5} } }, {0, { {"beth", 4} } }, {0, { {"gimel", 5} } }, + {0, { {"daleth", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02140[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"CapitalDifferentialD", 20} } }, {0, { {"DifferentialD", 13} } }, {0, { {"exponentiale", 12} } }, + {0, { {"ImaginaryI", 10} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"frac13", 6} } }, + {0, { {"frac23", 6} } }, {0, { {"frac15", 6} } }, {0, { {"frac25", 6} } }, {0, { {"frac35", 6} } }, + {0, { {"frac45", 6} } }, {0, { {"frac16", 6} } }, {0, { {"frac56", 6} } }, {0, { {"frac18", 6} } }, + {0, { {"frac38", 6} } }, {0, { {"frac58", 6} } }, {0, { {"frac78", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02180[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"larr", 4} } }, {0, { {"uarr", 4} } }, {0, { {"srarr", 5} } }, {0, { {"darr", 4} } }, + {0, { {"harr", 4} } }, {0, { {"UpDownArrow", 11} } }, {0, { {"nwarrow", 7} } }, {0, { {"UpperRightArrow", 15} } }, + {0, { {"LowerRightArrow", 15} } }, {0, { {"swarr", 5} } }, {0, { {"nleftarrow", 10} } }, {0, { {"nrarr", 5} } }, + {0, { {NULL, 0} } }, {1, { {(void *)multi_cp_html5_0219D, 0} } }, {0, { {"Larr", 4} } }, {0, { {"Uarr", 4} } }, + {0, { {"twoheadrightarrow", 17} } }, {0, { {"Darr", 4} } }, {0, { {"larrtl", 6} } }, {0, { {"rarrtl", 6} } }, + {0, { {"LeftTeeArrow", 12} } }, {0, { {"UpTeeArrow", 10} } }, {0, { {"map", 3} } }, {0, { {"DownTeeArrow", 12} } }, + {0, { {NULL, 0} } }, {0, { {"larrhk", 6} } }, {0, { {"rarrhk", 6} } }, {0, { {"larrlp", 6} } }, + {0, { {"looparrowright", 14} } }, {0, { {"harrw", 5} } }, {0, { {"nleftrightarrow", 15} } }, {0, { {NULL, 0} } }, + {0, { {"Lsh", 3} } }, {0, { {"rsh", 3} } }, {0, { {"ldsh", 4} } }, {0, { {"rdsh", 4} } }, + {0, { {NULL, 0} } }, {0, { {"crarr", 5} } }, {0, { {"curvearrowleft", 14} } }, {0, { {"curarr", 6} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"olarr", 5} } }, {0, { {"orarr", 5} } }, + {0, { {"leftharpoonup", 13} } }, {0, { {"leftharpoondown", 15} } }, {0, { {"RightUpVector", 13} } }, {0, { {"uharl", 5} } }, +}; + +static const entity_stage3_row stage3_table_html5_021C0[] = { + {0, { {"rharu", 5} } }, {0, { {"rhard", 5} } }, {0, { {"RightDownVector", 15} } }, {0, { {"dharl", 5} } }, + {0, { {"rightleftarrows", 15} } }, {0, { {"udarr", 5} } }, {0, { {"lrarr", 5} } }, {0, { {"llarr", 5} } }, + {0, { {"upuparrows", 10} } }, {0, { {"rrarr", 5} } }, {0, { {"downdownarrows", 14} } }, {0, { {"leftrightharpoons", 17} } }, + {0, { {"rightleftharpoons", 17} } }, {0, { {"nLeftarrow", 10} } }, {0, { {"nhArr", 5} } }, {0, { {"nrArr", 5} } }, + {0, { {"DoubleLeftArrow", 15} } }, {0, { {"DoubleUpArrow", 13} } }, {0, { {"Implies", 7} } }, {0, { {"Downarrow", 9} } }, + {0, { {"hArr", 4} } }, {0, { {"Updownarrow", 11} } }, {0, { {"nwArr", 5} } }, {0, { {"neArr", 5} } }, + {0, { {"seArr", 5} } }, {0, { {"swArr", 5} } }, {0, { {"lAarr", 5} } }, {0, { {"rAarr", 5} } }, + {0, { {NULL, 0} } }, {0, { {"zigrarr", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"LeftArrowBar", 12} } }, {0, { {"RightArrowBar", 13} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"DownArrowUpArrow", 16} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"loarr", 5} } }, {0, { {"roarr", 5} } }, {0, { {"hoarr", 5} } }, +}; + +static const entity_stage3_row stage3_table_html5_02200[] = { + {0, { {"forall", 6} } }, {0, { {"comp", 4} } }, {1, { {(void *)multi_cp_html5_02202, 0} } }, {0, { {"Exists", 6} } }, + {0, { {"nexist", 6} } }, {0, { {"empty", 5} } }, {0, { {NULL, 0} } }, {0, { {"nabla", 5} } }, + {0, { {"isinv", 5} } }, {0, { {"notin", 5} } }, {0, { {NULL, 0} } }, {0, { {"ReverseElement", 14} } }, + {0, { {"notniva", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"prod", 4} } }, + {0, { {"Coproduct", 9} } }, {0, { {"sum", 3} } }, {0, { {"minus", 5} } }, {0, { {"MinusPlus", 9} } }, + {0, { {"plusdo", 6} } }, {0, { {NULL, 0} } }, {0, { {"ssetmn", 6} } }, {0, { {"lowast", 6} } }, + {0, { {"compfn", 6} } }, {0, { {NULL, 0} } }, {0, { {"Sqrt", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"prop", 4} } }, {0, { {"infin", 5} } }, {0, { {"angrt", 5} } }, + {1, { {(void *)multi_cp_html5_02220, 0} } }, {0, { {"angmsd", 6} } }, {0, { {"angsph", 6} } }, {0, { {"mid", 3} } }, + {0, { {"nshortmid", 9} } }, {0, { {"shortparallel", 13} } }, {0, { {"nparallel", 9} } }, {0, { {"and", 3} } }, + {0, { {"or", 2} } }, {1, { {(void *)multi_cp_html5_02229, 0} } }, {1, { {(void *)multi_cp_html5_0222A, 0} } }, {0, { {"Integral", 8} } }, + {0, { {"Int", 3} } }, {0, { {"tint", 4} } }, {0, { {"ContourIntegral", 15} } }, {0, { {"DoubleContourIntegral", 21} } }, + {0, { {"Cconint", 7} } }, {0, { {"cwint", 5} } }, {0, { {"cwconint", 8} } }, {0, { {"awconint", 8} } }, + {0, { {"there4", 6} } }, {0, { {"Because", 7} } }, {0, { {"ratio", 5} } }, {0, { {"Colon", 5} } }, + {0, { {"minusd", 6} } }, {0, { {NULL, 0} } }, {0, { {"mDDot", 5} } }, {0, { {"homtht", 6} } }, + {1, { {(void *)multi_cp_html5_0223C, 0} } }, {1, { {(void *)multi_cp_html5_0223D, 0} } }, {1, { {(void *)multi_cp_html5_0223E, 0} } }, {0, { {"acd", 3} } }, +}; + +static const entity_stage3_row stage3_table_html5_02240[] = { + {0, { {"wr", 2} } }, {0, { {"NotTilde", 8} } }, {1, { {(void *)multi_cp_html5_02242, 0} } }, {0, { {"simeq", 5} } }, + {0, { {"nsime", 5} } }, {0, { {"TildeFullEqual", 14} } }, {0, { {"simne", 5} } }, {0, { {"ncong", 5} } }, + {0, { {"approx", 6} } }, {0, { {"napprox", 7} } }, {0, { {"ape", 3} } }, {1, { {(void *)multi_cp_html5_0224B, 0} } }, + {0, { {"bcong", 5} } }, {1, { {(void *)multi_cp_html5_0224D, 0} } }, {1, { {(void *)multi_cp_html5_0224E, 0} } }, {1, { {(void *)multi_cp_html5_0224F, 0} } }, + {1, { {(void *)multi_cp_html5_02250, 0} } }, {0, { {"doteqdot", 8} } }, {0, { {"fallingdotseq", 13} } }, {0, { {"risingdotseq", 12} } }, + {0, { {"coloneq", 7} } }, {0, { {"eqcolon", 7} } }, {0, { {"ecir", 4} } }, {0, { {"circeq", 6} } }, + {0, { {NULL, 0} } }, {0, { {"wedgeq", 6} } }, {0, { {"veeeq", 5} } }, {0, { {NULL, 0} } }, + {0, { {"triangleq", 9} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"equest", 6} } }, + {0, { {"NotEqual", 8} } }, {1, { {(void *)multi_cp_html5_02261, 0} } }, {0, { {"NotCongruent", 12} } }, {0, { {NULL, 0} } }, + {1, { {(void *)multi_cp_html5_02264, 0} } }, {1, { {(void *)multi_cp_html5_02265, 0} } }, {1, { {(void *)multi_cp_html5_02266, 0} } }, {1, { {(void *)multi_cp_html5_02267, 0} } }, + {1, { {(void *)multi_cp_html5_02268, 0} } }, {1, { {(void *)multi_cp_html5_02269, 0} } }, {1, { {(void *)multi_cp_html5_0226A, 0} } }, {1, { {(void *)multi_cp_html5_0226B, 0} } }, + {0, { {"between", 7} } }, {0, { {"NotCupCap", 9} } }, {0, { {"NotLess", 7} } }, {0, { {"ngtr", 4} } }, + {0, { {"NotLessEqual", 12} } }, {0, { {"ngeq", 4} } }, {0, { {"LessTilde", 9} } }, {0, { {"GreaterTilde", 12} } }, + {0, { {"nlsim", 5} } }, {0, { {"ngsim", 5} } }, {0, { {"lessgtr", 7} } }, {0, { {"gl", 2} } }, + {0, { {"ntlg", 4} } }, {0, { {"NotGreaterLess", 14} } }, {0, { {"prec", 4} } }, {0, { {"succ", 4} } }, + {0, { {"PrecedesSlantEqual", 18} } }, {0, { {"succcurlyeq", 11} } }, {0, { {"precsim", 7} } }, {1, { {(void *)multi_cp_html5_0227F, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02280[] = { + {0, { {"npr", 3} } }, {0, { {"NotSucceeds", 11} } }, {1, { {(void *)multi_cp_html5_02282, 0} } }, {1, { {(void *)multi_cp_html5_02283, 0} } }, + {0, { {"nsub", 4} } }, {0, { {"nsup", 4} } }, {0, { {"SubsetEqual", 11} } }, {0, { {"supe", 4} } }, + {0, { {"NotSubsetEqual", 14} } }, {0, { {"NotSupersetEqual", 16} } }, {1, { {(void *)multi_cp_html5_0228A, 0} } }, {1, { {(void *)multi_cp_html5_0228B, 0} } }, + {0, { {NULL, 0} } }, {0, { {"cupdot", 6} } }, {0, { {"UnionPlus", 9} } }, {1, { {(void *)multi_cp_html5_0228F, 0} } }, + {1, { {(void *)multi_cp_html5_02290, 0} } }, {0, { {"SquareSubsetEqual", 17} } }, {0, { {"SquareSupersetEqual", 19} } }, {1, { {(void *)multi_cp_html5_02293, 0} } }, + {1, { {(void *)multi_cp_html5_02294, 0} } }, {0, { {"CirclePlus", 10} } }, {0, { {"ominus", 6} } }, {0, { {"CircleTimes", 11} } }, + {0, { {"osol", 4} } }, {0, { {"CircleDot", 9} } }, {0, { {"ocir", 4} } }, {0, { {"oast", 4} } }, + {0, { {NULL, 0} } }, {0, { {"odash", 5} } }, {0, { {"boxplus", 7} } }, {0, { {"boxminus", 8} } }, + {0, { {"timesb", 6} } }, {0, { {"sdotb", 5} } }, {0, { {"vdash", 5} } }, {0, { {"dashv", 5} } }, + {0, { {"DownTee", 7} } }, {0, { {"perp", 4} } }, {0, { {NULL, 0} } }, {0, { {"models", 6} } }, + {0, { {"DoubleRightTee", 14} } }, {0, { {"Vdash", 5} } }, {0, { {"Vvdash", 6} } }, {0, { {"VDash", 5} } }, + {0, { {"nvdash", 6} } }, {0, { {"nvDash", 6} } }, {0, { {"nVdash", 6} } }, {0, { {"nVDash", 6} } }, + {0, { {"prurel", 6} } }, {0, { {NULL, 0} } }, {0, { {"vartriangleleft", 15} } }, {0, { {"vrtri", 5} } }, + {1, { {(void *)multi_cp_html5_022B4, 0} } }, {1, { {(void *)multi_cp_html5_022B5, 0} } }, {0, { {"origof", 6} } }, {0, { {"imof", 4} } }, + {0, { {"mumap", 5} } }, {0, { {"hercon", 6} } }, {0, { {"intcal", 6} } }, {0, { {"veebar", 6} } }, + {0, { {NULL, 0} } }, {0, { {"barvee", 6} } }, {0, { {"angrtvb", 7} } }, {0, { {"lrtri", 5} } }, +}; + +static const entity_stage3_row stage3_table_html5_022C0[] = { + {0, { {"xwedge", 6} } }, {0, { {"xvee", 4} } }, {0, { {"bigcap", 6} } }, {0, { {"bigcup", 6} } }, + {0, { {"diamond", 7} } }, {0, { {"sdot", 4} } }, {0, { {"Star", 4} } }, {0, { {"divonx", 6} } }, + {0, { {"bowtie", 6} } }, {0, { {"ltimes", 6} } }, {0, { {"rtimes", 6} } }, {0, { {"lthree", 6} } }, + {0, { {"rthree", 6} } }, {0, { {"backsimeq", 9} } }, {0, { {"curlyvee", 8} } }, {0, { {"curlywedge", 10} } }, + {0, { {"Sub", 3} } }, {0, { {"Supset", 6} } }, {0, { {"Cap", 3} } }, {0, { {"Cup", 3} } }, + {0, { {"pitchfork", 9} } }, {0, { {"epar", 4} } }, {0, { {"lessdot", 7} } }, {0, { {"gtrdot", 6} } }, + {1, { {(void *)multi_cp_html5_022D8, 0} } }, {1, { {(void *)multi_cp_html5_022D9, 0} } }, {1, { {(void *)multi_cp_html5_022DA, 0} } }, {1, { {(void *)multi_cp_html5_022DB, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"curlyeqprec", 11} } }, {0, { {"cuesc", 5} } }, + {0, { {"NotPrecedesSlantEqual", 21} } }, {0, { {"NotSucceedsSlantEqual", 21} } }, {0, { {"NotSquareSubsetEqual", 20} } }, {0, { {"NotSquareSupersetEqual", 22} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lnsim", 5} } }, {0, { {"gnsim", 5} } }, + {0, { {"precnsim", 8} } }, {0, { {"scnsim", 6} } }, {0, { {"nltri", 5} } }, {0, { {"ntriangleright", 14} } }, + {0, { {"nltrie", 6} } }, {0, { {"NotRightTriangleEqual", 21} } }, {0, { {"vellip", 6} } }, {0, { {"ctdot", 5} } }, + {0, { {"utdot", 5} } }, {0, { {"dtdot", 5} } }, {0, { {"disin", 5} } }, {0, { {"isinsv", 6} } }, + {0, { {"isins", 5} } }, {1, { {(void *)multi_cp_html5_022F5, 0} } }, {0, { {"notinvc", 7} } }, {0, { {"notinvb", 7} } }, + {0, { {NULL, 0} } }, {1, { {(void *)multi_cp_html5_022F9, 0} } }, {0, { {"nisd", 4} } }, {0, { {"xnis", 4} } }, + {0, { {"nis", 3} } }, {0, { {"notnivc", 7} } }, {0, { {"notnivb", 7} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02300[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"barwed", 6} } }, {0, { {"doublebarwedge", 14} } }, {0, { {NULL, 0} } }, + {0, { {"lceil", 5} } }, {0, { {"RightCeiling", 12} } }, {0, { {"LeftFloor", 9} } }, {0, { {"RightFloor", 10} } }, + {0, { {"drcrop", 6} } }, {0, { {"dlcrop", 6} } }, {0, { {"urcrop", 6} } }, {0, { {"ulcrop", 6} } }, + {0, { {"bnot", 4} } }, {0, { {NULL, 0} } }, {0, { {"profline", 8} } }, {0, { {"profsurf", 8} } }, + {0, { {NULL, 0} } }, {0, { {"telrec", 6} } }, {0, { {"target", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"ulcorner", 8} } }, {0, { {"urcorner", 8} } }, {0, { {"llcorner", 8} } }, {0, { {"drcorn", 6} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"frown", 5} } }, {0, { {"smile", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"cylcty", 6} } }, {0, { {"profalar", 8} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"topbot", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"ovbar", 5} } }, {0, { {NULL, 0} } }, {0, { {"solbar", 6} } }, +}; + +static const entity_stage3_row stage3_table_html5_02340[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"angzarr", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02380[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lmoust", 6} } }, {0, { {"rmoust", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"OverBracket", 11} } }, {0, { {"bbrk", 4} } }, {0, { {"bbrktbrk", 8} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_023C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"OverParenthesis", 15} } }, {0, { {"UnderParenthesis", 16} } }, {0, { {"OverBrace", 9} } }, {0, { {"UnderBrace", 10} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"trpezium", 8} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"elinters", 8} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02400[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"blank", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_024C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"oS", 2} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02500[] = { + {0, { {"HorizontalLine", 14} } }, {0, { {NULL, 0} } }, {0, { {"boxv", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxdr", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxdl", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxur", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxul", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxvr", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxvl", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxhd", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxhu", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxvh", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02540[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"boxH", 4} } }, {0, { {"boxV", 4} } }, {0, { {"boxdR", 5} } }, {0, { {"boxDr", 5} } }, + {0, { {"boxDR", 5} } }, {0, { {"boxdL", 5} } }, {0, { {"boxDl", 5} } }, {0, { {"boxDL", 5} } }, + {0, { {"boxuR", 5} } }, {0, { {"boxUr", 5} } }, {0, { {"boxUR", 5} } }, {0, { {"boxuL", 5} } }, + {0, { {"boxUl", 5} } }, {0, { {"boxUL", 5} } }, {0, { {"boxvR", 5} } }, {0, { {"boxVr", 5} } }, + {0, { {"boxVR", 5} } }, {0, { {"boxvL", 5} } }, {0, { {"boxVl", 5} } }, {0, { {"boxVL", 5} } }, + {0, { {"boxHd", 5} } }, {0, { {"boxhD", 5} } }, {0, { {"boxHD", 5} } }, {0, { {"boxHu", 5} } }, + {0, { {"boxhU", 5} } }, {0, { {"boxHU", 5} } }, {0, { {"boxvH", 5} } }, {0, { {"boxVh", 5} } }, + {0, { {"boxVH", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02580[] = { + {0, { {"uhblk", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lhblk", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"block", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"blk14", 5} } }, {0, { {"blk12", 5} } }, {0, { {"blk34", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"Square", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"squarf", 6} } }, {0, { {"EmptyVerySmallSquare", 20} } }, + {0, { {NULL, 0} } }, {0, { {"rect", 4} } }, {0, { {"marker", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"fltns", 5} } }, {0, { {NULL, 0} } }, {0, { {"bigtriangleup", 13} } }, + {0, { {"blacktriangle", 13} } }, {0, { {"triangle", 8} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"blacktriangleright", 18} } }, {0, { {"rtri", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"bigtriangledown", 15} } }, {0, { {"blacktriangledown", 17} } }, {0, { {"triangledown", 12} } }, +}; + +static const entity_stage3_row stage3_table_html5_025C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"blacktriangleleft", 17} } }, {0, { {"ltri", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lozenge", 7} } }, {0, { {"cir", 3} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"tridot", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"bigcirc", 7} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"ultri", 5} } }, {0, { {"urtri", 5} } }, {0, { {"lltri", 5} } }, {0, { {"EmptySmallSquare", 16} } }, + {0, { {"FilledSmallSquare", 17} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02600[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"starf", 5} } }, {0, { {"star", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"phone", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02640[] = { + {0, { {"female", 6} } }, {0, { {NULL, 0} } }, {0, { {"male", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"spadesuit", 9} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"clubs", 5} } }, + {0, { {NULL, 0} } }, {0, { {"hearts", 6} } }, {0, { {"diamondsuit", 11} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"sung", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"flat", 4} } }, {0, { {"natur", 5} } }, {0, { {"sharp", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02700[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"check", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"cross", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"maltese", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"sext", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02740[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"VerticalSeparator", 17} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lbbrk", 5} } }, {0, { {"rbbrk", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_027C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"bsolhsub", 8} } }, {0, { {"suphsol", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"LeftDoubleBracket", 17} } }, {0, { {"RightDoubleBracket", 18} } }, + {0, { {"langle", 6} } }, {0, { {"RightAngleBracket", 17} } }, {0, { {"Lang", 4} } }, {0, { {"Rang", 4} } }, + {0, { {"loang", 5} } }, {0, { {"roang", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"longleftarrow", 13} } }, {0, { {"LongRightArrow", 14} } }, {0, { {"LongLeftRightArrow", 18} } }, + {0, { {"xlArr", 5} } }, {0, { {"DoubleLongRightArrow", 20} } }, {0, { {"xhArr", 5} } }, {0, { {NULL, 0} } }, + {0, { {"xmap", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"dzigrarr", 8} } }, +}; + +static const entity_stage3_row stage3_table_html5_02900[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"nvlArr", 6} } }, {0, { {"nvrArr", 6} } }, + {0, { {"nvHarr", 6} } }, {0, { {"Map", 3} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lbarr", 5} } }, {0, { {"bkarow", 6} } }, {0, { {"lBarr", 5} } }, {0, { {"dbkarow", 7} } }, + {0, { {"drbkarow", 8} } }, {0, { {"DDotrahd", 8} } }, {0, { {"UpArrowBar", 10} } }, {0, { {"DownArrowBar", 12} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"Rarrtl", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"latail", 6} } }, {0, { {"ratail", 6} } }, {0, { {"lAtail", 6} } }, + {0, { {"rAtail", 6} } }, {0, { {"larrfs", 6} } }, {0, { {"rarrfs", 6} } }, {0, { {"larrbfs", 7} } }, + {0, { {"rarrbfs", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"nwarhk", 6} } }, + {0, { {"nearhk", 6} } }, {0, { {"searhk", 6} } }, {0, { {"swarhk", 6} } }, {0, { {"nwnear", 6} } }, + {0, { {"toea", 4} } }, {0, { {"seswar", 6} } }, {0, { {"swnwar", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {1, { {(void *)multi_cp_html5_02933, 0} } }, + {0, { {NULL, 0} } }, {0, { {"cudarrr", 7} } }, {0, { {"ldca", 4} } }, {0, { {"rdca", 4} } }, + {0, { {"cudarrl", 7} } }, {0, { {"larrpl", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"curarrm", 7} } }, {0, { {"cularrp", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02940[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"rarrpl", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"harrcir", 7} } }, {0, { {"Uarrocir", 8} } }, {0, { {"lurdshar", 8} } }, {0, { {"ldrushar", 8} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"LeftRightVector", 15} } }, {0, { {"RightUpDownVector", 17} } }, + {0, { {"DownLeftRightVector", 19} } }, {0, { {"LeftUpDownVector", 16} } }, {0, { {"LeftVectorBar", 13} } }, {0, { {"RightVectorBar", 14} } }, + {0, { {"RightUpVectorBar", 16} } }, {0, { {"RightDownVectorBar", 18} } }, {0, { {"DownLeftVectorBar", 17} } }, {0, { {"DownRightVectorBar", 18} } }, + {0, { {"LeftUpVectorBar", 15} } }, {0, { {"LeftDownVectorBar", 17} } }, {0, { {"LeftTeeVector", 13} } }, {0, { {"RightTeeVector", 14} } }, + {0, { {"RightUpTeeVector", 16} } }, {0, { {"RightDownTeeVector", 18} } }, {0, { {"DownLeftTeeVector", 17} } }, {0, { {"DownRightTeeVector", 18} } }, + {0, { {"LeftUpTeeVector", 15} } }, {0, { {"LeftDownTeeVector", 17} } }, {0, { {"lHar", 4} } }, {0, { {"uHar", 4} } }, + {0, { {"rHar", 4} } }, {0, { {"dHar", 4} } }, {0, { {"luruhar", 7} } }, {0, { {"ldrdhar", 7} } }, + {0, { {"ruluhar", 7} } }, {0, { {"rdldhar", 7} } }, {0, { {"lharul", 6} } }, {0, { {"llhard", 6} } }, + {0, { {"rharul", 6} } }, {0, { {"lrhard", 6} } }, {0, { {"udhar", 5} } }, {0, { {"ReverseUpEquilibrium", 20} } }, + {0, { {"RoundImplies", 12} } }, {0, { {"erarr", 5} } }, {0, { {"simrarr", 7} } }, {0, { {"larrsim", 7} } }, + {0, { {"rarrsim", 7} } }, {0, { {"rarrap", 6} } }, {0, { {"ltlarr", 6} } }, {0, { {NULL, 0} } }, + {0, { {"gtrarr", 6} } }, {0, { {"subrarr", 7} } }, {0, { {NULL, 0} } }, {0, { {"suplarr", 7} } }, + {0, { {"lfisht", 6} } }, {0, { {"rfisht", 6} } }, {0, { {"ufisht", 6} } }, {0, { {"dfisht", 6} } }, +}; + +static const entity_stage3_row stage3_table_html5_02980[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"lopar", 5} } }, {0, { {"ropar", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lbrke", 5} } }, + {0, { {"rbrke", 5} } }, {0, { {"lbrkslu", 7} } }, {0, { {"rbrksld", 7} } }, {0, { {"lbrksld", 7} } }, + {0, { {"rbrkslu", 7} } }, {0, { {"langd", 5} } }, {0, { {"rangd", 5} } }, {0, { {"lparlt", 6} } }, + {0, { {"rpargt", 6} } }, {0, { {"gtlPar", 6} } }, {0, { {"ltrPar", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"vzigzag", 7} } }, {0, { {NULL, 0} } }, + {0, { {"vangrt", 6} } }, {0, { {"angrtvbd", 8} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"ange", 4} } }, {0, { {"range", 5} } }, {0, { {"dwangle", 7} } }, {0, { {"uwangle", 7} } }, + {0, { {"angmsdaa", 8} } }, {0, { {"angmsdab", 8} } }, {0, { {"angmsdac", 8} } }, {0, { {"angmsdad", 8} } }, + {0, { {"angmsdae", 8} } }, {0, { {"angmsdaf", 8} } }, {0, { {"angmsdag", 8} } }, {0, { {"angmsdah", 8} } }, + {0, { {"bemptyv", 7} } }, {0, { {"demptyv", 7} } }, {0, { {"cemptyv", 7} } }, {0, { {"raemptyv", 8} } }, + {0, { {"laemptyv", 8} } }, {0, { {"ohbar", 5} } }, {0, { {"omid", 4} } }, {0, { {"opar", 4} } }, + {0, { {NULL, 0} } }, {0, { {"operp", 5} } }, {0, { {NULL, 0} } }, {0, { {"olcross", 7} } }, + {0, { {"odsold", 6} } }, {0, { {NULL, 0} } }, {0, { {"olcir", 5} } }, {0, { {"ofcir", 5} } }, +}; + +static const entity_stage3_row stage3_table_html5_029C0[] = { + {0, { {"olt", 3} } }, {0, { {"ogt", 3} } }, {0, { {"cirscir", 7} } }, {0, { {"cirE", 4} } }, + {0, { {"solb", 4} } }, {0, { {"bsolb", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"boxbox", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"trisb", 5} } }, {0, { {"rtriltri", 8} } }, {1, { {(void *)multi_cp_html5_029CF, 0} } }, + {1, { {(void *)multi_cp_html5_029D0, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"iinfin", 6} } }, {0, { {"infintie", 8} } }, {0, { {"nvinfin", 7} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"eparsl", 6} } }, + {0, { {"smeparsl", 8} } }, {0, { {"eqvparsl", 8} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lozf", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"RuleDelayed", 11} } }, {0, { {NULL, 0} } }, {0, { {"dsol", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_02A00[] = { + {0, { {"xodot", 5} } }, {0, { {"bigoplus", 8} } }, {0, { {"bigotimes", 9} } }, {0, { {NULL, 0} } }, + {0, { {"biguplus", 8} } }, {0, { {NULL, 0} } }, {0, { {"bigsqcup", 8} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"iiiint", 6} } }, {0, { {"fpartint", 8} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"cirfnint", 8} } }, {0, { {"awint", 5} } }, {0, { {"rppolint", 8} } }, {0, { {"scpolint", 8} } }, + {0, { {"npolint", 7} } }, {0, { {"pointint", 8} } }, {0, { {"quatint", 7} } }, {0, { {"intlarhk", 8} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"pluscir", 7} } }, {0, { {"plusacir", 8} } }, + {0, { {"simplus", 7} } }, {0, { {"plusdu", 6} } }, {0, { {"plussim", 7} } }, {0, { {"plustwo", 7} } }, + {0, { {NULL, 0} } }, {0, { {"mcomma", 6} } }, {0, { {"minusdu", 7} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"loplus", 6} } }, {0, { {"roplus", 6} } }, {0, { {"Cross", 5} } }, + {0, { {"timesd", 6} } }, {0, { {"timesbar", 8} } }, {0, { {NULL, 0} } }, {0, { {"smashp", 6} } }, + {0, { {"lotimes", 7} } }, {0, { {"rotimes", 7} } }, {0, { {"otimesas", 8} } }, {0, { {"Otimes", 6} } }, + {0, { {"odiv", 4} } }, {0, { {"triplus", 7} } }, {0, { {"triminus", 8} } }, {0, { {"tritime", 7} } }, + {0, { {"iprod", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"amalg", 5} } }, +}; + +static const entity_stage3_row stage3_table_html5_02A40[] = { + {0, { {"capdot", 6} } }, {0, { {NULL, 0} } }, {0, { {"ncup", 4} } }, {0, { {"ncap", 4} } }, + {0, { {"capand", 6} } }, {0, { {"cupor", 5} } }, {0, { {"cupcap", 6} } }, {0, { {"capcup", 6} } }, + {0, { {"cupbrcap", 8} } }, {0, { {"capbrcup", 8} } }, {0, { {"cupcup", 6} } }, {0, { {"capcap", 6} } }, + {0, { {"ccups", 5} } }, {0, { {"ccaps", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"ccupssm", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"And", 3} } }, + {0, { {"Or", 2} } }, {0, { {"andand", 6} } }, {0, { {"oror", 4} } }, {0, { {"orslope", 7} } }, + {0, { {"andslope", 8} } }, {0, { {NULL, 0} } }, {0, { {"andv", 4} } }, {0, { {"orv", 3} } }, + {0, { {"andd", 4} } }, {0, { {"ord", 3} } }, {0, { {NULL, 0} } }, {0, { {"wedbar", 6} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"sdote", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"simdot", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {1, { {(void *)multi_cp_html5_02A6D, 0} } }, {0, { {"easter", 6} } }, {0, { {"apacir", 6} } }, + {1, { {(void *)multi_cp_html5_02A70, 0} } }, {0, { {"eplus", 5} } }, {0, { {"pluse", 5} } }, {0, { {"Esim", 4} } }, + {0, { {"Colone", 6} } }, {0, { {"Equal", 5} } }, {0, { {NULL, 0} } }, {0, { {"ddotseq", 7} } }, + {0, { {"equivDD", 7} } }, {0, { {"ltcir", 5} } }, {0, { {"gtcir", 5} } }, {0, { {"ltquest", 7} } }, + {0, { {"gtquest", 7} } }, {1, { {(void *)multi_cp_html5_02A7D, 0} } }, {1, { {(void *)multi_cp_html5_02A7E, 0} } }, {0, { {"lesdot", 6} } }, +}; + +static const entity_stage3_row stage3_table_html5_02A80[] = { + {0, { {"gesdot", 6} } }, {0, { {"lesdoto", 7} } }, {0, { {"gesdoto", 7} } }, {0, { {"lesdotor", 8} } }, + {0, { {"gesdotol", 8} } }, {0, { {"lap", 3} } }, {0, { {"gap", 3} } }, {0, { {"lne", 3} } }, + {0, { {"gne", 3} } }, {0, { {"lnap", 4} } }, {0, { {"gnap", 4} } }, {0, { {"lesseqqgtr", 10} } }, + {0, { {"gEl", 3} } }, {0, { {"lsime", 5} } }, {0, { {"gsime", 5} } }, {0, { {"lsimg", 5} } }, + {0, { {"gsiml", 5} } }, {0, { {"lgE", 3} } }, {0, { {"glE", 3} } }, {0, { {"lesges", 6} } }, + {0, { {"gesles", 6} } }, {0, { {"els", 3} } }, {0, { {"egs", 3} } }, {0, { {"elsdot", 6} } }, + {0, { {"egsdot", 6} } }, {0, { {"el", 2} } }, {0, { {"eg", 2} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"siml", 4} } }, {0, { {"simg", 4} } }, {0, { {"simlE", 5} } }, + {0, { {"simgE", 5} } }, {1, { {(void *)multi_cp_html5_02AA1, 0} } }, {1, { {(void *)multi_cp_html5_02AA2, 0} } }, {0, { {NULL, 0} } }, + {0, { {"glj", 3} } }, {0, { {"gla", 3} } }, {0, { {"ltcc", 4} } }, {0, { {"gtcc", 4} } }, + {0, { {"lescc", 5} } }, {0, { {"gescc", 5} } }, {0, { {"smt", 3} } }, {0, { {"lat", 3} } }, + {1, { {(void *)multi_cp_html5_02AAC, 0} } }, {1, { {(void *)multi_cp_html5_02AAD, 0} } }, {0, { {"bumpE", 5} } }, {1, { {(void *)multi_cp_html5_02AAF, 0} } }, + {1, { {(void *)multi_cp_html5_02AB0, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"prE", 3} } }, + {0, { {"scE", 3} } }, {0, { {"precneqq", 8} } }, {0, { {"scnE", 4} } }, {0, { {"precapprox", 10} } }, + {0, { {"succapprox", 10} } }, {0, { {"precnapprox", 11} } }, {0, { {"succnapprox", 11} } }, {0, { {"Pr", 2} } }, + {0, { {"Sc", 2} } }, {0, { {"subdot", 6} } }, {0, { {"supdot", 6} } }, {0, { {"subplus", 7} } }, +}; + +static const entity_stage3_row stage3_table_html5_02AC0[] = { + {0, { {"supplus", 7} } }, {0, { {"submult", 7} } }, {0, { {"supmult", 7} } }, {0, { {"subedot", 7} } }, + {0, { {"supedot", 7} } }, {1, { {(void *)multi_cp_html5_02AC5, 0} } }, {1, { {(void *)multi_cp_html5_02AC6, 0} } }, {0, { {"subsim", 6} } }, + {0, { {"supsim", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {1, { {(void *)multi_cp_html5_02ACB, 0} } }, + {1, { {(void *)multi_cp_html5_02ACC, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"csub", 4} } }, + {0, { {"csup", 4} } }, {0, { {"csube", 5} } }, {0, { {"csupe", 5} } }, {0, { {"subsup", 6} } }, + {0, { {"supsub", 6} } }, {0, { {"subsub", 6} } }, {0, { {"supsup", 6} } }, {0, { {"suphsub", 7} } }, + {0, { {"supdsub", 7} } }, {0, { {"forkv", 5} } }, {0, { {"topfork", 7} } }, {0, { {"mlcp", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Dashv", 5} } }, {0, { {NULL, 0} } }, {0, { {"Vdashl", 6} } }, {0, { {"Barv", 4} } }, + {0, { {"vBar", 4} } }, {0, { {"vBarv", 5} } }, {0, { {NULL, 0} } }, {0, { {"Vbar", 4} } }, + {0, { {"Not", 3} } }, {0, { {"bNot", 4} } }, {0, { {"rnmid", 5} } }, {0, { {"cirmid", 6} } }, + {0, { {"midcir", 6} } }, {0, { {"topcir", 6} } }, {0, { {"nhpar", 5} } }, {0, { {"parsim", 6} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {1, { {(void *)multi_cp_html5_02AFD, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_0FB00[] = { + {0, { {"fflig", 5} } }, {0, { {"filig", 5} } }, {0, { {"fllig", 5} } }, {0, { {"ffilig", 6} } }, + {0, { {"ffllig", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_1D480[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Ascr", 4} } }, {0, { {NULL, 0} } }, {0, { {"Cscr", 4} } }, {0, { {"Dscr", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"Gscr", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"Jscr", 4} } }, {0, { {"Kscr", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"Nscr", 4} } }, {0, { {"Oscr", 4} } }, {0, { {"Pscr", 4} } }, + {0, { {"Qscr", 4} } }, {0, { {NULL, 0} } }, {0, { {"Sscr", 4} } }, {0, { {"Tscr", 4} } }, + {0, { {"Uscr", 4} } }, {0, { {"Vscr", 4} } }, {0, { {"Wscr", 4} } }, {0, { {"Xscr", 4} } }, + {0, { {"Yscr", 4} } }, {0, { {"Zscr", 4} } }, {0, { {"ascr", 4} } }, {0, { {"bscr", 4} } }, + {0, { {"cscr", 4} } }, {0, { {"dscr", 4} } }, {0, { {NULL, 0} } }, {0, { {"fscr", 4} } }, + {0, { {NULL, 0} } }, {0, { {"hscr", 4} } }, {0, { {"iscr", 4} } }, {0, { {"jscr", 4} } }, +}; + +static const entity_stage3_row stage3_table_html5_1D4C0[] = { + {0, { {"kscr", 4} } }, {0, { {"lscr", 4} } }, {0, { {"mscr", 4} } }, {0, { {"nscr", 4} } }, + {0, { {NULL, 0} } }, {0, { {"pscr", 4} } }, {0, { {"qscr", 4} } }, {0, { {"rscr", 4} } }, + {0, { {"sscr", 4} } }, {0, { {"tscr", 4} } }, {0, { {"uscr", 4} } }, {0, { {"vscr", 4} } }, + {0, { {"wscr", 4} } }, {0, { {"xscr", 4} } }, {0, { {"yscr", 4} } }, {0, { {"zscr", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_1D500[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Afr", 3} } }, {0, { {"Bfr", 3} } }, {0, { {NULL, 0} } }, {0, { {"Dfr", 3} } }, + {0, { {"Efr", 3} } }, {0, { {"Ffr", 3} } }, {0, { {"Gfr", 3} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"Jfr", 3} } }, {0, { {"Kfr", 3} } }, {0, { {"Lfr", 3} } }, + {0, { {"Mfr", 3} } }, {0, { {"Nfr", 3} } }, {0, { {"Ofr", 3} } }, {0, { {"Pfr", 3} } }, + {0, { {"Qfr", 3} } }, {0, { {NULL, 0} } }, {0, { {"Sfr", 3} } }, {0, { {"Tfr", 3} } }, + {0, { {"Ufr", 3} } }, {0, { {"Vfr", 3} } }, {0, { {"Wfr", 3} } }, {0, { {"Xfr", 3} } }, + {0, { {"Yfr", 3} } }, {0, { {NULL, 0} } }, {0, { {"afr", 3} } }, {0, { {"bfr", 3} } }, + {0, { {"cfr", 3} } }, {0, { {"dfr", 3} } }, {0, { {"efr", 3} } }, {0, { {"ffr", 3} } }, + {0, { {"gfr", 3} } }, {0, { {"hfr", 3} } }, {0, { {"ifr", 3} } }, {0, { {"jfr", 3} } }, + {0, { {"kfr", 3} } }, {0, { {"lfr", 3} } }, {0, { {"mfr", 3} } }, {0, { {"nfr", 3} } }, + {0, { {"ofr", 3} } }, {0, { {"pfr", 3} } }, {0, { {"qfr", 3} } }, {0, { {"rfr", 3} } }, + {0, { {"sfr", 3} } }, {0, { {"tfr", 3} } }, {0, { {"ufr", 3} } }, {0, { {"vfr", 3} } }, + {0, { {"wfr", 3} } }, {0, { {"xfr", 3} } }, {0, { {"yfr", 3} } }, {0, { {"zfr", 3} } }, + {0, { {"Aopf", 4} } }, {0, { {"Bopf", 4} } }, {0, { {NULL, 0} } }, {0, { {"Dopf", 4} } }, + {0, { {"Eopf", 4} } }, {0, { {"Fopf", 4} } }, {0, { {"Gopf", 4} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html5_1D540[] = { + {0, { {"Iopf", 4} } }, {0, { {"Jopf", 4} } }, {0, { {"Kopf", 4} } }, {0, { {"Lopf", 4} } }, + {0, { {"Mopf", 4} } }, {0, { {NULL, 0} } }, {0, { {"Oopf", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"Sopf", 4} } }, {0, { {"Topf", 4} } }, + {0, { {"Uopf", 4} } }, {0, { {"Vopf", 4} } }, {0, { {"Wopf", 4} } }, {0, { {"Xopf", 4} } }, + {0, { {"Yopf", 4} } }, {0, { {NULL, 0} } }, {0, { {"aopf", 4} } }, {0, { {"bopf", 4} } }, + {0, { {"copf", 4} } }, {0, { {"dopf", 4} } }, {0, { {"eopf", 4} } }, {0, { {"fopf", 4} } }, + {0, { {"gopf", 4} } }, {0, { {"hopf", 4} } }, {0, { {"iopf", 4} } }, {0, { {"jopf", 4} } }, + {0, { {"kopf", 4} } }, {0, { {"lopf", 4} } }, {0, { {"mopf", 4} } }, {0, { {"nopf", 4} } }, + {0, { {"oopf", 4} } }, {0, { {"popf", 4} } }, {0, { {"qopf", 4} } }, {0, { {"ropf", 4} } }, + {0, { {"sopf", 4} } }, {0, { {"topf", 4} } }, {0, { {"uopf", 4} } }, {0, { {"vopf", 4} } }, + {0, { {"wopf", 4} } }, {0, { {"xopf", 4} } }, {0, { {"yopf", 4} } }, {0, { {"zopf", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +/* end of stage 3 Tables for HTML5 }}} */ + +/* {{{ Stage 2 Tables for HTML5 */ + +static const entity_stage2_row empty_stage2_table[] = { + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, +}; +static const entity_stage2_row stage2_table_html5_00000[] = { + stage3_table_html5_00000, stage3_table_html5_00040, stage3_table_html5_00080, stage3_table_html5_000C0, + stage3_table_html5_00100, stage3_table_html5_00140, stage3_table_html5_00180, stage3_table_html5_001C0, + stage3_table_html5_00200, empty_stage3_table, empty_stage3_table, stage3_table_html5_002C0, + stage3_table_html5_00300, empty_stage3_table, stage3_table_html5_00380, stage3_table_html5_003C0, + stage3_table_html5_00400, stage3_table_html5_00440, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, +}; + +static const entity_stage2_row stage2_table_html5_02000[] = { + stage3_table_html5_02000, stage3_table_html5_02040, stage3_table_html5_02080, stage3_table_html5_020C0, + stage3_table_html5_02100, stage3_table_html5_02140, stage3_table_html5_02180, stage3_table_html5_021C0, + stage3_table_html5_02200, stage3_table_html5_02240, stage3_table_html5_02280, stage3_table_html5_022C0, + stage3_table_html5_02300, stage3_table_html5_02340, stage3_table_html5_02380, stage3_table_html5_023C0, + stage3_table_html5_02400, empty_stage3_table, empty_stage3_table, stage3_table_html5_024C0, + stage3_table_html5_02500, stage3_table_html5_02540, stage3_table_html5_02580, stage3_table_html5_025C0, + stage3_table_html5_02600, stage3_table_html5_02640, empty_stage3_table, empty_stage3_table, + stage3_table_html5_02700, stage3_table_html5_02740, empty_stage3_table, stage3_table_html5_027C0, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + stage3_table_html5_02900, stage3_table_html5_02940, stage3_table_html5_02980, stage3_table_html5_029C0, + stage3_table_html5_02A00, stage3_table_html5_02A40, stage3_table_html5_02A80, stage3_table_html5_02AC0, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, +}; + +static const entity_stage2_row stage2_table_html5_0F000[] = { + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + stage3_table_html5_0FB00, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, +}; + +static const entity_stage2_row stage2_table_html5_1D000[] = { + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, stage3_table_html5_1D480, stage3_table_html5_1D4C0, + stage3_table_html5_1D500, stage3_table_html5_1D540, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, +}; + +/* end of stage 2 tables for HTML5 }}} */ + +static const entity_stage1_row entity_ms_table_html5[] = { + stage2_table_html5_00000, + empty_stage2_table, + stage2_table_html5_02000, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + stage2_table_html5_0F000, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + stage2_table_html5_1D000, +}; + +/* end of HTML5 multi-stage table for codepoint -> entity }}} */ + +/* {{{ HTML5 hash table for entity -> codepoint */ + +typedef struct { + const char *entity; + unsigned short entity_len; + unsigned int codepoint1; + unsigned int codepoint2; +} entity_cp_map; + +typedef const entity_cp_map *entity_ht_bucket; + +typedef struct { + unsigned num_elems; /* power of 2 */ + const entity_ht_bucket *buckets; /* .num_elems elements */ +} entity_ht; + +static const entity_cp_map ht_bucket_empty[] = { {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_000[] = { {"realpart", 8, 0x0211C, 0}, {"varr", 4, 0x02195, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_001[] = { {"angrt", 5, 0x0221F, 0}, {"iogon", 5, 0x0012F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_003[] = { {"lessdot", 7, 0x022D6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_005[] = { {"simrarr", 7, 0x02972, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_007[] = { {"Zscr", 4, 0x1D4B5, 0}, {"midast", 6, 0x0002A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_00D[] = { {"copf", 4, 0x1D554, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_00F[] = { {"female", 6, 0x02640, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_017[] = { {"NegativeThickSpace", 18, 0x0200B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_020[] = { {"copy", 4, 0x000A9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_022[] = { {"angst", 5, 0x000C5, 0}, {"searr", 5, 0x02198, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_024[] = { {"sqcups", 6, 0x02294, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_027[] = { {"Acirc", 5, 0x000C2, 0}, {"gtdot", 5, 0x022D7, 0}, {"varpi", 5, 0x003D6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_028[] = { {"UpTee", 5, 0x022A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_029[] = { {"TildeTilde", 10, 0x02248, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_02A[] = { {"mfr", 3, 0x1D52A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_02B[] = { {"RightVectorBar", 14, 0x02953, 0}, {"gesdot", 6, 0x02A80, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_02C[] = { {"Uarrocir", 8, 0x02949, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_02E[] = { {"RightTriangleBar", 16, 0x029D0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_030[] = { {"Ocy", 3, 0x0041E, 0}, {"int", 3, 0x0222B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_034[] = { {"preccurlyeq", 11, 0x0227C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_038[] = { {"sccue", 5, 0x0227D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_040[] = { {"DoubleContourIntegral", 21, 0x0222F, 0}, {"nexist", 6, 0x02204, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_047[] = { {"acirc", 5, 0x000E2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_04C[] = { {"setmn", 5, 0x02216, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_04E[] = { {"Dopf", 4, 0x1D53B, 0}, {"LeftTee", 7, 0x022A3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_051[] = { {"SquareSuperset", 14, 0x02290, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_059[] = { {"udhar", 5, 0x0296E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_05D[] = { {"Equal", 5, 0x02A75, 0}, {"pscr", 4, 0x1D4C5, 0}, {"xvee", 4, 0x022C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_05F[] = { {"approx", 6, 0x02248, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_060[] = { {"HARDcy", 6, 0x0042A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_061[] = { {"nGg", 3, 0x022D9, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_063[] = { {"yopf", 4, 0x1D56A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_064[] = { {"prcue", 5, 0x0227C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_065[] = { {"loarr", 5, 0x021FD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_069[] = { {"mho", 3, 0x02127, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_06A[] = { {"otimesas", 8, 0x02A36, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_06D[] = { {"capcap", 6, 0x02A4B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_06E[] = { {"eplus", 5, 0x02A71, 0}, {"nGt", 3, 0x0226B, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_06F[] = { {"Bumpeq", 6, 0x0224E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_071[] = { {"submult", 7, 0x02AC1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_073[] = { {"subplus", 7, 0x02ABF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_074[] = { {"auml", 4, 0x000E4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_07A[] = { {"RightDoubleBracket", 18, 0x027E7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_07B[] = { {"varkappa", 8, 0x003F0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_07C[] = { {"plusdo", 6, 0x02214, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_07F[] = { {"mid", 3, 0x02223, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_082[] = { {"plusdu", 6, 0x02A25, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_084[] = { {"notniva", 7, 0x0220C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_085[] = { {"notnivb", 7, 0x022FE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_086[] = { {"notnivc", 7, 0x022FD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_088[] = { {"varepsilon", 10, 0x003F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_089[] = { {"nspar", 5, 0x02226, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_08C[] = { {"Ofr", 3, 0x1D512, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_08E[] = { {"Omega", 5, 0x003A9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_090[] = { {"equals", 6, 0x0003D, 0}, {"harrcir", 7, 0x02948, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_094[] = { {"Succeeds", 8, 0x0227B, 0}, {"cupdot", 6, 0x0228D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_097[] = { {"lsqb", 4, 0x0005B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_09E[] = { {"Qscr", 4, 0x1D4AC, 0}, {"urcorn", 6, 0x0231D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0A4[] = { {"Zopf", 4, 0x02124, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0A6[] = { {"triangleleft", 12, 0x025C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0AB[] = { {"supdsub", 7, 0x02AD8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0AC[] = { {"chcy", 4, 0x00447, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0AD[] = { {"sqsupset", 8, 0x02290, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0AE[] = { {"omega", 5, 0x003C9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0AF[] = { {"rthree", 6, 0x022CC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0B0[] = { {"THORN", 5, 0x000DE, 0}, {"clubsuit", 8, 0x02663, 0}, {"filig", 5, 0x0FB01, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0B2[] = { {"ocir", 4, 0x0229A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0B8[] = { {"ShortDownArrow", 14, 0x02193, 0}, {"atilde", 6, 0x000E3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0B9[] = { {"DownLeftTeeVector", 17, 0x0295E, 0}, {"LeftTeeArrow", 12, 0x021A4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0BA[] = { {"GreaterFullEqual", 16, 0x02267, 0}, {"emsp", 4, 0x02003, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0C0[] = { {"lozf", 4, 0x029EB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0C4[] = { {"ThinSpace", 9, 0x02009, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0CE[] = { {"fnof", 4, 0x00192, 0}, {"multimap", 8, 0x022B8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0D1[] = { {"Zacute", 6, 0x00179, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0D2[] = { {"mdash", 5, 0x02014, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0D3[] = { {"minusb", 6, 0x0229F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0D5[] = { {"minusd", 6, 0x02238, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0DF[] = { {"varsigma", 8, 0x003C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0E5[] = { {"ntilde", 6, 0x000F1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0E6[] = { {"Lambda", 6, 0x0039B, 0}, {"integers", 8, 0x02124, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0E8[] = { {"gesles", 6, 0x02A94, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0EC[] = { {"NotSubset", 9, 0x02282, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0EF[] = { {"NotLeftTriangleEqual", 20, 0x022EC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0F3[] = { {"LessLess", 8, 0x02AA1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0F4[] = { {"gscr", 4, 0x0210A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0FA[] = { {"popf", 4, 0x1D561, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0FB[] = { {"Agrave", 6, 0x000C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0FD[] = { {"nvinfin", 7, 0x029DE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_0FE[] = { {"gacute", 6, 0x001F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_100[] = { {"diam", 4, 0x022C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_101[] = { {"nesim", 5, 0x02242, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_103[] = { {"YIcy", 4, 0x00407, 0}, {"bcy", 3, 0x00431, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_105[] = { {"Exists", 6, 0x02203, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_106[] = { {"vert", 4, 0x0007C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_109[] = { {"ropar", 5, 0x02986, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_10A[] = { {"topfork", 7, 0x02ADA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_10B[] = { {"nLl", 3, 0x022D8, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_10D[] = { {"notin", 5, 0x02209, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_10E[] = { {"SucceedsSlantEqual", 18, 0x0227D, 0}, {"toea", 4, 0x02928, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_10F[] = { {"ImaginaryI", 10, 0x02148, 0}, {"srarr", 5, 0x02192, 0}, {"ulcorner", 8, 0x0231C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_110[] = { {"LeftArrowBar", 12, 0x021E4, 0}, {"ldsh", 4, 0x021B2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_111[] = { {"DownBreve", 9, 0x00311, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_113[] = { {"nLt", 3, 0x0226A, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_116[] = { {"vltri", 5, 0x022B2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_11B[] = { {"VDash", 5, 0x022AB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_11C[] = { {"Dstrok", 6, 0x00110, 0}, {"Intersection", 12, 0x022C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_11E[] = { {"lrhar", 5, 0x021CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_121[] = { {"RightTee", 8, 0x022A2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_124[] = { {"RightArrowLeftArrow", 19, 0x021C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_129[] = { {"Ccirc", 5, 0x00108, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_12A[] = { {"ntrianglelefteq", 15, 0x022EC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_12C[] = { {"leftharpoonup", 13, 0x021BC, 0}, {"scap", 4, 0x02AB8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_12E[] = { {"darr", 4, 0x02193, 0}, {"qfr", 3, 0x1D52E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_12F[] = { {"cdot", 4, 0x0010B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_130[] = { {"supseteqq", 9, 0x02AC6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_134[] = { {"Scy", 3, 0x00421, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_135[] = { {"Hscr", 4, 0x0210B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_137[] = { {"LowerRightArrow", 15, 0x02198, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_13A[] = { {"divide", 6, 0x000F7, 0}, {"tcedil", 6, 0x00163, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_13B[] = { {"LeftArrow", 9, 0x02190, 0}, {"Qopf", 4, 0x0211A, 0}, {"vDash", 5, 0x022A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_145[] = { {"dash", 4, 0x02010, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_147[] = { {"oror", 4, 0x02A56, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_149[] = { {"ccirc", 5, 0x00109, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_14B[] = { {"LongLeftArrow", 13, 0x027F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_14C[] = { {"straightphi", 11, 0x003D5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_14E[] = { {"xlarr", 5, 0x027F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_14F[] = { {"DJcy", 4, 0x00402, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_158[] = { {"nbsp", 4, 0x000A0, 0}, {"succcurlyeq", 11, 0x0227D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_159[] = { {"njcy", 4, 0x0045A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_15B[] = { {"Leftarrow", 9, 0x021D0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_15E[] = { {"dtrif", 5, 0x025BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_15F[] = { {"bfr", 3, 0x1D51F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_161[] = { {"GreaterTilde", 12, 0x02273, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_164[] = { {"hamilt", 6, 0x0210B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_165[] = { {"Dcy", 3, 0x00414, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_168[] = { {"LeftUpVector", 12, 0x021BF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_16A[] = { {"bigoplus", 8, 0x02A01, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_170[] = { {"nwarhk", 6, 0x02923, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_173[] = { {"diams", 5, 0x02666, 0}, {"suphsol", 7, 0x027C9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_17A[] = { {"boxminus", 8, 0x0229F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_17B[] = { {"leftarrow", 9, 0x02190, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_17C[] = { {"andd", 4, 0x02A5C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_17F[] = { {"NonBreakingSpace", 16, 0x000A0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_181[] = { {"xutri", 5, 0x025B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_189[] = { {"Longleftrightarrow", 18, 0x027FA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_18B[] = { {"Longleftarrow", 13, 0x027F8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_18C[] = { {"gtrapprox", 9, 0x02A86, 0}, {"phmmat", 6, 0x02133, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_18E[] = { {"andv", 4, 0x02A5A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_18F[] = { {"equiv", 5, 0x02261, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_190[] = { {"Sfr", 3, 0x1D516, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_191[] = { {"gopf", 4, 0x1D558, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_193[] = { {"sqsub", 5, 0x0228F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_195[] = { {"approxeq", 8, 0x0224A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_19A[] = { {"Del", 3, 0x02207, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_19C[] = { {"nrightarrow", 11, 0x0219B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_19F[] = { {"SquareUnion", 11, 0x02294, 0}, {"strns", 5, 0x000AF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1A0[] = { {"Itilde", 6, 0x00128, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1A1[] = { {"sqsup", 5, 0x02290, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1A2[] = { {"Ouml", 4, 0x000D6, 0}, {"PrecedesTilde", 13, 0x0227E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1A3[] = { {"AMP", 3, 0x00026, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1A4[] = { {"plusmn", 6, 0x000B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1A5[] = { {"xcup", 4, 0x022C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1A8[] = { {"radic", 5, 0x0221A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1AB[] = { {"longleftarrow", 13, 0x027F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1AC[] = { {"lrcorner", 8, 0x0231F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1AD[] = { {"notni", 5, 0x0220C, 0}, {"updownarrow", 11, 0x02195, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1AE[] = { {"szlig", 5, 0x000DF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1AF[] = { {"ugrave", 6, 0x000F9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1B0[] = { {"imof", 4, 0x022B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1B2[] = { {"csub", 4, 0x02ACF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1B5[] = { {"gsim", 4, 0x02273, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1B9[] = { {"leftleftarrows", 14, 0x021C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1BD[] = { {"backcong", 8, 0x0224C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1BE[] = { {"clubs", 5, 0x02663, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1C0[] = { {"csup", 4, 0x02AD0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1C1[] = { {"Dfr", 3, 0x1D507, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1C4[] = { {"profline", 8, 0x02312, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1C6[] = { {"Zdot", 4, 0x0017B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1C9[] = { {"ClockwiseContourIntegral", 24, 0x02232, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1CA[] = { {"roplus", 6, 0x02A2E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1CD[] = { {"Rang", 4, 0x027EB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1CE[] = { {"bcong", 5, 0x0224C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1D0[] = { {"tshcy", 5, 0x0045B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1D1[] = { {"eDot", 4, 0x02251, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1D2[] = { {"Hopf", 4, 0x0210D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1D4[] = { {"lpar", 4, 0x00028, 0}, {"odash", 5, 0x0229D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1D5[] = { {"capbrcup", 8, 0x02A49, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1D6[] = { {"ucy", 3, 0x00443, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1D8[] = { {"ofcir", 5, 0x029BF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1D9[] = { {"Breve", 5, 0x002D8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1DA[] = { {"barvee", 6, 0x022BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1DF[] = { {"backsim", 7, 0x0223D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1E0[] = { {"ange", 4, 0x029A4, 0}, {"half", 4, 0x000BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1E1[] = { {"tscr", 4, 0x1D4C9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1E5[] = { {"realine", 7, 0x0211B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1E6[] = { {"Oacute", 6, 0x000D3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1E7[] = { {"dfisht", 6, 0x0297F, 0}, {"swnwar", 6, 0x0292A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1E8[] = { {"tscy", 4, 0x00446, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1EB[] = { {"lsquor", 6, 0x0201A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1EF[] = { {"naturals", 8, 0x02115, 0}, {"utrif", 5, 0x025B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1F0[] = { {"DiacriticalTilde", 16, 0x002DC, 0}, {"RightUpVectorBar", 16, 0x02954, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1F2[] = { {"rHar", 4, 0x02964, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1F4[] = { {"curlyeqprec", 11, 0x022DE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1F8[] = { {"dtri", 4, 0x025BF, 0}, {"euml", 4, 0x000EB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1F9[] = { {"breve", 5, 0x002D8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1FA[] = { {"Barwed", 6, 0x02306, 0}, {"nvlArr", 6, 0x02902, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1FC[] = { {"dcaron", 6, 0x0010F, 0}, {"natural", 7, 0x0266E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1FE[] = { {"nsupseteqq", 10, 0x02AC6, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_1FF[] = { {"nedot", 5, 0x02250, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_205[] = { {"bigtriangledown", 15, 0x025BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_207[] = { {"fcy", 3, 0x00444, 0}, {"marker", 6, 0x025AE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_20E[] = { {"Union", 5, 0x022C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_212[] = { {"varpropto", 9, 0x0221D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_213[] = { {"CloseCurlyDoubleQuote", 21, 0x0201D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_219[] = { {"DoubleLongRightArrow", 20, 0x027F9, 0}, {"GreaterGreater", 14, 0x02AA2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_21D[] = { {"Umacr", 5, 0x0016A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_220[] = { {"Colon", 5, 0x02237, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_222[] = { {"Hat", 3, 0x0005E, 0}, {"Uscr", 4, 0x1D4B0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_227[] = { {"SHCHcy", 6, 0x00429, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_229[] = { {"nLeftarrow", 10, 0x021CD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_22B[] = { {"Ecirc", 5, 0x000CA, 0}, {"Jukcy", 5, 0x00404, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_22C[] = { {"nbumpe", 6, 0x0224F, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_22D[] = { {"NotLess", 7, 0x0226E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_22F[] = { {"gtlPar", 6, 0x02995, 0}, {"suphsub", 7, 0x02AD7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_230[] = { {"gtreqqless", 10, 0x02A8C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_232[] = { {"ufr", 3, 0x1D532, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_234[] = { {"cirscir", 7, 0x029C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_239[] = { {"LeftDownTeeVector", 17, 0x02961, 0}, {"duhar", 5, 0x0296F, 0}, {"nrtrie", 6, 0x022ED, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_23C[] = { {"llhard", 6, 0x0296B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_23D[] = { {"umacr", 5, 0x0016B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_23E[] = { {"lates", 5, 0x02AAD, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_240[] = { {"colon", 5, 0x0003A, 0}, {"iacute", 6, 0x000ED, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_241[] = { {"NotPrecedes", 11, 0x02280, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_242[] = { {"cirfnint", 8, 0x02A10, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_246[] = { {"barwedge", 8, 0x02305, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_249[] = { {"nleftarrow", 10, 0x0219A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_24A[] = { {"Ubrcy", 5, 0x0040E, 0}, {"leftthreetimes", 14, 0x022CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_24B[] = { {"andand", 6, 0x02A55, 0}, {"ecirc", 5, 0x000EA, 0}, {"jukcy", 5, 0x00454, 0}, {"quatint", 7, 0x02A16, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_24D[] = { {"lharul", 6, 0x0296A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_251[] = { {"smtes", 5, 0x02AAC, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_252[] = { {"UnionPlus", 9, 0x0228E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_257[] = { {"NotLeftTriangle", 15, 0x022EA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_25A[] = { {"bne", 3, 0x0003D, 0x020E5}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_25B[] = { {"gtrsim", 6, 0x02273, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_25C[] = { {"Rarr", 4, 0x021A0, 0}, {"ldquor", 6, 0x0201E, 0}, {"phiv", 4, 0x003D5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_25D[] = { {"because", 7, 0x02235, 0}, {"gEl", 3, 0x02A8C, 0}, {"setminus", 8, 0x02216, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_263[] = { {"ffr", 3, 0x1D523, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_26A[] = { {"ubrcy", 5, 0x0045E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_26B[] = { {"elinters", 8, 0x023E7, 0}, {"plusb", 5, 0x0229E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_26E[] = { {"pluse", 5, 0x02A72, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_274[] = { {"CapitalDifferentialD", 20, 0x02145, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_277[] = { {"daleth", 6, 0x02138, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_278[] = { {"kscr", 4, 0x1D4C0, 0}, {"ogon", 4, 0x002DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_27C[] = { {"SHcy", 4, 0x00428, 0}, {"equest", 6, 0x0225F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_27E[] = { {"rbarr", 5, 0x0290D, 0}, {"topf", 4, 0x1D565, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_283[] = { {"tritime", 7, 0x02A3B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_28A[] = { {"bot", 3, 0x022A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_294[] = { {"Wfr", 3, 0x1D51A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_297[] = { {"HumpEqual", 9, 0x0224F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_298[] = { {"rightleftharpoons", 17, 0x021CC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_29D[] = { {"frasl", 5, 0x02044, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_29F[] = { {"UnderBracket", 12, 0x023B5, 0}, {"ovbar", 5, 0x0233D, 0}, {"upharpoonright", 14, 0x021BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2A0[] = { {"euro", 4, 0x020AC, 0}, {"nhArr", 5, 0x021CE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2A9[] = { {"NotSupersetEqual", 16, 0x02289, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2AE[] = { {"cularr", 6, 0x021B6, 0}, {"scnE", 4, 0x02AB6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2B1[] = { {"napid", 5, 0x0224B, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2B2[] = { {"harr", 4, 0x02194, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2B3[] = { {"gdot", 4, 0x00121, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2B9[] = { {"Lscr", 4, 0x02112, 0}, {"zeta", 4, 0x003B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2BF[] = { {"ENG", 3, 0x0014A, 0}, {"Uopf", 4, 0x1D54C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2C4[] = { {"esdot", 5, 0x02250, 0}, {"scsim", 5, 0x0227F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2C5[] = { {"Hfr", 3, 0x0210C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2CE[] = { {"RightArrow", 10, 0x02192, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2CF[] = { {"Sqrt", 4, 0x0221A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2D3[] = { {"xodot", 5, 0x02A00, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2DA[] = { {"ycy", 3, 0x0044B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2DB[] = { {"hkswarow", 8, 0x02926, 0}, {"urtri", 5, 0x025F9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2DC[] = { {"roang", 5, 0x027ED, 0}, {"tosa", 4, 0x02929, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2E3[] = { {"CircleMinus", 11, 0x02296, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2E4[] = { {"Lcaron", 6, 0x0013D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2EB[] = { {"ShortLeftArrow", 14, 0x02190, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2EC[] = { {"Dot", 3, 0x000A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2EE[] = { {"Rightarrow", 10, 0x021D2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2F0[] = { {"prsim", 5, 0x0227E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2F2[] = { {"notinE", 6, 0x022F9, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_2F8[] = { {"becaus", 6, 0x02235, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_300[] = { {"NotEqualTilde", 13, 0x02242, 0x00338}, {"nparallel", 9, 0x02226, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_301[] = { {"capcup", 6, 0x02A47, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_304[] = { {"simeq", 5, 0x02243, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_305[] = { {"forall", 6, 0x02200, 0}, {"straightepsilon", 15, 0x003F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_308[] = { {"ruluhar", 7, 0x02968, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_30B[] = { {"jcy", 3, 0x00439, 0}, {"ltcc", 4, 0x02AA6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_30F[] = { {"bscr", 4, 0x1D4B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_311[] = { {"ExponentialE", 12, 0x02147, 0}, {"weierp", 6, 0x02118, 0}, {"yen", 3, 0x000A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_313[] = { {"blacksquare", 11, 0x025AA, 0}, {"uml", 3, 0x000A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_315[] = { {"backsimeq", 9, 0x022CD, 0}, {"kopf", 4, 0x1D55C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_319[] = { {"NotPrecedesEqual", 16, 0x02AAF, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_31A[] = { {"simgE", 5, 0x02AA0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_31B[] = { {"tridot", 6, 0x025EC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_326[] = { {"DoubleLongLeftArrow", 19, 0x027F8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_329[] = { {"models", 6, 0x022A7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_32A[] = { {"emptyv", 6, 0x02205, 0}, {"eqslantgtr", 10, 0x02A96, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_32D[] = { {"Gcirc", 5, 0x0011C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_330[] = { {"bernou", 6, 0x0212C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_331[] = { {"HumpDownHump", 12, 0x0224E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_336[] = { {"yfr", 3, 0x1D536, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_338[] = { {"blacktriangle", 13, 0x025B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_33B[] = { {"yacy", 4, 0x0044F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_33F[] = { {"lsime", 5, 0x02A8D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_340[] = { {"NotTildeEqual", 13, 0x02244, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_341[] = { {"lsimg", 5, 0x02A8F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_347[] = { {"ncap", 4, 0x02A43, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_34D[] = { {"DD", 2, 0x02145, 0}, {"gcirc", 5, 0x0011D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_350[] = { {"Cscr", 4, 0x1D49E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_356[] = { {"Lopf", 4, 0x1D543, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_358[] = { {"lBarr", 5, 0x0290E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_359[] = { {"Leftrightarrow", 14, 0x021D4, 0}, {"gtrdot", 6, 0x022D7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_35D[] = { {"NotSquareSubset", 15, 0x0228F, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_35F[] = { {"sqsubset", 8, 0x0228F, 0}, {"subsetneq", 9, 0x0228A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_361[] = { {"doublebarwedge", 14, 0x02306, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_363[] = { {"blacktriangleleft", 17, 0x025C2, 0}, {"hellip", 6, 0x02026, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_365[] = { {"xscr", 4, 0x1D4CD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_367[] = { {"LessFullEqual", 13, 0x02266, 0}, {"jfr", 3, 0x1D527, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_369[] = { {"GreaterSlantEqual", 17, 0x02A7E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_36A[] = { {"Uring", 5, 0x0016E, 0}, {"VeryThinSpace", 13, 0x0200A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_36B[] = { {"roarr", 5, 0x021FE, 0}, {"scaron", 6, 0x00161, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_36D[] = { {"Lcy", 3, 0x0041B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_36E[] = { {"RightDownVector", 15, 0x021C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_36F[] = { {"Sub", 3, 0x022D0, 0}, {"pitchfork", 9, 0x022D4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_372[] = { {"nvsim", 5, 0x0223C, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_374[] = { {"xrArr", 5, 0x027F9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_378[] = { {"CloseCurlyQuote", 15, 0x02019, 0}, {"uwangle", 7, 0x029A7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_37A[] = { {"Sum", 3, 0x02211, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_37C[] = { {"iuml", 4, 0x000EF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_37D[] = { {"Sup", 3, 0x022D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_37E[] = { {"planck", 6, 0x0210F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_37F[] = { {"Egrave", 6, 0x000C8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_380[] = { {"curlywedge", 10, 0x022CF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_382[] = { {"TildeFullEqual", 14, 0x02245, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_383[] = { {"searhk", 6, 0x02925, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_386[] = { {"ETH", 3, 0x000D0, 0}, {"napos", 5, 0x00149, 0}, {"upsi", 4, 0x003C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_387[] = { {"twoheadleftarrow", 16, 0x0219E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_38A[] = { {"Assign", 6, 0x02254, 0}, {"uring", 5, 0x0016F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_38D[] = { {"SquareIntersection", 18, 0x02293, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_38E[] = { {"lmidot", 6, 0x00140, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_391[] = { {"kcedil", 6, 0x00137, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_394[] = { {"curren", 6, 0x000A4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_397[] = { {"acute", 5, 0x000B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_398[] = { {"curlyeqsucc", 11, 0x022DF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_39C[] = { {"Omicron", 7, 0x0039F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_39F[] = { {"uarr", 4, 0x02191, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3A0[] = { {"Hstrok", 6, 0x00126, 0}, {"UnderBrace", 10, 0x023DF, 0}, {"tdot", 4, 0x020DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3A1[] = { {"qint", 4, 0x02A0C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3A4[] = { {"sfrown", 6, 0x02322, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3A5[] = { {"trpezium", 8, 0x023E2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3A6[] = { {"Yscr", 4, 0x1D4B4, 0}, {"cedil", 5, 0x000B8, 0}, {"planckh", 7, 0x0210E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3A7[] = { {"lang", 4, 0x027E8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3AC[] = { {"bopf", 4, 0x1D553, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3B2[] = { {"lbbrk", 5, 0x02772, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3B4[] = { {"khcy", 4, 0x00445, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3BF[] = { {"Epsilon", 7, 0x00395, 0}, {"simlE", 5, 0x02A9F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3C0[] = { {"GT", 2, 0x0003E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3C4[] = { {"nap", 3, 0x02249, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3C9[] = { {"Lfr", 3, 0x1D50F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3CD[] = { {"succapprox", 10, 0x02AB8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3D0[] = { {"bsim", 4, 0x0223D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3D3[] = { {"Gg", 2, 0x022D9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3D9[] = { {"angrtvb", 7, 0x022BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3DE[] = { {"xcirc", 5, 0x025EF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3E0[] = { {"Gt", 2, 0x0226B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3E1[] = { {"LeftRightVector", 15, 0x0294E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3E3[] = { {"circledast", 10, 0x0229B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3E4[] = { {"telrec", 6, 0x02315, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3E6[] = { {"SucceedsTilde", 13, 0x0227F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3E9[] = { {"nLtv", 4, 0x0226A, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3ED[] = { {"Copf", 4, 0x02102, 0}, {"napprox", 7, 0x02249, 0}, {"nsupseteq", 9, 0x02289, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3F1[] = { {"VerticalTilde", 13, 0x02240, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3F2[] = { {"parallel", 8, 0x02225, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3F7[] = { {"precnapprox", 11, 0x02AB9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3FC[] = { {"oscr", 4, 0x02134, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_3FE[] = { {"supsetneqq", 10, 0x02ACC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_402[] = { {"xopf", 4, 0x1D569, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_405[] = { {"mumap", 5, 0x022B8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_407[] = { {"varsupsetneqq", 13, 0x02ACC, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_409[] = { {"ReverseEquilibrium", 18, 0x021CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_40E[] = { {"Ubreve", 6, 0x0016C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_40F[] = { {"YUcy", 4, 0x0042E, 0}, {"ncy", 3, 0x0043D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_413[] = { {"ltimes", 6, 0x022C9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_41A[] = { {"UpperRightArrow", 15, 0x02197, 0}, {"nvap", 4, 0x0224D, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_41B[] = { {"Im", 2, 0x02111, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_421[] = { {"simne", 5, 0x02246, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_423[] = { {"ccups", 5, 0x02A4C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_424[] = { {"nlArr", 5, 0x021CD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_425[] = { {"rarrsim", 7, 0x02974, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_426[] = { {"Ncaron", 6, 0x00147, 0}, {"vsupnE", 6, 0x02ACC, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_429[] = { {"succeq", 6, 0x02AB0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_42C[] = { {"Gammad", 6, 0x003DC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_42F[] = { {"Icirc", 5, 0x000CE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_430[] = { {"backepsilon", 11, 0x003F6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_432[] = { {"ddarr", 5, 0x021CA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_436[] = { {"larr", 4, 0x02190, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_439[] = { {"divideontimes", 13, 0x022C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_43C[] = { {"succsim", 7, 0x0227F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_43D[] = { {"Pscr", 4, 0x1D4AB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_43E[] = { {"puncsp", 6, 0x02008, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_43F[] = { {"gtreqless", 9, 0x022DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_440[] = { {"intcal", 6, 0x022BA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_441[] = { {"nsime", 5, 0x02244, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_443[] = { {"Yopf", 4, 0x1D550, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_446[] = { {"angsph", 6, 0x02222, 0}, {"vsupne", 6, 0x0228B, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_447[] = { {"NotNestedLessLess", 17, 0x02AA1, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_44A[] = { {"PrecedesSlantEqual", 18, 0x0227C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_44F[] = { {"icirc", 5, 0x000EE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_450[] = { {"DownLeftVectorBar", 17, 0x02956, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_454[] = { {"Auml", 4, 0x000C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_457[] = { {"LJcy", 4, 0x00409, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_458[] = { {"sqsube", 6, 0x02291, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_45D[] = { {"nprec", 5, 0x02280, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_45F[] = { {"ngE", 3, 0x02267, 0x00338}, {"smile", 5, 0x02323, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_465[] = { {"LT", 2, 0x0003C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_466[] = { {"ldrdhar", 7, 0x02967, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_469[] = { {"utri", 4, 0x025B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_46A[] = { {"Sacute", 6, 0x0015A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_46B[] = { {"late", 4, 0x02AAD, 0}, {"nfr", 3, 0x1D52B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_46D[] = { {"NotNestedGreaterGreater", 23, 0x02AA2, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_46F[] = { {"nwarr", 5, 0x02196, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_470[] = { {"biguplus", 8, 0x02A04, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_471[] = { {"Pcy", 3, 0x0041F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_472[] = { {"bigtriangleup", 13, 0x025B3, 0}, {"rationals", 9, 0x0211A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_473[] = { {"congdot", 7, 0x02A6D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_475[] = { {"PlusMinus", 9, 0x000B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_479[] = { {"IOcy", 4, 0x00401, 0}, {"Scedil", 6, 0x0015E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_47C[] = { {"eqcirc", 6, 0x02256, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_47D[] = { {"Ll", 2, 0x022D8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_47F[] = { {"Cayleys", 7, 0x0212D, 0}, {"nge", 3, 0x02271, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_480[] = { {"NotGreater", 10, 0x0226F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_485[] = { {"Lt", 2, 0x0226A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_488[] = { {"rotimes", 7, 0x02A35, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_48C[] = { {"caps", 4, 0x02229, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_48E[] = { {"ngt", 3, 0x0226F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_48F[] = { {"Cross", 5, 0x02A2F, 0}, {"bumpeq", 6, 0x0224F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_490[] = { {"VerticalSeparator", 17, 0x02758, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_491[] = { {"plankv", 6, 0x0210F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_493[] = { {"fscr", 4, 0x1D4BB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_495[] = { {"bsol", 4, 0x0005C, 0}, {"sqsubseteq", 10, 0x02291, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_496[] = { {"boxH", 4, 0x02550, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_498[] = { {"rightarrowtail", 14, 0x021A3, 0}, {"ufisht", 6, 0x0297E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_499[] = { {"oopf", 4, 0x1D560, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_49F[] = { {"lobrk", 5, 0x027E6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4A2[] = { {"Acy", 3, 0x00410, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4A4[] = { {"NotSubsetEqual", 14, 0x02288, 0}, {"boxV", 4, 0x02551, 0}, {"dHar", 4, 0x02965, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4A6[] = { {"precnsim", 8, 0x022E8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4A7[] = { {"Mu", 2, 0x0039C, 0}, {"aelig", 5, 0x000E6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4AA[] = { {"gescc", 5, 0x02AA9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4AB[] = { {"origof", 6, 0x022B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4AE[] = { {"upsih", 5, 0x003D2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4AF[] = { {"cross", 5, 0x02717, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4B2[] = { {"LeftFloor", 9, 0x0230A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4B6[] = { {"boxh", 4, 0x02500, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4B8[] = { {"NotGreaterEqual", 15, 0x02271, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4BC[] = { {"profalar", 8, 0x0232E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4C0[] = { {"nsmid", 5, 0x02224, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4C2[] = { {"hbar", 4, 0x0210F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4C3[] = { {"udarr", 5, 0x021C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4C4[] = { {"boxv", 4, 0x02502, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4C5[] = { {"olarr", 5, 0x021BA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4C8[] = { {"Nu", 2, 0x0039D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4CB[] = { {"NotCongruent", 12, 0x02262, 0}, {"bkarow", 6, 0x0290D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4CD[] = { {"Pfr", 3, 0x1D513, 0}, {"forkv", 5, 0x02AD9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4CF[] = { {"nis", 3, 0x022FC, 0}, {"trianglerighteq", 15, 0x022B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4D0[] = { {"ngeq", 4, 0x02271, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4D2[] = { {"cudarrl", 7, 0x02938, 0}, {"nges", 4, 0x02A7E, 0x00338}, {"niv", 3, 0x0220B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4D3[] = { {"SubsetEqual", 11, 0x02286, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4D4[] = { {"Gscr", 4, 0x1D4A2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4D5[] = { {"complexes", 9, 0x02102, 0}, {"eDDot", 5, 0x02A77, 0}, {"nvge", 4, 0x02265, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4D8[] = { {"cudarrr", 7, 0x02935, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4DA[] = { {"Popf", 4, 0x02119, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4DE[] = { {"LongRightArrow", 14, 0x027F6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4DF[] = { {"supseteq", 8, 0x02287, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4E3[] = { {"dollar", 6, 0x00024, 0}, {"gnsim", 5, 0x022E7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4E4[] = { {"nvgt", 4, 0x0003E, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4E6[] = { {"Or", 2, 0x02A54, 0}, {"Vert", 4, 0x02016, 0}, {"lneqq", 5, 0x02268, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4E7[] = { {"nLeftrightarrow", 15, 0x021CE, 0}, {"nbump", 5, 0x0224E, 0x00338}, {"ntriangleright", 14, 0x022EB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4E8[] = { {"ecir", 4, 0x02256, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4E9[] = { {"npolint", 7, 0x02A14, 0}, {"plus", 4, 0x0002B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4ED[] = { {"centerdot", 9, 0x000B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4F1[] = { {"zacute", 6, 0x0017A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4F7[] = { {"odiv", 4, 0x02A38, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4F9[] = { {"cap", 3, 0x02229, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4FB[] = { {"ensp", 4, 0x02002, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_4FE[] = { {"Afr", 3, 0x1D504, 0}, {"Pi", 2, 0x003A0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_500[] = { {"iquest", 6, 0x000BF, 0}, {"ltri", 4, 0x025C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_504[] = { {"nlE", 3, 0x02266, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_506[] = { {"Phi", 3, 0x003A6, 0}, {"lambda", 6, 0x003BB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_507[] = { {"Pr", 2, 0x02ABB, 0}, {"Vdashl", 6, 0x02AE6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_509[] = { {"SuchThat", 8, 0x0220B, 0}, {"Supset", 6, 0x022D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_50E[] = { {"Darr", 4, 0x021A1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_50F[] = { {"Cdot", 4, 0x0010A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_513[] = { {"rcy", 3, 0x00440, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_516[] = { {"orderof", 7, 0x02134, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_518[] = { {"leqq", 4, 0x02266, 0}, {"precsim", 7, 0x0227E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_519[] = { {"RightTriangle", 13, 0x022B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_51B[] = { {"agrave", 6, 0x000E0, 0}, {"succnapprox", 11, 0x02ABA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_51C[] = { {"Tab", 3, 0x00009, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_524[] = { {"nle", 3, 0x02270, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_525[] = { {"spades", 6, 0x02660, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_526[] = { {"gtcc", 4, 0x02AA7, 0}, {"llcorner", 8, 0x0231E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_52F[] = { {"Oslash", 6, 0x000D8, 0}, {"Tau", 3, 0x003A4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_530[] = { {"fopf", 4, 0x1D557, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_532[] = { {"Mellintrf", 9, 0x02133, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_533[] = { {"nlt", 3, 0x0226E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_534[] = { {"lparlt", 6, 0x02993, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_53B[] = { {"Ccaron", 6, 0x0010C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_53C[] = { {"Re", 2, 0x0211C, 0}, {"dstrok", 6, 0x00111, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_53F[] = { {"leftharpoondown", 15, 0x021BD, 0}, {"ssetmn", 6, 0x02216, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_542[] = { {"lrhard", 6, 0x0296D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_543[] = { {"reg", 3, 0x000AE, 0}, {"sharp", 5, 0x0266F, 0}, {"yicy", 4, 0x00457, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_545[] = { {"ShortUpArrow", 12, 0x02191, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_548[] = { {"plusacir", 8, 0x02A23, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_54F[] = { {"cent", 4, 0x000A2, 0}, {"natur", 5, 0x0266E, 0}, {"varphi", 6, 0x003D5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_550[] = { {"lesg", 4, 0x022DA, 0x0FE00}, {"supnE", 5, 0x02ACC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_551[] = { {"ohbar", 5, 0x029B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_557[] = { {"NotLessGreater", 14, 0x02278, 0}, {"nleqslant", 9, 0x02A7D, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_55B[] = { {"Sc", 2, 0x02ABC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_55D[] = { {"NotSucceedsEqual", 16, 0x02AB0, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_55F[] = { {"DZcy", 4, 0x0040F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_564[] = { {"vartheta", 8, 0x003D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_565[] = { {"ltrie", 5, 0x022B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_566[] = { {"Otilde", 6, 0x000D5, 0}, {"ltrif", 5, 0x025C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_56C[] = { {"Lsh", 3, 0x021B0, 0}, {"hookleftarrow", 13, 0x021A9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_56F[] = { {"rfr", 3, 0x1D52F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_570[] = { {"supne", 5, 0x0228B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_571[] = { {"Gopf", 4, 0x1D53E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_572[] = { {"UpEquilibrium", 13, 0x0296E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_575[] = { {"Tcy", 3, 0x00422, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_576[] = { {"ffilig", 6, 0x0FB03, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_577[] = { {"fork", 4, 0x022D4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_578[] = { {"oplus", 5, 0x02295, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_57A[] = { {"nvle", 4, 0x02264, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_57B[] = { {"HilbertSpace", 12, 0x0210B, 0}, {"subedot", 7, 0x02AC3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_57C[] = { {"TripleDot", 9, 0x020DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_580[] = { {"sscr", 4, 0x1D4C8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_582[] = { {"osol", 4, 0x02298, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_583[] = { {"plustwo", 7, 0x02A27, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_586[] = { {"LessGreater", 11, 0x02276, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_588[] = { {"lrarr", 5, 0x021C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_589[] = { {"nvlt", 4, 0x0003C, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_58D[] = { {"questeq", 7, 0x0225F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_58E[] = { {"LessTilde", 9, 0x02272, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_58F[] = { {"djcy", 4, 0x00452, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_590[] = { {"xoplus", 6, 0x02A01, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_595[] = { {"primes", 6, 0x02119, 0}, {"solb", 4, 0x029C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_596[] = { {"not", 3, 0x000AC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_59A[] = { {"angzarr", 7, 0x0237C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_59D[] = { {"nearr", 5, 0x02197, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_59F[] = { {"lowast", 6, 0x02217, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5A0[] = { {"cfr", 3, 0x1D520, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5A3[] = { {"ltcir", 5, 0x02A79, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5A6[] = { {"Ecy", 3, 0x0042D, 0}, {"gesdotol", 8, 0x02A84, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5A9[] = { {"longleftrightarrow", 18, 0x027F7, 0}, {"para", 4, 0x000B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5AC[] = { {"Uacute", 6, 0x000DA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5AD[] = { {"blank", 5, 0x02423, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5AE[] = { {"rho", 3, 0x003C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5B0[] = { {"dharl", 5, 0x021C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5B1[] = { {"rsquor", 6, 0x02019, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5B5[] = { {"NotSquareSubsetEqual", 20, 0x022E2, 0}, {"npr", 3, 0x02280, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5B6[] = { {"dharr", 5, 0x021C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5B7[] = { {"NewLine", 7, 0x0000A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5BB[] = { {"odot", 4, 0x02299, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5BC[] = { {"part", 4, 0x02202, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5BD[] = { {"cuvee", 5, 0x022CE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5BF[] = { {"lesdoto", 7, 0x02A81, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5C0[] = { {"itilde", 6, 0x00129, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5C1[] = { {"Tscr", 4, 0x1D4AF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5C2[] = { {"nsubE", 5, 0x02AC5, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5C4[] = { {"ratio", 5, 0x02236, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5D0[] = { {"Conint", 6, 0x0222F, 0}, {"LeftDownVectorBar", 17, 0x02959, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5D1[] = { {"Tfr", 3, 0x1D517, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5D3[] = { {"fllig", 5, 0x0FB02, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5D5[] = { {"thksim", 6, 0x0223C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5D8[] = { {"Euml", 4, 0x000CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5D9[] = { {"chi", 3, 0x003C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5DB[] = { {"ncup", 4, 0x02A42, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5DD[] = { {"SOFTcy", 6, 0x0042C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5DF[] = { {"bnequiv", 7, 0x02261, 0x020E5}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5E2[] = { {"nsube", 5, 0x02288, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5E4[] = { {"mapstoleft", 10, 0x021A4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5E7[] = { {"NotLessSlantEqual", 17, 0x02A7D, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5EA[] = { {"ldrushar", 8, 0x0294B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5ED[] = { {"Equilibrium", 11, 0x021CC, 0}, {"Uogon", 5, 0x00172, 0}, {"supsetneq", 9, 0x0228B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5F0[] = { {"Vbar", 4, 0x02AEB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5F3[] = { {"vnsub", 5, 0x02282, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5F6[] = { {"Square", 6, 0x025A1, 0}, {"lessapprox", 10, 0x02A85, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5F8[] = { {"And", 3, 0x02A53, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5FA[] = { {"gesdoto", 7, 0x02A82, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_5FD[] = { {"gap", 3, 0x02A86, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_601[] = { {"nsucc", 5, 0x02281, 0}, {"thicksim", 8, 0x0223C, 0}, {"vnsup", 5, 0x02283, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_602[] = { {"Efr", 3, 0x1D508, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_603[] = { {"Igrave", 6, 0x000CC, 0}, {"cir", 3, 0x025CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_606[] = { {"Xi", 2, 0x0039E, 0}, {"oacute", 6, 0x000F3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_609[] = { {"nsc", 3, 0x02281, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_60D[] = { {"uogon", 5, 0x00173, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_613[] = { {"rharul", 6, 0x0296C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_615[] = { {"RuleDelayed", 11, 0x029F4, 0}, {"apacir", 6, 0x02A6F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_617[] = { {"jscr", 4, 0x1D4BF, 0}, {"vcy", 3, 0x00432, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_61A[] = { {"barwed", 6, 0x02305, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_61D[] = { {"sopf", 4, 0x1D564, 0}, {"thkap", 5, 0x02248, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_61F[] = { {"lesseqgtr", 9, 0x022DA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_622[] = { {"rdquor", 6, 0x0201D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_624[] = { {"Lstrok", 6, 0x00141, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_626[] = { {"Product", 7, 0x0220F, 0}, {"sqsupe", 6, 0x02292, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_628[] = { {"awconint", 8, 0x02233, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_62C[] = { {"hearts", 6, 0x02665, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_630[] = { {"rlm", 3, 0x0200F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_632[] = { {"comma", 5, 0x0002C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_636[] = { {"PartialD", 8, 0x02202, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_63A[] = { {"wedbar", 6, 0x02A5F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_63C[] = { {"oline", 5, 0x0203E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_63D[] = { {"OverBracket", 11, 0x023B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_63E[] = { {"RBarr", 5, 0x02910, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_641[] = { {"uharl", 5, 0x021BF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_642[] = { {"leftrightsquigarrow", 19, 0x021AD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_645[] = { {"RightFloor", 10, 0x0230B, 0}, {"intprod", 7, 0x02A3C, 0}, {"vee", 3, 0x02228, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_646[] = { {"zigrarr", 7, 0x021DD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_647[] = { {"uharr", 5, 0x021BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_648[] = { {"gcy", 3, 0x00433, 0}, {"varsubsetneq", 12, 0x0228A, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_649[] = { {"leqslant", 8, 0x02A7D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_64A[] = { {"Odblac", 6, 0x00150, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_651[] = { {"minus", 5, 0x02212, 0}, {"scpolint", 8, 0x02A13, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_652[] = { {"lrtri", 5, 0x022BF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_653[] = { {"DiacriticalGrave", 16, 0x00060, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_655[] = { {"num", 3, 0x00023, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_657[] = { {"quest", 5, 0x0003F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_658[] = { {"Kscr", 4, 0x1D4A6, 0}, {"UnderBar", 8, 0x0005F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_659[] = { {"lsquo", 5, 0x02018, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_65C[] = { {"rArr", 4, 0x021D2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_65E[] = { {"Topf", 4, 0x1D54B, 0}, {"heartsuit", 9, 0x02665, 0}, {"rBarr", 5, 0x0290F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_660[] = { {"emptyset", 8, 0x02205, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_669[] = { {"UnderParenthesis", 16, 0x023DD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_670[] = { {"dotplus", 7, 0x02214, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_671[] = { {"Psi", 3, 0x003A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_672[] = { {"GJcy", 4, 0x00403, 0}, {"exist", 5, 0x02203, 0}, {"simplus", 7, 0x02A24, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_673[] = { {"vfr", 3, 0x1D533, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_676[] = { {"tprime", 6, 0x02034, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_678[] = { {"leftrightharpoons", 17, 0x021CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_679[] = { {"rbrksld", 7, 0x0298E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_67D[] = { {"Ecaron", 6, 0x0011A, 0}, {"gel", 3, 0x022DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_680[] = { {"capdot", 6, 0x02A40, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_682[] = { {"geq", 3, 0x02265, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_684[] = { {"LowerLeftArrow", 14, 0x02199, 0}, {"ges", 3, 0x02A7E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_685[] = { {"Colone", 6, 0x02A74, 0}, {"NotLessEqual", 12, 0x02270, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_68A[] = { {"nrarr", 5, 0x0219B, 0}, {"rbrkslu", 7, 0x02990, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_68C[] = { {"flat", 4, 0x0266D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_691[] = { {"there4", 6, 0x02234, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_693[] = { {"Gdot", 4, 0x00120, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_694[] = { {"ijlig", 5, 0x00133, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_696[] = { {"blacklozenge", 12, 0x029EB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_699[] = { {"Zeta", 4, 0x00396, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6A3[] = { {"duarr", 5, 0x021F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6A4[] = { {"DotEqual", 8, 0x02250, 0}, {"dtdot", 5, 0x022F1, 0}, {"gfr", 3, 0x1D524, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6A8[] = { {"cirE", 4, 0x029C3, 0}, {"period", 6, 0x0002E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6A9[] = { {"lmoust", 6, 0x023B0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6AA[] = { {"Icy", 3, 0x00418, 0}, {"Rcaron", 6, 0x00158, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6AB[] = { {"LeftCeiling", 11, 0x02308, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6AE[] = { {"ascr", 4, 0x1D4B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6B0[] = { {"boxtimes", 8, 0x022A0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6B4[] = { {"jopf", 4, 0x1D55B, 0}, {"ntriangleleft", 13, 0x022EA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6B6[] = { {"eqcolon", 7, 0x02255, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6B8[] = { {"rbbrk", 5, 0x02773, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6B9[] = { {"homtht", 6, 0x0223B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6BA[] = { {"ggg", 3, 0x022D9, 0}, {"seswar", 6, 0x02929, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6BC[] = { {"perp", 4, 0x022A5, 0}, {"shcy", 4, 0x00448, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6BF[] = { {"phone", 5, 0x0260E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6C0[] = { {"NotDoubleVerticalBar", 20, 0x02226, 0}, {"ngtr", 4, 0x0226F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6C4[] = { {"ThickSpace", 10, 0x0205F, 0x0200A}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6C5[] = { {"ForAll", 6, 0x02200, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6C6[] = { {"circ", 4, 0x002C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6C7[] = { {"Verbar", 6, 0x02016, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6C8[] = { {"cire", 4, 0x02257, 0}, {"lesges", 6, 0x02A93, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6C9[] = { {"slarr", 5, 0x02190, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6CC[] = { {"RightDownTeeVector", 18, 0x0295D, 0}, {"triangleq", 9, 0x0225C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6CE[] = { {"checkmark", 9, 0x02713, 0}, {"quot", 4, 0x00022, 0}, {"suplarr", 7, 0x0297B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6D1[] = { {"Backslash", 9, 0x02216, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6D2[] = { {"fallingdotseq", 13, 0x02252, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6D4[] = { {"swArr", 5, 0x021D9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6D5[] = { {"Xfr", 3, 0x1D51B, 0}, {"lbrke", 5, 0x0298B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6D9[] = { {"jmath", 5, 0x00237, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6DA[] = { {"lmoustache", 10, 0x023B0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6DB[] = { {"DownTee", 7, 0x022A4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6DC[] = { {"reals", 5, 0x0211D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6DE[] = { {"quaternions", 11, 0x0210D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6E7[] = { {"vzigzag", 7, 0x0299A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6EB[] = { {"pound", 5, 0x000A3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6EE[] = { {"permil", 6, 0x02030, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6EF[] = { {"Bscr", 4, 0x0212C, 0}, {"lfisht", 6, 0x0297C, 0}, {"vartriangleleft", 15, 0x022B2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6F5[] = { {"Kopf", 4, 0x1D542, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6F7[] = { {"Tilde", 5, 0x0223C, 0}, {"gtrarr", 6, 0x02978, 0}, {"lAarr", 5, 0x021DA, 0}, {"opar", 4, 0x029B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_6FB[] = { {"triangle", 8, 0x025B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_704[] = { {"lcaron", 6, 0x0013E, 0}, {"wscr", 4, 0x1D4CC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_705[] = { {"asympeq", 7, 0x0224D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_706[] = { {"Ifr", 3, 0x02111, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_707[] = { {"DoubleDot", 9, 0x000A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_709[] = { {"nVdash", 6, 0x022AE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_70C[] = { {"hairsp", 6, 0x0200A, 0}, {"leftrightarrows", 15, 0x021C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_70E[] = { {"lbrace", 6, 0x0007B, 0}, {"rightarrow", 10, 0x02192, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_70F[] = { {"Dagger", 6, 0x02021, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_712[] = { {"rsh", 3, 0x021B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_714[] = { {"eqslantless", 11, 0x02A95, 0}, {"gnapprox", 8, 0x02A8A, 0}, {"lbrack", 6, 0x0005B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_715[] = { {"uHar", 4, 0x02963, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_717[] = { {"tilde", 5, 0x002DC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_719[] = { {"complement", 10, 0x02201, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_71B[] = { {"zcy", 3, 0x00437, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_71E[] = { {"boxDL", 5, 0x02557, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_71F[] = { {"micro", 5, 0x000B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_723[] = { {"horbar", 6, 0x02015, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_724[] = { {"boxDR", 5, 0x02554, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_727[] = { {"bsolhsub", 8, 0x027C8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_729[] = { {"ac", 2, 0x0223E, 0}, {"nvdash", 6, 0x022AC, 0}, {"precapprox", 10, 0x02AB7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_72C[] = { {"af", 2, 0x02061, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_72D[] = { {"bullet", 6, 0x02022, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_72E[] = { {"demptyv", 7, 0x029B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_733[] = { {"geqq", 4, 0x02267, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_734[] = { {"uuarr", 5, 0x021C8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_735[] = { {"Ocirc", 5, 0x000D4, 0}, {"utdot", 5, 0x022F0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_736[] = { {"ap", 2, 0x02248, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_738[] = { {"bNot", 4, 0x02AED, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_73B[] = { {"CirclePlus", 10, 0x02295, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_73D[] = { {"glE", 3, 0x02A92, 0}, {"midcir", 6, 0x02AF0, 0}, {"rppolint", 8, 0x02A12, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_73E[] = { {"boxDl", 5, 0x02556, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_73F[] = { {"sdot", 4, 0x022C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_744[] = { {"boxDr", 5, 0x02553, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_745[] = { {"Xscr", 4, 0x1D4B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_749[] = { {"dlcrop", 6, 0x0230D, 0}, {"gtrless", 7, 0x02277, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_74B[] = { {"aopf", 4, 0x1D552, 0}, {"operp", 5, 0x029B9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_74C[] = { {"kcy", 3, 0x0043A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_74F[] = { {"larrfs", 6, 0x0291D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_751[] = { {"rcub", 4, 0x0007D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_754[] = { {"nrtri", 5, 0x022EB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_755[] = { {"nparsl", 6, 0x02AFD, 0x020E5}, {"ocirc", 5, 0x000F4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_759[] = { {"gla", 3, 0x02AA5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_75C[] = { {"Iuml", 4, 0x000CF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_75F[] = { {"mcomma", 6, 0x02A29, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_762[] = { {"glj", 3, 0x02AA4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_763[] = { {"Map", 3, 0x02905, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_765[] = { {"copysr", 6, 0x02117, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_766[] = { {"DownTeeArrow", 12, 0x021A7, 0}, {"Upsi", 4, 0x003D2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_768[] = { {"awint", 5, 0x02A11, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_76E[] = { {"DownRightVector", 15, 0x021C1, 0}, {"NotEqual", 8, 0x02260, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_770[] = { {"gesl", 4, 0x022DB, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_772[] = { {"NotCupCap", 9, 0x0226D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_776[] = { {"blacktriangleright", 18, 0x025B8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_777[] = { {"zfr", 3, 0x1D537, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_779[] = { {"leftrightarrow", 14, 0x02194, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_77A[] = { {"Abreve", 6, 0x00102, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_77F[] = { {"Uarr", 4, 0x0219F, 0}, {"gnE", 3, 0x02269, 0}, {"supmult", 7, 0x02AC2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_781[] = { {"supplus", 7, 0x02AC0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_783[] = { {"nabla", 5, 0x02207, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_787[] = { {"Lang", 4, 0x027EA, 0}, {"laquo", 5, 0x000AB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_789[] = { {"larrhk", 6, 0x021A9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_78C[] = { {"Bopf", 4, 0x1D539, 0}, {"lowbar", 6, 0x0005F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_78D[] = { {"cup", 3, 0x0222A, 0}, {"dd", 2, 0x02146, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_78E[] = { {"nsce", 4, 0x02AB0, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_790[] = { {"nshortparallel", 14, 0x02226, 0}, {"nsupE", 5, 0x02AC6, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_794[] = { {"OpenCurlyQuote", 14, 0x02018, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_797[] = { {"bsolb", 5, 0x029C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_798[] = { {"DScy", 4, 0x00405, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_79A[] = { {"boxHD", 5, 0x02566, 0}, {"ltrPar", 6, 0x02996, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_79B[] = { {"nscr", 4, 0x1D4C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_79D[] = { {"lEg", 3, 0x02A8B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_79F[] = { {"egrave", 6, 0x000E8, 0}, {"gne", 3, 0x02A88, 0}, {"larrsim", 7, 0x02973, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7A0[] = { {"COPY", 4, 0x000A9, 0}, {"bdquo", 5, 0x0201E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7A1[] = { {"wopf", 4, 0x1D568, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7A2[] = { {"NotRightTriangleEqual", 21, 0x022ED, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7A5[] = { {"robrk", 5, 0x027E7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7A8[] = { {"kfr", 3, 0x1D528, 0}, {"nlsim", 5, 0x02274, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7AA[] = { {"xhArr", 5, 0x027FA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7AB[] = { {"boxHU", 5, 0x02569, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7AC[] = { {"lHar", 4, 0x02962, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7AE[] = { {"Mcy", 3, 0x0041C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7AF[] = { {"ee", 2, 0x02147, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7B0[] = { {"nsupe", 5, 0x02289, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7B1[] = { {"eg", 2, 0x02A9A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7B5[] = { {"trade", 5, 0x02122, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7B6[] = { {"el", 2, 0x02A99, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7B7[] = { {"nsucceq", 7, 0x02AB0, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7B8[] = { {"langle", 6, 0x027E8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7BA[] = { {"boxHd", 5, 0x02564, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7BB[] = { {"Subset", 6, 0x022D0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7BD[] = { {"DownArrowBar", 12, 0x02913, 0}, {"topbot", 6, 0x02336, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7BE[] = { {"OverBrace", 9, 0x023DE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7BF[] = { {"Eta", 3, 0x00397, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7C0[] = { {"hstrok", 6, 0x00127, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7C1[] = { {"Hacek", 5, 0x002C7, 0}, {"diamond", 7, 0x022C4, 0}, {"isinsv", 6, 0x022F3, 0}, {"rtriltri", 8, 0x029CE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7C9[] = { {"nvltrie", 7, 0x022B4, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7CB[] = { {"boxHu", 5, 0x02567, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7CD[] = { {"fpartint", 8, 0x02A0D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7CE[] = { {"Proportional", 12, 0x0221D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7D1[] = { {"NotSuperset", 11, 0x02283, 0x020D2}, {"gE", 2, 0x02267, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7D2[] = { {"scnsim", 6, 0x022E9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7D5[] = { {"uparrow", 7, 0x02191, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7D6[] = { {"ltlarr", 6, 0x02976, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7D9[] = { {"rtimes", 6, 0x022CA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7DA[] = { {"ncong", 5, 0x02247, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7DC[] = { {"Oscr", 4, 0x1D4AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7E0[] = { {"vArr", 4, 0x021D5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7E2[] = { {"Xopf", 4, 0x1D54F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7E4[] = { {"notinva", 7, 0x02209, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7E5[] = { {"notinvb", 7, 0x022F7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7E6[] = { {"notinvc", 7, 0x022F6, 0}, {"nsqsube", 7, 0x022E2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7EC[] = { {"Tcaron", 6, 0x00164, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7EF[] = { {"upsilon", 7, 0x003C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7F1[] = { {"ge", 2, 0x02265, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7F3[] = { {"gg", 2, 0x0226B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7F6[] = { {"KJcy", 4, 0x0040C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7F8[] = { {"gl", 2, 0x02277, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7FB[] = { {"dblac", 5, 0x002DD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_7FC[] = { {"lAtail", 6, 0x0291B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_800[] = { {"gt", 2, 0x0003E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_802[] = { {"lotimes", 7, 0x02A34, 0}, {"seArr", 5, 0x021D8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_803[] = { {"Lacute", 6, 0x00139, 0}, {"Laplacetrf", 10, 0x02112, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_808[] = { {"uuml", 4, 0x000FC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_809[] = { {"Amacr", 5, 0x00100, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_80A[] = { {"Mfr", 3, 0x1D510, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_810[] = { {"Int", 3, 0x0222C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_811[] = { {"Vvdash", 6, 0x022AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_812[] = { {"Lcedil", 6, 0x0013B, 0}, {"larrlp", 6, 0x021AB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_816[] = { {"Larr", 4, 0x0219E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_819[] = { {"CircleTimes", 11, 0x02297, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_81C[] = { {"NotReverseElement", 17, 0x0220C, 0}, {"latail", 6, 0x02919, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_81D[] = { {"ntrianglerighteq", 16, 0x022ED, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_821[] = { {"blk12", 5, 0x02592, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_822[] = { {"intlarhk", 8, 0x02A17, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_823[] = { {"blk14", 5, 0x02591, 0}, {"ccupssm", 7, 0x02A50, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_824[] = { {"hercon", 6, 0x022B9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_828[] = { {"bigotimes", 9, 0x02A02, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_829[] = { {"amacr", 5, 0x00101, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_82D[] = { {"nrarrc", 6, 0x02933, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_82E[] = { {"ubreve", 6, 0x0016D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_830[] = { {"Yacute", 6, 0x000DD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_831[] = { {"ic", 2, 0x02063, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_832[] = { {"escr", 4, 0x0212F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_837[] = { {"ii", 2, 0x02148, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_838[] = { {"DownArrowUpArrow", 16, 0x021F5, 0}, {"nopf", 4, 0x1D55F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_83C[] = { {"in", 2, 0x02208, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_83E[] = { {"bumpE", 5, 0x02AAE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_83F[] = { {"rightharpoonup", 14, 0x021C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_841[] = { {"nrarrw", 6, 0x0219D, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_842[] = { {"it", 2, 0x02062, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_846[] = { {"ncaron", 6, 0x00148, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_84A[] = { {"succnsim", 8, 0x022E9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_84C[] = { {"gammad", 6, 0x003DD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_84F[] = { {"yucy", 4, 0x0044E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_850[] = { {"ocy", 3, 0x0043E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_855[] = { {"hybull", 6, 0x02043, 0}, {"rpargt", 6, 0x02994, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_857[] = { {"csube", 5, 0x02AD1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_85B[] = { {"iiota", 5, 0x02129, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_85C[] = { {"nsim", 4, 0x02241, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_85E[] = { {"LeftTriangleEqual", 17, 0x022B4, 0}, {"bumpe", 5, 0x0224F, 0}, {"nearhk", 6, 0x02924, 0}, {"nhpar", 5, 0x02AF2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_861[] = { {"risingdotseq", 12, 0x02253, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_865[] = { {"blk34", 5, 0x02593, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_866[] = { {"LeftTriangle", 12, 0x022B2, 0}, {"vBarv", 5, 0x02AE9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_867[] = { {"AElig", 5, 0x000C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_868[] = { {"DoubleUpDownArrow", 17, 0x021D5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_86A[] = { {"cwint", 5, 0x02231, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_86B[] = { {"rtrie", 5, 0x022B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_86C[] = { {"rtrif", 5, 0x025B8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_873[] = { {"Fscr", 4, 0x02131, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_876[] = { {"lE", 2, 0x02266, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_879[] = { {"Oopf", 4, 0x1D546, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_87B[] = { {"spar", 4, 0x02225, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_87E[] = { {"uplus", 5, 0x0228E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_88A[] = { {"sacute", 6, 0x0015B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_88C[] = { {"fltns", 5, 0x025B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_88E[] = { {"rrarr", 5, 0x021C9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_892[] = { {"larrpl", 6, 0x02939, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_895[] = { {"ultri", 5, 0x025F8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_896[] = { {"le", 2, 0x02264, 0}, {"xuplus", 6, 0x02A04, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_897[] = { {"ljcy", 4, 0x00459, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_898[] = { {"lg", 2, 0x02276, 0}, {"vsubnE", 6, 0x02ACB, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_899[] = { {"scedil", 6, 0x0015F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_89D[] = { {"ll", 2, 0x0226A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8A5[] = { {"lt", 2, 0x0003C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8AC[] = { {"ofr", 3, 0x1D52C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8B3[] = { {"nexists", 7, 0x02204, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8B6[] = { {"smallsetminus", 13, 0x02216, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8B7[] = { {"InvisibleComma", 14, 0x02063, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8B8[] = { {"dotminus", 8, 0x02238, 0}, {"vsubne", 6, 0x0228A, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8B9[] = { {"iocy", 4, 0x00451, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8BA[] = { {"gsime", 5, 0x02A8E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8BC[] = { {"Rarrtl", 6, 0x02916, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8BD[] = { {"cirmid", 6, 0x02AEF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8C0[] = { {"ominus", 6, 0x02296, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8C1[] = { {"gsiml", 5, 0x02A90, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8C2[] = { {"Prime", 5, 0x02033, 0}, {"mp", 2, 0x02213, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8C4[] = { {"tint", 4, 0x0222D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8C7[] = { {"mu", 2, 0x003BC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8CF[] = { {"dbkarow", 7, 0x0290F, 0}, {"eopf", 4, 0x1D556, 0}, {"ogt", 3, 0x029C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8D0[] = { {"Precedes", 8, 0x0227A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8D3[] = { {"UpTeeArrow", 10, 0x021A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8D6[] = { {"varsupsetneq", 12, 0x0228B, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8D8[] = { {"ne", 2, 0x02260, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8DC[] = { {"ni", 2, 0x0220B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8DD[] = { {"mDDot", 5, 0x0223A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8DE[] = { {"cularrp", 7, 0x0293D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8DF[] = { {"rnmid", 5, 0x02AEE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8E0[] = { {"hardcy", 6, 0x0044A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8E2[] = { {"prime", 5, 0x02032, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8E3[] = { {"Bcy", 3, 0x00411, 0}, {"REG", 3, 0x000AE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8E7[] = { {"oS", 2, 0x024C8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8E8[] = { {"nu", 2, 0x003BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8E9[] = { {"ohm", 3, 0x003A9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8EB[] = { {"langd", 5, 0x02991, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8F3[] = { {"backprime", 9, 0x02035, 0}, {"esim", 4, 0x02242, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8FB[] = { {"veeeq", 5, 0x0225A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8FE[] = { {"RightCeiling", 12, 0x02309, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_8FF[] = { {"crarr", 5, 0x021B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_904[] = { {"eqsim", 5, 0x02242, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_906[] = { {"or", 2, 0x02228, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_907[] = { {"OverParenthesis", 15, 0x023DC, 0}, {"UpperLeftArrow", 14, 0x02196, 0}, {"nleftrightarrow", 15, 0x021AE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_909[] = { {"expectation", 11, 0x02130, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_90C[] = { {"coprod", 6, 0x02210, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_90E[] = { {"Qfr", 3, 0x1D514, 0}, {"dArr", 4, 0x021D3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_910[] = { {"Fopf", 4, 0x1D53D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_913[] = { {"Cconint", 7, 0x02230, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_916[] = { {"larrtl", 6, 0x021A2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_918[] = { {"Aacute", 6, 0x000C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_919[] = { {"DownLeftRightVector", 19, 0x02950, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_91B[] = { {"circleddash", 11, 0x0229D, 0}, {"thinsp", 6, 0x02009, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_91E[] = { {"Longrightarrow", 14, 0x027F9, 0}, {"pi", 2, 0x003C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_91F[] = { {"hookrightarrow", 14, 0x021AA, 0}, {"rscr", 4, 0x1D4C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_920[] = { {"scE", 3, 0x02AB4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_922[] = { {"pm", 2, 0x000B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_923[] = { {"ZHcy", 4, 0x00416, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_927[] = { {"pr", 2, 0x0227A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_929[] = { {"LongLeftRightArrow", 18, 0x027F7, 0}, {"supset", 6, 0x02283, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_92A[] = { {"UpArrowBar", 10, 0x02912, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_92C[] = { {"Utilde", 6, 0x00168, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_92E[] = { {"xlArr", 5, 0x027F8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_930[] = { {"DoubleUpArrow", 13, 0x021D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_936[] = { {"alefsym", 7, 0x02135, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_939[] = { {"Scirc", 5, 0x0015C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_93B[] = { {"xotime", 6, 0x02A02, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_93F[] = { {"Bfr", 3, 0x1D505, 0}, {"rdca", 4, 0x02937, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_940[] = { {"sce", 3, 0x02AB0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_945[] = { {"Nacute", 6, 0x00143, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_947[] = { {"amalg", 5, 0x02A3F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_94D[] = { {"UpDownArrow", 11, 0x02195, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_94F[] = { {"EqualTilde", 10, 0x02242, 0}, {"boxUL", 5, 0x0255D, 0}, {"oslash", 6, 0x000F8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_950[] = { {"lnap", 4, 0x02A89, 0}, {"thorn", 5, 0x000FE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_952[] = { {"ssmile", 6, 0x02323, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_953[] = { {"ndash", 5, 0x02013, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_954[] = { {"Ncedil", 6, 0x00145, 0}, {"scy", 3, 0x00441, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_955[] = { {"boxUR", 5, 0x0255A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_956[] = { {"Aring", 5, 0x000C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_959[] = { {"scirc", 5, 0x0015D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_95B[] = { {"ccaron", 6, 0x0010D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_95D[] = { {"dotsquare", 9, 0x022A1, 0}, {"nshortmid", 9, 0x02224, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_95F[] = { {"rsquo", 5, 0x02019, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_960[] = { {"Sscr", 4, 0x1D4AE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_963[] = { {"bigwedge", 8, 0x022C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_964[] = { {"Bernoullis", 10, 0x0212C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_969[] = { {"harrw", 5, 0x021AD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_96C[] = { {"SquareSubset", 12, 0x0228F, 0}, {"boxVH", 5, 0x0256C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_96F[] = { {"boxUl", 5, 0x0255C, 0}, {"rx", 2, 0x0211E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_970[] = { {"boxVL", 5, 0x02563, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_974[] = { {"olt", 3, 0x029C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_975[] = { {"boxUr", 5, 0x02559, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_976[] = { {"aring", 5, 0x000E5, 0}, {"boxVR", 5, 0x02560, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_97B[] = { {"sc", 2, 0x0227B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_97C[] = { {"NestedGreaterGreater", 20, 0x0226B, 0}, {"oast", 4, 0x0229B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_97F[] = { {"star", 4, 0x02606, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_981[] = { {"LeftTeeVector", 13, 0x0295A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_983[] = { {"bigsqcup", 8, 0x02A06, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_985[] = { {"dcy", 3, 0x00434, 0}, {"preceq", 6, 0x02AAF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_986[] = { {"otilde", 6, 0x000F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_988[] = { {"luruhar", 7, 0x02966, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_98C[] = { {"boxVh", 5, 0x0256B, 0}, {"capand", 6, 0x02A44, 0}, {"yuml", 4, 0x000FF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_98D[] = { {"Updownarrow", 11, 0x021D5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_98F[] = { {"TildeEqual", 10, 0x02243, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_990[] = { {"boxVl", 5, 0x02562, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_996[] = { {"boxVr", 5, 0x0255F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_997[] = { {"HorizontalLine", 14, 0x02500, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_99B[] = { {"xmap", 4, 0x027FC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_99C[] = { {"sigmaf", 6, 0x003C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_99E[] = { {"EmptySmallSquare", 16, 0x025FB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_99F[] = { {"dzcy", 4, 0x0045F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9A0[] = { {"cups", 4, 0x0222A, 0x0FE00}, {"zwj", 3, 0x0200D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9A1[] = { {"beta", 4, 0x003B2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9A6[] = { {"supsim", 6, 0x02AC8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9A8[] = { {"beth", 4, 0x02136, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9AA[] = { {"Iukcy", 5, 0x00406, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9AC[] = { {"eparsl", 6, 0x029E3, 0}, {"sigmav", 6, 0x003C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9B0[] = { {"lhard", 5, 0x021BD, 0}, {"sfr", 3, 0x1D530, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9B4[] = { {"nsqsupe", 7, 0x022E3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9B5[] = { {"Jsercy", 6, 0x00408, 0}, {"deg", 3, 0x000B0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9B6[] = { {"Ucy", 3, 0x00423, 0}, {"iscr", 4, 0x1D4BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9B7[] = { {"efDot", 5, 0x02252, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9BB[] = { {"uhblk", 5, 0x02580, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9BC[] = { {"ropf", 4, 0x1D563, 0}, {"vprop", 5, 0x0221D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9BD[] = { {"isinE", 5, 0x022F9, 0}, {"raemptyv", 8, 0x029B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9C1[] = { {"lharu", 5, 0x021BC, 0}, {"ncongdot", 8, 0x02A6D, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9C2[] = { {"subnE", 5, 0x02ACB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9C3[] = { {"ngsim", 5, 0x02275, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9C5[] = { {"starf", 5, 0x02605, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9C9[] = { {"Ograve", 6, 0x000D2, 0}, {"hksearow", 8, 0x02925, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9CA[] = { {"iukcy", 5, 0x00456, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9CC[] = { {"uacute", 6, 0x000FA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9CF[] = { {"asymp", 5, 0x02248, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9D5[] = { {"lneq", 4, 0x02A87, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9D6[] = { {"Otimes", 6, 0x02A37, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9DA[] = { {"NotTildeTilde", 13, 0x02249, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9DB[] = { {"Integral", 8, 0x0222B, 0}, {"rbrke", 5, 0x0298C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9DD[] = { {"nsub", 4, 0x02284, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9DE[] = { {"rlhar", 5, 0x021CC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9E1[] = { {"dfr", 3, 0x1D521, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9E2[] = { {"subne", 5, 0x0228A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9E5[] = { {"varnothing", 10, 0x02205, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9E7[] = { {"Fcy", 3, 0x00424, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9E9[] = { {"DoubleLeftTee", 13, 0x02AE4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9EB[] = { {"isins", 5, 0x022F4, 0}, {"nsup", 4, 0x02285, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9ED[] = { {"circlearrowleft", 15, 0x021BA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9EE[] = { {"isinv", 5, 0x02208, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9EF[] = { {"IEcy", 4, 0x00415, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9F0[] = { {"conint", 6, 0x0222E, 0}, {"vBar", 4, 0x02AE8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9F1[] = { {"edot", 4, 0x00117, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9F2[] = { {"Kappa", 5, 0x0039A, 0}, {"MediumSpace", 11, 0x0205F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9F3[] = { {"lbrksld", 7, 0x0298F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9F4[] = { {"sect", 4, 0x000A7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9F5[] = { {"nldr", 4, 0x02025, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9F7[] = { {"Jscr", 4, 0x1D4A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9F9[] = { {"shy", 3, 0x000AD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9FA[] = { {"ulcrop", 6, 0x0230F, 0}, {"veebar", 6, 0x022BB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_9FD[] = { {"Sopf", 4, 0x1D54A, 0}, {"cuwed", 5, 0x022CF, 0}, {"rAarr", 5, 0x021DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A01[] = { {"erarr", 5, 0x02971, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A04[] = { {"lbrkslu", 7, 0x0298D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A05[] = { {"NotSucceeds", 11, 0x02281, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A06[] = { {"nsccue", 6, 0x022E1, 0}, {"subrarr", 7, 0x02979, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A08[] = { {"looparrowright", 14, 0x021AC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A0C[] = { {"wp", 2, 0x02118, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A0D[] = { {"Emacr", 5, 0x00112, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A0E[] = { {"sim", 3, 0x0223C, 0}, {"wr", 2, 0x02240, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A10[] = { {"Udblac", 6, 0x00170, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A12[] = { {"Ufr", 3, 0x1D518, 0}, {"kappa", 5, 0x003BA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A14[] = { {"notindot", 8, 0x022F5, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A15[] = { {"nleq", 4, 0x02270, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A16[] = { {"NestedLessLess", 14, 0x0226A, 0}, {"square", 6, 0x025A1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A17[] = { {"nles", 4, 0x02A7D, 0x00338}, {"squarf", 6, 0x025AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A21[] = { {"order", 5, 0x02134, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A23[] = { {"igrave", 6, 0x000EC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A24[] = { {"precneqq", 8, 0x02AB5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A25[] = { {"csupe", 5, 0x02AD2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A26[] = { {"xi", 2, 0x003BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A28[] = { {"NotHumpEqual", 12, 0x0224F, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A2A[] = { {"ord", 3, 0x02A5D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A2D[] = { {"emacr", 5, 0x00113, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A30[] = { {"nwnear", 6, 0x02927, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A32[] = { {"nprcue", 6, 0x022E0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A36[] = { {"NotExists", 9, 0x02204, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A37[] = { {"die", 3, 0x000A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A39[] = { {"ddotseq", 7, 0x02A77, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A3B[] = { {"Dashv", 5, 0x02AE4, 0}, {"Ucirc", 5, 0x000DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A3C[] = { {"orv", 3, 0x02A5B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A3D[] = { {"Because", 7, 0x02235, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A41[] = { {"kgreen", 6, 0x00138, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A43[] = { {"Ffr", 3, 0x1D509, 0}, {"LeftVector", 10, 0x021BC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A44[] = { {"lstrok", 6, 0x00142, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A45[] = { {"twixt", 5, 0x0226C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A48[] = { {"compfn", 6, 0x02218, 0}, {"div", 3, 0x000F7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A4F[] = { {"drcrop", 6, 0x0230C, 0}, {"shortmid", 8, 0x02223, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A53[] = { {"iopf", 4, 0x1D55A, 0}, {"triangledown", 12, 0x025BF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A54[] = { {"IJlig", 5, 0x00132, 0}, {"thetasym", 8, 0x003D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A56[] = { {"Sigma", 5, 0x003A3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A57[] = { {"equivDD", 7, 0x02A78, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A5A[] = { {"Cacute", 6, 0x00106, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A5B[] = { {"dashv", 5, 0x022A3, 0}, {"ucirc", 5, 0x000FB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A61[] = { {"gneqq", 5, 0x02269, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A62[] = { {"gvertneqq", 9, 0x02269, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A63[] = { {"RightDownVectorBar", 18, 0x02955, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A64[] = { {"NotLessLess", 11, 0x0226A, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A69[] = { {"Ccedil", 6, 0x000C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A6A[] = { {"odblac", 6, 0x00151, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A6B[] = { {"mstpos", 6, 0x0223E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A6D[] = { {"cemptyv", 7, 0x029B2, 0}, {"rarrap", 6, 0x02975, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A6F[] = { {"rmoust", 6, 0x023B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A70[] = { {"elsdot", 6, 0x02A97, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A76[] = { {"sigma", 5, 0x003C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A78[] = { {"Implies", 7, 0x021D2, 0}, {"isin", 4, 0x02208, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A7A[] = { {"bottom", 6, 0x022A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A7E[] = { {"ShortRightArrow", 15, 0x02192, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A81[] = { {"cupcap", 6, 0x02A46, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A82[] = { {"NotSquareSuperset", 17, 0x02290, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A84[] = { {"LeftArrowRightArrow", 19, 0x021C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A85[] = { {"FilledVerySmallSquare", 21, 0x025AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A86[] = { {"LeftUpTeeVector", 15, 0x02960, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A89[] = { {"DoubleRightArrow", 16, 0x021D2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A8D[] = { {"raquo", 5, 0x000BB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A8E[] = { {"Ascr", 4, 0x1D49C, 0}, {"ReverseUpEquilibrium", 20, 0x0296F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A92[] = { {"hArr", 4, 0x021D4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A94[] = { {"Jopf", 4, 0x1D541, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A96[] = { {"npar", 4, 0x02226, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A98[] = { {"SupersetEqual", 13, 0x02287, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A99[] = { {"ffllig", 6, 0x0FB04, 0}, {"smt", 3, 0x02AAA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A9A[] = { {"twoheadrightarrow", 17, 0x021A0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A9D[] = { {"ecaron", 6, 0x0011B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_A9F[] = { {"NotRightTriangleBar", 19, 0x029D0, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AA3[] = { {"apid", 4, 0x0224B, 0}, {"vscr", 4, 0x1D4CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AA4[] = { {"supdot", 6, 0x02ABE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AA5[] = { {"colone", 6, 0x02254, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AA7[] = { {"dwangle", 7, 0x029A6, 0}, {"shchcy", 6, 0x00449, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AAC[] = { {"ltdot", 5, 0x022D6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AB2[] = { {"downharpoonright", 16, 0x021C2, 0}, {"gjcy", 4, 0x00453, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AB4[] = { {"wfr", 3, 0x1D534, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AB5[] = { {"rfisht", 6, 0x0297D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ABA[] = { {"Ycy", 3, 0x0042B, 0}, {"swarrow", 7, 0x02199, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AC0[] = { {"nharr", 5, 0x021AE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AC4[] = { {"frac12", 6, 0x000BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AC5[] = { {"frac13", 6, 0x02153, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AC6[] = { {"frac14", 6, 0x000BC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AC7[] = { {"GreaterEqual", 12, 0x02265, 0}, {"frac15", 6, 0x02155, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AC8[] = { {"Gamma", 5, 0x00393, 0}, {"frac16", 6, 0x02159, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ACA[] = { {"dzigrarr", 8, 0x027FF, 0}, {"frac18", 6, 0x0215B, 0}, {"rcaron", 6, 0x00159, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ACC[] = { {"DownRightTeeVector", 18, 0x0295F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ACF[] = { {"nvrtrie", 7, 0x022B5, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AD2[] = { {"iota", 4, 0x003B9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AD3[] = { {"sol", 3, 0x0002F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AD4[] = { {"rbrace", 6, 0x0007D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ADA[] = { {"rbrack", 6, 0x0005D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ADD[] = { {"rsqb", 4, 0x0005D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ADF[] = { {"oint", 4, 0x0222E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AE4[] = { {"Wscr", 4, 0x1D4B2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AE5[] = { {"hfr", 3, 0x1D525, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AE6[] = { {"frac23", 6, 0x02154, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AE7[] = { {"dlcorn", 6, 0x0231E, 0}, {"verbar", 6, 0x0007C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AE8[] = { {"frac25", 6, 0x02156, 0}, {"gamma", 5, 0x003B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AE9[] = { {"nVDash", 6, 0x022AF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AEB[] = { {"Jcy", 3, 0x00419, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AF5[] = { {"nwarrow", 7, 0x02196, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AF6[] = { {"OverBar", 7, 0x0203E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AF7[] = { {"rightsquigarrow", 15, 0x0219D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AFA[] = { {"iexcl", 5, 0x000A1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AFD[] = { {"sqcap", 5, 0x02293, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_AFE[] = { {"pertenk", 7, 0x02031, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B08[] = { {"PrecedesEqual", 13, 0x02AAF, 0}, {"frac34", 6, 0x000BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B09[] = { {"Therefore", 9, 0x02234, 0}, {"frac35", 6, 0x02157, 0}, {"nvDash", 6, 0x022AD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B0A[] = { {"odsold", 6, 0x029BC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B0C[] = { {"dot", 3, 0x002D9, 0}, {"frac38", 6, 0x0215C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B10[] = { {"sqcaps", 6, 0x02293, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B11[] = { {"ZeroWidthSpace", 14, 0x0200B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B15[] = { {"rarrfs", 6, 0x0291E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B16[] = { {"Yfr", 3, 0x1D51C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B1E[] = { {"CircleDot", 9, 0x02299, 0}, {"gtcir", 5, 0x02A7A, 0}, {"squ", 3, 0x025A1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B1F[] = { {"angmsd", 6, 0x02221, 0}, {"nsubseteq", 9, 0x02288, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B23[] = { {"iprod", 5, 0x02A3C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B24[] = { {"bprime", 6, 0x02035, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B27[] = { {"supsub", 6, 0x02AD4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B29[] = { {"SquareSupersetEqual", 19, 0x02292, 0}, {"therefore", 9, 0x02234, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B2A[] = { {"frac45", 6, 0x02158, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B2B[] = { {"Aopf", 4, 0x1D538, 0}, {"NotGreaterFullEqual", 19, 0x02267, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B2C[] = { {"Tstrok", 6, 0x00166, 0}, {"rightleftarrows", 15, 0x021C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B2D[] = { {"Fouriertrf", 10, 0x02131, 0}, {"epar", 4, 0x022D5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B2E[] = { {"omid", 4, 0x029B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B2F[] = { {"OpenCurlyDoubleQuote", 20, 0x0201C, 0}, {"dagger", 6, 0x02020, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B33[] = { {"semi", 4, 0x0003B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B35[] = { {"supsup", 6, 0x02AD6, 0}, {"zeetrf", 6, 0x02128, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B36[] = { {"DifferentialD", 13, 0x02146, 0}, {"topcir", 6, 0x02AF1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B3A[] = { {"mscr", 4, 0x1D4C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B3D[] = { {"Wcirc", 5, 0x00174, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B3E[] = { {"boxdL", 5, 0x02555, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B40[] = { {"Gbreve", 6, 0x0011E, 0}, {"vopf", 4, 0x1D567, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B42[] = { {"lap", 3, 0x02A85, 0}, {"llarr", 5, 0x021C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B44[] = { {"boxdR", 5, 0x02552, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B46[] = { {"RightAngleBracket", 17, 0x027E9, 0}, {"lat", 3, 0x02AAB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B47[] = { {"Jfr", 3, 0x1D50D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B4C[] = { {"frac56", 6, 0x0215A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B4E[] = { {"frac58", 6, 0x0215D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B4F[] = { {"rarrhk", 6, 0x021AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B50[] = { {"lesdot", 6, 0x02A7F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B51[] = { {"ApplyFunction", 13, 0x02061, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B52[] = { {"NotGreaterTilde", 15, 0x02275, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B53[] = { {"Cedilla", 7, 0x000B8, 0}, {"curvearrowright", 15, 0x021B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B56[] = { {"rdsh", 4, 0x021B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B58[] = { {"larrb", 5, 0x021E4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B5C[] = { {"vrtri", 5, 0x022B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B5D[] = { {"nequiv", 6, 0x02262, 0}, {"wcirc", 5, 0x00175, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B5E[] = { {"boxdl", 5, 0x02510, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B63[] = { {"DoubleDownArrow", 15, 0x021D3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B64[] = { {"boxdr", 5, 0x0250C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B67[] = { {"pluscir", 7, 0x02A22, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B69[] = { {"longmapsto", 10, 0x027FC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B6B[] = { {"gnap", 4, 0x02A8A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B6D[] = { {"bigodot", 7, 0x02A00, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B72[] = { {"thickapprox", 11, 0x02248, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B73[] = { {"DotDot", 6, 0x020DC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B77[] = { {"incare", 6, 0x02105, 0}, {"rarrbfs", 7, 0x02920, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B78[] = { {"apos", 4, 0x00027, 0}, {"tbrk", 4, 0x023B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B7A[] = { {"grave", 5, 0x00060, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B7B[] = { {"Nscr", 4, 0x1D4A9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B7E[] = { {"rangle", 6, 0x027E9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B7F[] = { {"uArr", 4, 0x021D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B81[] = { {"Wopf", 4, 0x1D54E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B82[] = { {"doteq", 5, 0x02250, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B87[] = { {"times", 5, 0x000D7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B8D[] = { {"fflig", 5, 0x0FB00, 0}, {"lcy", 3, 0x0043B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B8F[] = { {"sub", 3, 0x02282, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B90[] = { {"frac78", 6, 0x0215E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B94[] = { {"xrarr", 5, 0x027F6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B98[] = { {"UpArrowDownArrow", 16, 0x021C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B99[] = { {"bbrktbrk", 8, 0x023B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B9A[] = { {"abreve", 6, 0x00103, 0}, {"lsaquo", 6, 0x02039, 0}, {"sum", 3, 0x02211, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B9C[] = { {"Eacute", 6, 0x000C9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_B9D[] = { {"sup", 3, 0x02283, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BA5[] = { {"ContourIntegral", 15, 0x0222E, 0}, {"DiacriticalDot", 14, 0x002D9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BA9[] = { {"trisb", 5, 0x029CD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BAE[] = { {"Hcirc", 5, 0x00124, 0}, {"lceil", 5, 0x02308, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BB2[] = { {"Zcaron", 6, 0x0017D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BB5[] = { {"looparrowleft", 13, 0x021AB, 0}, {"oelig", 5, 0x00153, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BB6[] = { {"LessSlantEqual", 14, 0x02A7D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BB7[] = { {"NegativeThinSpace", 17, 0x0200B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BBA[] = { {"boxhD", 5, 0x02565, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BBC[] = { {"omicron", 7, 0x003BF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BBD[] = { {"leg", 3, 0x022DA, 0}, {"rightthreetimes", 15, 0x022CC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BBF[] = { {"NotSucceedsSlantEqual", 21, 0x022E1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC1[] = { {"angmsdaa", 8, 0x029A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC2[] = { {"angmsdab", 8, 0x029A9, 0}, {"rAtail", 6, 0x0291C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC3[] = { {"angmsdac", 8, 0x029AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC4[] = { {"angmsdad", 8, 0x029AB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC5[] = { {"angmsdae", 8, 0x029AC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC6[] = { {"angmsdaf", 8, 0x029AD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC7[] = { {"angmsdag", 8, 0x029AE, 0}, {"leq", 3, 0x02264, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC8[] = { {"angmsdah", 8, 0x029AF, 0}, {"solbar", 6, 0x0233F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BC9[] = { {"Racute", 6, 0x00154, 0}, {"les", 3, 0x02A7D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BCB[] = { {"boxhU", 5, 0x02568, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BCE[] = { {"hcirc", 5, 0x00125, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BD1[] = { {"dscr", 4, 0x1D4B9, 0}, {"smashp", 6, 0x02A33, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BD7[] = { {"mopf", 4, 0x1D55E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BD8[] = { {"Rcedil", 6, 0x00156, 0}, {"dscy", 4, 0x00455, 0}, {"prap", 4, 0x02AB7, 0}, {"rarrlp", 6, 0x021AC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BD9[] = { {"Aogon", 5, 0x00104, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BDA[] = { {"boxhd", 5, 0x0252C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BDB[] = { {"subset", 6, 0x02282, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BDD[] = { {"lgE", 3, 0x02A91, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BDF[] = { {"epsilon", 7, 0x003B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BE1[] = { {"curarrm", 7, 0x0293C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BE2[] = { {"ratail", 6, 0x0291A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BE4[] = { {"DoubleLongLeftRightArrow", 24, 0x027FA, 0}, {"rhov", 4, 0x003F1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BE7[] = { {"LeftDoubleBracket", 17, 0x027E6, 0}, {"Lleftarrow", 10, 0x021DA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BE8[] = { {"Uuml", 4, 0x000DC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BE9[] = { {"lfr", 3, 0x1D529, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BEA[] = { {"minusdu", 7, 0x02A2A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BEB[] = { {"boxhu", 5, 0x02534, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BEF[] = { {"Ncy", 3, 0x0041D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BF0[] = { {"gneq", 4, 0x02A88, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BF1[] = { {"rangd", 5, 0x02992, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BF2[] = { {"range", 5, 0x029A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BF3[] = { {"lfloor", 6, 0x0230A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BF7[] = { {"NotSucceedsTilde", 16, 0x0227F, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BF9[] = { {"aogon", 5, 0x00105, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BFA[] = { {"NotGreaterSlantEqual", 20, 0x02A7E, 0x00338}, {"NotSquareSupersetEqual", 22, 0x022E3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_BFC[] = { {"profsurf", 8, 0x02313, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C02[] = { {"wedgeq", 6, 0x02259, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C0B[] = { {"Alpha", 5, 0x00391, 0}, {"DiacriticalDoubleAcute", 22, 0x002DD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C0C[] = { {"lltri", 5, 0x025FA, 0}, {"tcaron", 6, 0x00165, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C11[] = { {"Imacr", 5, 0x0012A, 0}, {"subseteq", 8, 0x02286, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C12[] = { {"Escr", 4, 0x02130, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C16[] = { {"lArr", 4, 0x021D0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C18[] = { {"Nopf", 4, 0x02115, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C1A[] = { {"rpar", 4, 0x00029, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C1D[] = { {"divonx", 6, 0x022C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C1E[] = { {"olcir", 5, 0x029BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C23[] = { {"lacute", 6, 0x0013A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C27[] = { {"zscr", 4, 0x1D4CF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C2B[] = { {"alpha", 5, 0x003B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C31[] = { {"imacr", 5, 0x0012B, 0}, {"vellip", 6, 0x022EE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C32[] = { {"lcedil", 6, 0x0013C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C33[] = { {"sime", 4, 0x02243, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C34[] = { {"empty", 5, 0x02205, 0}, {"imped", 5, 0x001B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C35[] = { {"simg", 4, 0x02A9E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C36[] = { {"kjcy", 4, 0x0045C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C3A[] = { {"siml", 4, 0x02A9D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C3E[] = { {"LessEqualGreater", 16, 0x022DA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C3F[] = { {"Ycirc", 5, 0x00176, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C40[] = { {"RoundImplies", 12, 0x02970, 0}, {"nvrArr", 6, 0x02903, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C43[] = { {"check", 5, 0x02713, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C44[] = { {"nlarr", 5, 0x0219A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C46[] = { {"middot", 6, 0x000B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C48[] = { {"par", 3, 0x02225, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C4A[] = { {"NotGreaterGreater", 17, 0x0226B, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C4B[] = { {"Nfr", 3, 0x1D511, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C4F[] = { {"nwArr", 5, 0x021D6, 0}, {"prec", 4, 0x0227A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C50[] = { {"Barv", 4, 0x02AE7, 0}, {"yacute", 6, 0x000FD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C54[] = { {"DoubleLeftRightArrow", 20, 0x021D4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C58[] = { {"Coproduct", 9, 0x02210, 0}, {"rarrpl", 6, 0x02945, 0}, {"subsim", 6, 0x02AC7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C5A[] = { {"ntgl", 4, 0x02279, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C5B[] = { {"LeftTriangleBar", 15, 0x029CF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C5F[] = { {"ycirc", 5, 0x00177, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C69[] = { {"doteqdot", 8, 0x02251, 0}, {"nang", 4, 0x02220, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C6B[] = { {"bigcap", 6, 0x022C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C6C[] = { {"CHcy", 4, 0x00427, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C6E[] = { {"dopf", 4, 0x1D555, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C72[] = { {"inodot", 6, 0x00131, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C76[] = { {"nvHarr", 6, 0x02904, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C77[] = { {"laemptyv", 8, 0x029B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C78[] = { {"bigcirc", 7, 0x025EF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C7A[] = { {"scnap", 5, 0x02ABA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C7B[] = { {"DownLeftVector", 14, 0x021BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C80[] = { {"race", 4, 0x0223D, 0x00331}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C82[] = { {"vartriangleright", 16, 0x022B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C89[] = { {"napE", 4, 0x02A70, 0x00338}, {"supedot", 7, 0x02AC4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C8E[] = { {"acE", 3, 0x0223E, 0x00333}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C91[] = { {"pcy", 3, 0x0043F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C93[] = { {"qprime", 6, 0x02057, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C94[] = { {"RightTeeVector", 14, 0x0295B, 0}, {"curlyvee", 8, 0x022CE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C95[] = { {"swarhk", 6, 0x02926, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_C98[] = { {"Atilde", 6, 0x000C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CA6[] = { {"bbrk", 4, 0x023B5, 0}, {"prnap", 5, 0x02AB9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CA8[] = { {"image", 5, 0x02111, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CA9[] = { {"sext", 4, 0x02736, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CAA[] = { {"ldquo", 5, 0x0201C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CAC[] = { {"NotLeftTriangleBar", 18, 0x029CF, 0x00338}, {"epsiv", 5, 0x003F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CAD[] = { {"CenterDot", 9, 0x000B7, 0}, {"acd", 3, 0x0223F, 0}, {"upuparrows", 10, 0x021C8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CAF[] = { {"Eopf", 4, 0x1D53C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CB0[] = { {"Jcirc", 5, 0x00134, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CB2[] = { {"smid", 4, 0x02223, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CB4[] = { {"bull", 4, 0x02022, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CB6[] = { {"rhard", 5, 0x021C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CB7[] = { {"nsupset", 7, 0x02283, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CBA[] = { {"npre", 4, 0x02AAF, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CBE[] = { {"qscr", 4, 0x1D4C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CC2[] = { {"acy", 3, 0x00430, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CC4[] = { {"lnE", 3, 0x02268, 0}, {"zopf", 4, 0x1D56B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CC5[] = { {"Ntilde", 6, 0x000D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CC7[] = { {"rharu", 5, 0x021C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CC8[] = { {"kappav", 6, 0x003F0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CC9[] = { {"timesb", 6, 0x022A0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CCB[] = { {"iiiint", 6, 0x02A0C, 0}, {"timesd", 6, 0x02A30, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CD0[] = { {"jcirc", 5, 0x00135, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CD2[] = { {"nsimeq", 6, 0x02244, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CD3[] = { {"Esim", 4, 0x02A73, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CD9[] = { {"Cap", 3, 0x022D2, 0}, {"bump", 4, 0x0224E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CDA[] = { {"lvnE", 4, 0x02268, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CDC[] = { {"rarrtl", 6, 0x021A3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CE4[] = { {"lne", 3, 0x02A87, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CE6[] = { {"commat", 6, 0x00040, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CE8[] = { {"hslash", 6, 0x0210F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CE9[] = { {"lthree", 6, 0x022CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CED[] = { {"Gcedil", 6, 0x00122, 0}, {"pfr", 3, 0x1D52D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CF1[] = { {"RightTriangleEqual", 18, 0x022B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CF2[] = { {"ngeqslant", 9, 0x02A7E, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CF3[] = { {"Rcy", 3, 0x00420, 0}, {"gimel", 5, 0x02137, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CF4[] = { {"curarr", 6, 0x021B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CFA[] = { {"ntlg", 4, 0x02278, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_CFF[] = { {"Rscr", 4, 0x0211B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D00[] = { {"urcrop", 6, 0x0230E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D06[] = { {"Poincareplane", 13, 0x0210C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D07[] = { {"NoBreak", 7, 0x02060, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D0B[] = { {"lcub", 4, 0x0007B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D0E[] = { {"nltri", 5, 0x022EA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D10[] = { {"blacktriangledown", 17, 0x025BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D11[] = { {"fjlig", 5, 0x00066, 0x0006A}, {"percnt", 6, 0x00025, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D12[] = { {"rightharpoondown", 16, 0x021C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D13[] = { {"LeftAngleBracket", 16, 0x027E8, 0}, {"npreceq", 7, 0x02AAF, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D15[] = { {"cupcup", 6, 0x02A4A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D18[] = { {"LeftVectorBar", 13, 0x02952, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D19[] = { {"NJcy", 4, 0x0040A, 0}, {"triangleright", 13, 0x025B9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D1A[] = { {"Tcedil", 6, 0x00162, 0}, {"loz", 3, 0x025CA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D1E[] = { {"afr", 3, 0x1D51E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D1F[] = { {"NotLessTilde", 12, 0x02274, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D20[] = { {"NotElement", 10, 0x02209, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D22[] = { {"NotHumpDownHump", 15, 0x0224E, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D24[] = { {"SquareSubsetEqual", 17, 0x02291, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D26[] = { {"nleqq", 5, 0x02266, 0x00338}, {"phi", 3, 0x003C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D2A[] = { {"NotRightTriangle", 16, 0x022EB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D32[] = { {"lhblk", 5, 0x02584, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D34[] = { {"caret", 5, 0x02041, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D35[] = { {"bsemi", 5, 0x0204F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D38[] = { {"aacute", 6, 0x000E1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D39[] = { {"mapsto", 6, 0x021A6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D3A[] = { {"Congruent", 9, 0x02261, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D3B[] = { {"Vdash", 5, 0x022A9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D3E[] = { {"longrightarrow", 14, 0x027F6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D42[] = { {"iinfin", 6, 0x029DC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D44[] = { {"EmptyVerySmallSquare", 20, 0x025AB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D49[] = { {"real", 4, 0x0211C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D4C[] = { {"SucceedsEqual", 13, 0x02AB0, 0}, {"utilde", 6, 0x00169, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D4F[] = { {"Rfr", 3, 0x0211C, 0}, {"tau", 3, 0x003C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D51[] = { {"Wedge", 5, 0x022C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D54[] = { {"piv", 3, 0x003D6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D55[] = { {"hscr", 4, 0x1D4BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D56[] = { {"subdot", 6, 0x02ABD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D57[] = { {"dsol", 4, 0x029F6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D5A[] = { {"prnE", 4, 0x02AB5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D5B[] = { {"qopf", 4, 0x1D562, 0}, {"vdash", 5, 0x022A2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D5F[] = { {"Star", 4, 0x022C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D63[] = { {"sqsupseteq", 10, 0x02292, 0}, {"zhcy", 4, 0x00436, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D65[] = { {"nacute", 6, 0x00144, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D69[] = { {"lessgtr", 7, 0x02276, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D6A[] = { {"nless", 5, 0x0226E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D6C[] = { {"RightTeeArrow", 13, 0x021A6, 0}, {"Yuml", 4, 0x00178, 0}, {"target", 6, 0x02316, 0}, {"upharpoonleft", 13, 0x021BF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D6F[] = { {"between", 7, 0x0226C, 0}, {"boxuL", 5, 0x0255B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D70[] = { {"TSHcy", 5, 0x0040B, 0}, {"lrm", 3, 0x0200E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D71[] = { {"excl", 4, 0x00021, 0}, {"hyphen", 6, 0x02010, 0}, {"mlcp", 4, 0x02ADB, 0}, {"wedge", 5, 0x02227, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D74[] = { {"ncedil", 6, 0x00146, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D75[] = { {"boxuR", 5, 0x02558, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D76[] = { {"Not", 3, 0x02AEC, 0}, {"epsi", 4, 0x003B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D7C[] = { {"disin", 5, 0x022F2, 0}, {"nRightarrow", 11, 0x021CF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D7D[] = { {"cylcty", 6, 0x0232D, 0}, {"neArr", 5, 0x021D7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D7E[] = { {"prnsim", 6, 0x022E8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D80[] = { {"Cfr", 3, 0x0212D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D81[] = { {"Beta", 4, 0x00392, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D85[] = { {"leftarrowtail", 13, 0x021A2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D87[] = { {"parsl", 5, 0x02AFD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D89[] = { {"xwedge", 6, 0x022C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D8A[] = { {"olcross", 7, 0x029BB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D8C[] = { {"boxvH", 5, 0x0256A, 0}, {"lsh", 3, 0x021B0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D8D[] = { {"circledR", 8, 0x000AE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D8E[] = { {"Rho", 3, 0x003A1, 0}, {"circledS", 8, 0x024C8, 0}, {"cupor", 5, 0x02A45, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D8F[] = { {"Ugrave", 6, 0x000D9, 0}, {"boxul", 5, 0x02518, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D90[] = { {"boxvL", 5, 0x02561, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D91[] = { {"sqcup", 5, 0x02294, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D93[] = { {"rect", 4, 0x025AD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D94[] = { {"mldr", 4, 0x02026, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D95[] = { {"boxur", 5, 0x02514, 0}, {"digamma", 7, 0x003DD, 0}, {"tcy", 3, 0x00442, 0}, {"urcorner", 8, 0x0231D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D96[] = { {"DoubleLeftArrow", 15, 0x021D0, 0}, {"Iscr", 4, 0x02110, 0}, {"boxvR", 5, 0x0255E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D98[] = { {"ulcorn", 6, 0x0231C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D9A[] = { {"prod", 4, 0x0220F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_D9C[] = { {"Ropf", 4, 0x0211D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DA0[] = { {"rmoustache", 10, 0x023B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DA5[] = { {"NegativeMediumSpace", 19, 0x0200B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DA6[] = { {"prop", 4, 0x0221D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DA8[] = { {"TScy", 4, 0x00426, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DA9[] = { {"xsqcup", 6, 0x02A06, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DAC[] = { {"bemptyv", 7, 0x029B0, 0}, {"boxvh", 5, 0x0253C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DB0[] = { {"boxvl", 5, 0x02524, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DB3[] = { {"NotTildeFullEqual", 17, 0x02247, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DB4[] = { {"subE", 4, 0x02AC5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DB6[] = { {"boxvr", 5, 0x0251C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DB7[] = { {"bigvee", 6, 0x022C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DB9[] = { {"Chi", 3, 0x003A7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DBC[] = { {"circeq", 6, 0x02257, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DBE[] = { {"emsp13", 6, 0x02004, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DBF[] = { {"emsp14", 6, 0x02005, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DC2[] = { {"ouml", 4, 0x000F6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DC3[] = { {"RightArrowBar", 13, 0x021E5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DC6[] = { {"ecy", 3, 0x0044D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DC8[] = { {"succneqq", 8, 0x02AB6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DCA[] = { {"npart", 5, 0x02202, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DCF[] = { {"Element", 7, 0x02208, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DD1[] = { {"Edot", 4, 0x00116, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DD3[] = { {"RightUpDownVector", 17, 0x0294F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DD4[] = { {"sube", 4, 0x02286, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DD5[] = { {"jsercy", 6, 0x00458, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DD7[] = { {"varrho", 6, 0x003F1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DD9[] = { {"subsub", 6, 0x02AD5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DDC[] = { {"Dcaron", 6, 0x0010E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DDD[] = { {"Eogon", 5, 0x00118, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DE4[] = { {"geqslant", 8, 0x02A7E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DE6[] = { {"rdldhar", 7, 0x02969, 0}, {"zdot", 4, 0x0017C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DE7[] = { {"subsup", 6, 0x02AD3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DE9[] = { {"ograve", 6, 0x000F2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DEB[] = { {"ReverseElement", 14, 0x0220B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DED[] = { {"drcorn", 6, 0x0231F, 0}, {"rang", 4, 0x027E9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DF1[] = { {"tfr", 3, 0x1D531, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DF2[] = { {"hopf", 4, 0x1D559, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DF3[] = { {"succ", 4, 0x0227B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DF6[] = { {"otimes", 6, 0x02297, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DF7[] = { {"Vcy", 3, 0x00412, 0}, {"ltquest", 7, 0x02A7B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DF9[] = { {"lozenge", 7, 0x025CA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DFB[] = { {"LeftDownVector", 14, 0x021C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_DFD[] = { {"eogon", 5, 0x00119, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E03[] = { {"amp", 3, 0x00026, 0}, {"lopar", 5, 0x02985, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E04[] = { {"loplus", 6, 0x02A2D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E08[] = { {"NotTilde", 8, 0x02241, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E09[] = { {"CounterClockwiseContourIntegral", 31, 0x02233, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E0C[] = { {"InvisibleTimes", 14, 0x02062, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E11[] = { {"lesdotor", 8, 0x02A83, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E18[] = { {"and", 3, 0x02227, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E1B[] = { {"RightUpVector", 13, 0x021BE, 0}, {"ang", 3, 0x02220, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E1C[] = { {"DoubleRightTee", 14, 0x022A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E1D[] = { {"LeftUpVectorBar", 15, 0x02958, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E1E[] = { {"smte", 4, 0x02AAC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E20[] = { {"Iacute", 6, 0x000CD, 0}, {"triminus", 8, 0x02A3A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E22[] = { {"efr", 3, 0x1D522, 0}, {"iiint", 5, 0x0222D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E23[] = { {"ctdot", 5, 0x022EF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E24[] = { {"mnplus", 6, 0x02213, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E25[] = { {"Vee", 3, 0x022C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E28[] = { {"Gcy", 3, 0x00413, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E2A[] = { {"lurdshar", 8, 0x0294A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E2C[] = { {"smeparsl", 8, 0x029E4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E2F[] = { {"DoubleVerticalBar", 17, 0x02225, 0}, {"iecy", 4, 0x00435, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E30[] = { {"udblac", 6, 0x00171, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E32[] = { {"gtquest", 7, 0x02A7C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E33[] = { {"Iopf", 4, 0x1D540, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E35[] = { {"bsime", 5, 0x022CD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E36[] = { {"RightVector", 11, 0x021C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E37[] = { {"NotGreaterLess", 14, 0x02279, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E3B[] = { {"apE", 3, 0x02A70, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E41[] = { {"CupCap", 6, 0x0224D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E42[] = { {"uscr", 4, 0x1D4CA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E43[] = { {"erDot", 5, 0x02253, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E44[] = { {"egs", 3, 0x02A96, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E48[] = { {"rlarr", 5, 0x021C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E4C[] = { {"prE", 3, 0x02AB3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E4E[] = { {"QUOT", 4, 0x00022, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E53[] = { {"Vfr", 3, 0x1D519, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E55[] = { {"cupbrcap", 8, 0x02A48, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E57[] = { {"intercal", 8, 0x022BA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E58[] = { {"imath", 5, 0x00131, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E59[] = { {"RightUpTeeVector", 16, 0x0295C, 0}, {"trie", 4, 0x0225C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E5B[] = { {"ape", 3, 0x0224A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E5D[] = { {"softcy", 6, 0x0044C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E5E[] = { {"rarrb", 5, 0x021E5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E5F[] = { {"FilledSmallSquare", 17, 0x025FC, 0}, {"rarrc", 5, 0x02933, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E60[] = { {"Superset", 8, 0x02283, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E61[] = { {"hoarr", 5, 0x021FF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E63[] = { {"DownRightVectorBar", 18, 0x02957, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E64[] = { {"brvbar", 6, 0x000A6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E65[] = { {"ecolon", 6, 0x02255, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E66[] = { {"GreaterLess", 11, 0x02277, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E6A[] = { {"nrArr", 5, 0x021CF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E6C[] = { {"pre", 3, 0x02AAF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E6F[] = { {"aleph", 5, 0x02135, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E70[] = { {"DiacriticalAcute", 16, 0x000B4, 0}, {"SmallCircle", 11, 0x02218, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E71[] = { {"parsim", 6, 0x02AF3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E73[] = { {"rarrw", 5, 0x0219D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E78[] = { {"caron", 5, 0x002C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E7A[] = { {"cacute", 6, 0x00107, 0}, {"lagran", 6, 0x02112, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E7C[] = { {"rarr", 4, 0x02192, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E80[] = { {"Rrightarrow", 11, 0x021DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E83[] = { {"Vscr", 4, 0x1D4B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E84[] = { {"Gfr", 3, 0x1D50A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E89[] = { {"ccedil", 6, 0x000E7, 0}, {"propto", 6, 0x0221D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E8E[] = { {"zwnj", 4, 0x0200C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E91[] = { {"psi", 3, 0x003C8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E99[] = { {"infin", 5, 0x0221E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_E9C[] = { {"circledcirc", 11, 0x0229A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EA1[] = { {"Proportion", 10, 0x02237, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EA2[] = { {"subseteqq", 9, 0x02AC5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EA4[] = { {"nGtv", 4, 0x0226B, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EA8[] = { {"macr", 4, 0x000AF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EA9[] = { {"orslope", 7, 0x02A57, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EB1[] = { {"frown", 5, 0x02322, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EB2[] = { {"Iota", 4, 0x00399, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EB4[] = { {"rceil", 5, 0x02309, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EB7[] = { {"spadesuit", 9, 0x02660, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EB8[] = { {"sstarf", 6, 0x022C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ECA[] = { {"icy", 3, 0x00438, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ECD[] = { {"ast", 3, 0x0002A, 0}, {"nmid", 4, 0x02224, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ECF[] = { {"bowtie", 6, 0x022C8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ED1[] = { {"thetav", 6, 0x003D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ED7[] = { {"vangrt", 6, 0x0299C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ED8[] = { {"numsp", 5, 0x02007, 0}, {"triplus", 7, 0x02A39, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_ED9[] = { {"lscr", 4, 0x1D4C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EDA[] = { {"pointint", 8, 0x02A15, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EDB[] = { {"Theta", 5, 0x00398, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EDF[] = { {"rightrightarrows", 16, 0x021C9, 0}, {"uopf", 4, 0x1D566, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EE2[] = { {"ell", 3, 0x02113, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EE4[] = { {"cuepr", 5, 0x022DE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EE5[] = { {"NotVerticalBar", 14, 0x02224, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EE7[] = { {"xnis", 4, 0x022FB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EE9[] = { {"els", 3, 0x02A95, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EEF[] = { {"DDotrahd", 8, 0x02911, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EF1[] = { {"larrbfs", 7, 0x0291F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EF2[] = { {"Rsh", 3, 0x021B1, 0}, {"boxplus", 7, 0x0229E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EF4[] = { {"swarr", 5, 0x02199, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EF5[] = { {"gvnE", 4, 0x02269, 0x0FE00}, {"xfr", 3, 0x1D535, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EF9[] = { {"ldca", 4, 0x02936, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EFB[] = { {"NotPrecedesSlantEqual", 21, 0x022E0, 0}, {"YAcy", 4, 0x0042F, 0}, {"Zcy", 3, 0x00417, 0}, {"andslope", 8, 0x02A58, 0}, {"numero", 6, 0x02116, 0}, {"theta", 5, 0x003B8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EFE[] = { {"mapstoup", 8, 0x021A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_EFF[] = { {"bigcup", 6, 0x022C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F03[] = { {"nesear", 6, 0x02928, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F05[] = { {"lesssim", 7, 0x02272, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F08[] = { {"DownArrow", 9, 0x02193, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F0B[] = { {"orarr", 5, 0x021BB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F0F[] = { {"ccaps", 5, 0x02A4D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F10[] = { {"xdtri", 5, 0x025BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F11[] = { {"xcap", 4, 0x022C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F13[] = { {"downdownarrows", 14, 0x021CA, 0}, {"nisd", 4, 0x022FA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F14[] = { {"VerticalBar", 11, 0x02223, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F15[] = { {"TRADE", 5, 0x02122, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F17[] = { {"Omacr", 5, 0x0014C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F18[] = { {"top", 3, 0x022A4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F19[] = { {"LeftRightArrow", 14, 0x02194, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F1A[] = { {"Mscr", 4, 0x02133, 0}, {"iff", 3, 0x021D4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F1F[] = { {"downharpoonleft", 15, 0x021C3, 0}, {"eng", 3, 0x0014B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F20[] = { {"Vopf", 4, 0x1D54D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F26[] = { {"ifr", 3, 0x1D526, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F28[] = { {"Downarrow", 9, 0x021D3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F2C[] = { {"Kcy", 3, 0x0041A, 0}, {"angle", 5, 0x02220, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F2F[] = { {"lescc", 5, 0x02AA8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F30[] = { {"lesseqqgtr", 10, 0x02A8B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F31[] = { {"bigstar", 7, 0x02605, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F33[] = { {"ddagger", 7, 0x02021, 0}, {"nltrie", 6, 0x022EC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F37[] = { {"omacr", 5, 0x0014D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F38[] = { {"cuesc", 5, 0x022DF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F40[] = { {"circlearrowright", 16, 0x021BB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F41[] = { {"ngeqq", 5, 0x02267, 0x00338}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F44[] = { {"squf", 4, 0x025AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F46[] = { {"rtri", 4, 0x025B9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F47[] = { {"VerticalLine", 12, 0x0007C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F48[] = { {"downarrow", 9, 0x02193, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F4B[] = { {"Scaron", 6, 0x00160, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F4C[] = { {"tstrok", 6, 0x00167, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F50[] = { {"wreath", 6, 0x02240, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F51[] = { {"exponentiale", 12, 0x02147, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F55[] = { {"Idot", 4, 0x00130, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F57[] = { {"Zfr", 3, 0x02128, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F58[] = { {"bnot", 4, 0x02310, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F5B[] = { {"infintie", 8, 0x029DD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F5D[] = { {"angrtvbd", 8, 0x0299D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F5F[] = { {"prurel", 6, 0x022B0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F60[] = { {"gbreve", 6, 0x0011F, 0}, {"rsaquo", 6, 0x0203A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F62[] = { {"sung", 4, 0x0266A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F67[] = { {"lvertneqq", 9, 0x02268, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F68[] = { {"lnsim", 5, 0x022E6, 0}, {"searrow", 7, 0x02198, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F69[] = { {"nsubset", 7, 0x02282, 0x020D2}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F6D[] = { {"Cup", 3, 0x022D3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F6E[] = { {"Lmidot", 6, 0x0013F, 0}, {"sup1", 4, 0x000B9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F6F[] = { {"Delta", 5, 0x00394, 0}, {"sbquo", 5, 0x0201A, 0}, {"sup2", 4, 0x000B2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F70[] = { {"cscr", 4, 0x1D4B8, 0}, {"nsubseteqq", 10, 0x02AC5, 0x00338}, {"sup3", 4, 0x000B3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F71[] = { {"Kcedil", 6, 0x00136, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F72[] = { {"plussim", 7, 0x02A26, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F74[] = { {"KHcy", 4, 0x00425, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F75[] = { {"OElig", 5, 0x00152, 0}, {"simdot", 6, 0x02A6A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F76[] = { {"lopf", 4, 0x1D55D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F77[] = { {"boxbox", 6, 0x029C9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F78[] = { {"bepsi", 5, 0x003F6, 0}, {"lbarr", 5, 0x0290C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F79[] = { {"lnapprox", 8, 0x02A89, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F81[] = { {"sdotb", 5, 0x022A1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F82[] = { {"measuredangle", 13, 0x02221, 0}, {"supE", 4, 0x02AC6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F83[] = { {"map", 3, 0x021A6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F84[] = { {"sdote", 5, 0x02A66, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F86[] = { {"diamondsuit", 11, 0x02666, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F88[] = { {"Kfr", 3, 0x1D50E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F8B[] = { {"imagline", 8, 0x02110, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F8F[] = { {"delta", 5, 0x003B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F91[] = { {"mapstodown", 10, 0x021A7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F93[] = { {"eqvparsl", 8, 0x029E5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F95[] = { {"UpArrow", 7, 0x02191, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F9A[] = { {"imagpart", 8, 0x02111, 0}, {"lsim", 4, 0x02272, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F9C[] = { {"trianglelefteq", 14, 0x022B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_F9F[] = { {"isindot", 7, 0x022F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FA0[] = { {"LeftUpDownVector", 16, 0x02951, 0}, {"curvearrowleft", 14, 0x021B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FA1[] = { {"Diamond", 7, 0x022C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FA2[] = { {"supe", 4, 0x02287, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FA3[] = { {"nearrow", 7, 0x02197, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FA9[] = { {"easter", 6, 0x02A6E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FB0[] = { {"rdquo", 5, 0x0201D, 0}, {"subsetneqq", 10, 0x02ACB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FB1[] = { {"Dscr", 4, 0x1D49F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FB4[] = { {"comp", 4, 0x02201, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FB5[] = { {"Uparrow", 7, 0x021D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FB6[] = { {"coloneq", 7, 0x02254, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FB7[] = { {"Mopf", 4, 0x1D544, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FB9[] = { {"rfloor", 6, 0x0230B, 0}, {"varsubsetneqq", 13, 0x02ACB, 0x0FE00}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FBC[] = { {"eacute", 6, 0x000E9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FC2[] = { {"shortparallel", 13, 0x02225, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FC4[] = { {"male", 4, 0x02642, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FC6[] = { {"yscr", 4, 0x1D4CE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FCA[] = { {"xharr", 5, 0x027F7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FCC[] = { {"cong", 4, 0x02245, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FCE[] = { {"mcy", 3, 0x0043C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FCF[] = { {"Upsilon", 7, 0x003A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FD0[] = { {"block", 5, 0x02588, 0}, {"maltese", 7, 0x02720, 0}, {"ordf", 4, 0x000AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FD2[] = { {"zcaron", 6, 0x0017E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FD3[] = { {"malt", 4, 0x02720, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FD6[] = { {"loang", 5, 0x027EC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FD7[] = { {"ordm", 4, 0x000BA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FDD[] = { {"NegativeVeryThinSpace", 21, 0x0200B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FDF[] = { {"eta", 3, 0x003B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FE1[] = { {"Iogon", 5, 0x0012E, 0}, {"drbkarow", 8, 0x02910, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FE6[] = { {"eth", 3, 0x000F0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FE9[] = { {"racute", 6, 0x00155, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FEA[] = { {"cwconint", 8, 0x02232, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FEB[] = { {"egsdot", 6, 0x02A98, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FF5[] = { {"MinusPlus", 9, 0x02213, 0}, {"ring", 4, 0x002DA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FF8[] = { {"rcedil", 6, 0x00157, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FFC[] = { {"timesbar", 8, 0x02A31, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html5_FFE[] = { {"GreaterEqualLess", 16, 0x022DB, 0}, {NULL, 0, 0, 0} }; + +static const entity_cp_map *const ht_buckets_html5[] = { + ht_bucket_html5_000, ht_bucket_html5_001, ht_bucket_empty, ht_bucket_html5_003, + ht_bucket_empty, ht_bucket_html5_005, ht_bucket_empty, ht_bucket_html5_007, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_00D, ht_bucket_empty, ht_bucket_html5_00F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_017, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_020, ht_bucket_empty, ht_bucket_html5_022, ht_bucket_empty, + ht_bucket_html5_024, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_027, + ht_bucket_html5_028, ht_bucket_html5_029, ht_bucket_html5_02A, ht_bucket_html5_02B, + ht_bucket_html5_02C, ht_bucket_empty, ht_bucket_html5_02E, ht_bucket_empty, + ht_bucket_html5_030, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_034, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_038, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_040, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_047, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_04C, ht_bucket_empty, ht_bucket_html5_04E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_051, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_059, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_05D, ht_bucket_empty, ht_bucket_html5_05F, + ht_bucket_html5_060, ht_bucket_html5_061, ht_bucket_empty, ht_bucket_html5_063, + ht_bucket_html5_064, ht_bucket_html5_065, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_069, ht_bucket_html5_06A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_06D, ht_bucket_html5_06E, ht_bucket_html5_06F, + ht_bucket_empty, ht_bucket_html5_071, ht_bucket_empty, ht_bucket_html5_073, + ht_bucket_html5_074, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_07A, ht_bucket_html5_07B, + ht_bucket_html5_07C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_07F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_082, ht_bucket_empty, + ht_bucket_html5_084, ht_bucket_html5_085, ht_bucket_html5_086, ht_bucket_empty, + ht_bucket_html5_088, ht_bucket_html5_089, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_08C, ht_bucket_empty, ht_bucket_html5_08E, ht_bucket_empty, + ht_bucket_html5_090, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_094, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_097, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_09E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_0A4, ht_bucket_empty, ht_bucket_html5_0A6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_0AB, + ht_bucket_html5_0AC, ht_bucket_html5_0AD, ht_bucket_html5_0AE, ht_bucket_html5_0AF, + ht_bucket_html5_0B0, ht_bucket_empty, ht_bucket_html5_0B2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_0B8, ht_bucket_html5_0B9, ht_bucket_html5_0BA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_0C0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_0C4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_0CE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_0D1, ht_bucket_html5_0D2, ht_bucket_html5_0D3, + ht_bucket_empty, ht_bucket_html5_0D5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_0DF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_0E5, ht_bucket_html5_0E6, ht_bucket_empty, + ht_bucket_html5_0E8, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_0EC, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_0EF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_0F3, + ht_bucket_html5_0F4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_0FA, ht_bucket_html5_0FB, + ht_bucket_empty, ht_bucket_html5_0FD, ht_bucket_html5_0FE, ht_bucket_empty, + ht_bucket_html5_100, ht_bucket_html5_101, ht_bucket_empty, ht_bucket_html5_103, + ht_bucket_empty, ht_bucket_html5_105, ht_bucket_html5_106, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_109, ht_bucket_html5_10A, ht_bucket_html5_10B, + ht_bucket_empty, ht_bucket_html5_10D, ht_bucket_html5_10E, ht_bucket_html5_10F, + ht_bucket_html5_110, ht_bucket_html5_111, ht_bucket_empty, ht_bucket_html5_113, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_116, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_11B, + ht_bucket_html5_11C, ht_bucket_empty, ht_bucket_html5_11E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_121, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_124, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_129, ht_bucket_html5_12A, ht_bucket_empty, + ht_bucket_html5_12C, ht_bucket_empty, ht_bucket_html5_12E, ht_bucket_html5_12F, + ht_bucket_html5_130, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_134, ht_bucket_html5_135, ht_bucket_empty, ht_bucket_html5_137, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_13A, ht_bucket_html5_13B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_145, ht_bucket_empty, ht_bucket_html5_147, + ht_bucket_empty, ht_bucket_html5_149, ht_bucket_empty, ht_bucket_html5_14B, + ht_bucket_html5_14C, ht_bucket_empty, ht_bucket_html5_14E, ht_bucket_html5_14F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_158, ht_bucket_html5_159, ht_bucket_empty, ht_bucket_html5_15B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_15E, ht_bucket_html5_15F, + ht_bucket_empty, ht_bucket_html5_161, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_164, ht_bucket_html5_165, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_168, ht_bucket_empty, ht_bucket_html5_16A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_170, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_173, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_17A, ht_bucket_html5_17B, + ht_bucket_html5_17C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_17F, + ht_bucket_empty, ht_bucket_html5_181, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_189, ht_bucket_empty, ht_bucket_html5_18B, + ht_bucket_html5_18C, ht_bucket_empty, ht_bucket_html5_18E, ht_bucket_html5_18F, + ht_bucket_html5_190, ht_bucket_html5_191, ht_bucket_empty, ht_bucket_html5_193, + ht_bucket_empty, ht_bucket_html5_195, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_19A, ht_bucket_empty, + ht_bucket_html5_19C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_19F, + ht_bucket_html5_1A0, ht_bucket_html5_1A1, ht_bucket_html5_1A2, ht_bucket_html5_1A3, + ht_bucket_html5_1A4, ht_bucket_html5_1A5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_1A8, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_1AB, + ht_bucket_html5_1AC, ht_bucket_html5_1AD, ht_bucket_html5_1AE, ht_bucket_html5_1AF, + ht_bucket_html5_1B0, ht_bucket_empty, ht_bucket_html5_1B2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_1B5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_1B9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_1BD, ht_bucket_html5_1BE, ht_bucket_empty, + ht_bucket_html5_1C0, ht_bucket_html5_1C1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_1C4, ht_bucket_empty, ht_bucket_html5_1C6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_1C9, ht_bucket_html5_1CA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_1CD, ht_bucket_html5_1CE, ht_bucket_empty, + ht_bucket_html5_1D0, ht_bucket_html5_1D1, ht_bucket_html5_1D2, ht_bucket_empty, + ht_bucket_html5_1D4, ht_bucket_html5_1D5, ht_bucket_html5_1D6, ht_bucket_empty, + ht_bucket_html5_1D8, ht_bucket_html5_1D9, ht_bucket_html5_1DA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_1DF, + ht_bucket_html5_1E0, ht_bucket_html5_1E1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_1E5, ht_bucket_html5_1E6, ht_bucket_html5_1E7, + ht_bucket_html5_1E8, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_1EB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_1EF, + ht_bucket_html5_1F0, ht_bucket_empty, ht_bucket_html5_1F2, ht_bucket_empty, + ht_bucket_html5_1F4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_1F8, ht_bucket_html5_1F9, ht_bucket_html5_1FA, ht_bucket_empty, + ht_bucket_html5_1FC, ht_bucket_empty, ht_bucket_html5_1FE, ht_bucket_html5_1FF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_205, ht_bucket_empty, ht_bucket_html5_207, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_20E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_212, ht_bucket_html5_213, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_219, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_21D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_220, ht_bucket_empty, ht_bucket_html5_222, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_227, + ht_bucket_empty, ht_bucket_html5_229, ht_bucket_empty, ht_bucket_html5_22B, + ht_bucket_html5_22C, ht_bucket_html5_22D, ht_bucket_empty, ht_bucket_html5_22F, + ht_bucket_html5_230, ht_bucket_empty, ht_bucket_html5_232, ht_bucket_empty, + ht_bucket_html5_234, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_239, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_23C, ht_bucket_html5_23D, ht_bucket_html5_23E, ht_bucket_empty, + ht_bucket_html5_240, ht_bucket_html5_241, ht_bucket_html5_242, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_246, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_249, ht_bucket_html5_24A, ht_bucket_html5_24B, + ht_bucket_empty, ht_bucket_html5_24D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_251, ht_bucket_html5_252, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_257, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_25A, ht_bucket_html5_25B, + ht_bucket_html5_25C, ht_bucket_html5_25D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_263, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_26A, ht_bucket_html5_26B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_26E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_274, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_277, + ht_bucket_html5_278, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_27C, ht_bucket_empty, ht_bucket_html5_27E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_283, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_28A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_294, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_297, + ht_bucket_html5_298, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_29D, ht_bucket_empty, ht_bucket_html5_29F, + ht_bucket_html5_2A0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_2A9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_2AE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_2B1, ht_bucket_html5_2B2, ht_bucket_html5_2B3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_2B9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_2BF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_2C4, ht_bucket_html5_2C5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_2CE, ht_bucket_html5_2CF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_2D3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_2DA, ht_bucket_html5_2DB, + ht_bucket_html5_2DC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_2E3, + ht_bucket_html5_2E4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_2EB, + ht_bucket_html5_2EC, ht_bucket_empty, ht_bucket_html5_2EE, ht_bucket_empty, + ht_bucket_html5_2F0, ht_bucket_empty, ht_bucket_html5_2F2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_2F8, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_300, ht_bucket_html5_301, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_304, ht_bucket_html5_305, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_308, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_30B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_30F, + ht_bucket_empty, ht_bucket_html5_311, ht_bucket_empty, ht_bucket_html5_313, + ht_bucket_empty, ht_bucket_html5_315, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_319, ht_bucket_html5_31A, ht_bucket_html5_31B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_326, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_329, ht_bucket_html5_32A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_32D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_330, ht_bucket_html5_331, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_336, ht_bucket_empty, + ht_bucket_html5_338, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_33B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_33F, + ht_bucket_html5_340, ht_bucket_html5_341, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_347, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_34D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_350, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_356, ht_bucket_empty, + ht_bucket_html5_358, ht_bucket_html5_359, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_35D, ht_bucket_empty, ht_bucket_html5_35F, + ht_bucket_empty, ht_bucket_html5_361, ht_bucket_empty, ht_bucket_html5_363, + ht_bucket_empty, ht_bucket_html5_365, ht_bucket_empty, ht_bucket_html5_367, + ht_bucket_empty, ht_bucket_html5_369, ht_bucket_html5_36A, ht_bucket_html5_36B, + ht_bucket_empty, ht_bucket_html5_36D, ht_bucket_html5_36E, ht_bucket_html5_36F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_372, ht_bucket_empty, + ht_bucket_html5_374, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_378, ht_bucket_empty, ht_bucket_html5_37A, ht_bucket_empty, + ht_bucket_html5_37C, ht_bucket_html5_37D, ht_bucket_html5_37E, ht_bucket_html5_37F, + ht_bucket_html5_380, ht_bucket_empty, ht_bucket_html5_382, ht_bucket_html5_383, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_386, ht_bucket_html5_387, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_38A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_38D, ht_bucket_html5_38E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_391, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_394, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_397, + ht_bucket_html5_398, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_39C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_39F, + ht_bucket_html5_3A0, ht_bucket_html5_3A1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_3A4, ht_bucket_html5_3A5, ht_bucket_html5_3A6, ht_bucket_html5_3A7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_3AC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_3B2, ht_bucket_empty, + ht_bucket_html5_3B4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_3BF, + ht_bucket_html5_3C0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_3C4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_3C9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_3CD, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_3D0, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_3D3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_3D9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_3DE, ht_bucket_empty, + ht_bucket_html5_3E0, ht_bucket_html5_3E1, ht_bucket_empty, ht_bucket_html5_3E3, + ht_bucket_html5_3E4, ht_bucket_empty, ht_bucket_html5_3E6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_3E9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_3ED, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_3F1, ht_bucket_html5_3F2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_3F7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_3FC, ht_bucket_empty, ht_bucket_html5_3FE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_402, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_405, ht_bucket_empty, ht_bucket_html5_407, + ht_bucket_empty, ht_bucket_html5_409, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_40E, ht_bucket_html5_40F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_413, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_41A, ht_bucket_html5_41B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_421, ht_bucket_empty, ht_bucket_html5_423, + ht_bucket_html5_424, ht_bucket_html5_425, ht_bucket_html5_426, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_429, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_42C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_42F, + ht_bucket_html5_430, ht_bucket_empty, ht_bucket_html5_432, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_436, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_439, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_43C, ht_bucket_html5_43D, ht_bucket_html5_43E, ht_bucket_html5_43F, + ht_bucket_html5_440, ht_bucket_html5_441, ht_bucket_empty, ht_bucket_html5_443, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_446, ht_bucket_html5_447, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_44A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_44F, + ht_bucket_html5_450, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_454, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_457, + ht_bucket_html5_458, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_45D, ht_bucket_empty, ht_bucket_html5_45F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_465, ht_bucket_html5_466, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_469, ht_bucket_html5_46A, ht_bucket_html5_46B, + ht_bucket_empty, ht_bucket_html5_46D, ht_bucket_empty, ht_bucket_html5_46F, + ht_bucket_html5_470, ht_bucket_html5_471, ht_bucket_html5_472, ht_bucket_html5_473, + ht_bucket_empty, ht_bucket_html5_475, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_479, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_47C, ht_bucket_html5_47D, ht_bucket_empty, ht_bucket_html5_47F, + ht_bucket_html5_480, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_485, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_488, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_48C, ht_bucket_empty, ht_bucket_html5_48E, ht_bucket_html5_48F, + ht_bucket_html5_490, ht_bucket_html5_491, ht_bucket_empty, ht_bucket_html5_493, + ht_bucket_empty, ht_bucket_html5_495, ht_bucket_html5_496, ht_bucket_empty, + ht_bucket_html5_498, ht_bucket_html5_499, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_49F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4A2, ht_bucket_empty, + ht_bucket_html5_4A4, ht_bucket_empty, ht_bucket_html5_4A6, ht_bucket_html5_4A7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4AA, ht_bucket_html5_4AB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4AE, ht_bucket_html5_4AF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4B2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4B6, ht_bucket_empty, + ht_bucket_html5_4B8, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_4BC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_4C0, ht_bucket_empty, ht_bucket_html5_4C2, ht_bucket_html5_4C3, + ht_bucket_html5_4C4, ht_bucket_html5_4C5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_4C8, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4CB, + ht_bucket_empty, ht_bucket_html5_4CD, ht_bucket_empty, ht_bucket_html5_4CF, + ht_bucket_html5_4D0, ht_bucket_empty, ht_bucket_html5_4D2, ht_bucket_html5_4D3, + ht_bucket_html5_4D4, ht_bucket_html5_4D5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_4D8, ht_bucket_empty, ht_bucket_html5_4DA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4DE, ht_bucket_html5_4DF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4E3, + ht_bucket_html5_4E4, ht_bucket_empty, ht_bucket_html5_4E6, ht_bucket_html5_4E7, + ht_bucket_html5_4E8, ht_bucket_html5_4E9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_4ED, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_4F1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4F7, + ht_bucket_empty, ht_bucket_html5_4F9, ht_bucket_empty, ht_bucket_html5_4FB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_4FE, ht_bucket_empty, + ht_bucket_html5_500, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_504, ht_bucket_empty, ht_bucket_html5_506, ht_bucket_html5_507, + ht_bucket_empty, ht_bucket_html5_509, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_50E, ht_bucket_html5_50F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_513, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_516, ht_bucket_empty, + ht_bucket_html5_518, ht_bucket_html5_519, ht_bucket_empty, ht_bucket_html5_51B, + ht_bucket_html5_51C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_524, ht_bucket_html5_525, ht_bucket_html5_526, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_52F, + ht_bucket_html5_530, ht_bucket_empty, ht_bucket_html5_532, ht_bucket_html5_533, + ht_bucket_html5_534, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_53B, + ht_bucket_html5_53C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_53F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_542, ht_bucket_html5_543, + ht_bucket_empty, ht_bucket_html5_545, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_548, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_54F, + ht_bucket_html5_550, ht_bucket_html5_551, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_557, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_55B, + ht_bucket_empty, ht_bucket_html5_55D, ht_bucket_empty, ht_bucket_html5_55F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_564, ht_bucket_html5_565, ht_bucket_html5_566, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_56C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_56F, + ht_bucket_html5_570, ht_bucket_html5_571, ht_bucket_html5_572, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_575, ht_bucket_html5_576, ht_bucket_html5_577, + ht_bucket_html5_578, ht_bucket_empty, ht_bucket_html5_57A, ht_bucket_html5_57B, + ht_bucket_html5_57C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_580, ht_bucket_empty, ht_bucket_html5_582, ht_bucket_html5_583, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_586, ht_bucket_empty, + ht_bucket_html5_588, ht_bucket_html5_589, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_58D, ht_bucket_html5_58E, ht_bucket_html5_58F, + ht_bucket_html5_590, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_595, ht_bucket_html5_596, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_59A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_59D, ht_bucket_empty, ht_bucket_html5_59F, + ht_bucket_html5_5A0, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_5A3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_5A6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_5A9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_5AC, ht_bucket_html5_5AD, ht_bucket_html5_5AE, ht_bucket_empty, + ht_bucket_html5_5B0, ht_bucket_html5_5B1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_5B5, ht_bucket_html5_5B6, ht_bucket_html5_5B7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_5BB, + ht_bucket_html5_5BC, ht_bucket_html5_5BD, ht_bucket_empty, ht_bucket_html5_5BF, + ht_bucket_html5_5C0, ht_bucket_html5_5C1, ht_bucket_html5_5C2, ht_bucket_empty, + ht_bucket_html5_5C4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_5D0, ht_bucket_html5_5D1, ht_bucket_empty, ht_bucket_html5_5D3, + ht_bucket_empty, ht_bucket_html5_5D5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_5D8, ht_bucket_html5_5D9, ht_bucket_empty, ht_bucket_html5_5DB, + ht_bucket_empty, ht_bucket_html5_5DD, ht_bucket_empty, ht_bucket_html5_5DF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_5E2, ht_bucket_empty, + ht_bucket_html5_5E4, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_5E7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_5EA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_5ED, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_5F0, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_5F3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_5F6, ht_bucket_empty, + ht_bucket_html5_5F8, ht_bucket_empty, ht_bucket_html5_5FA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_5FD, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_601, ht_bucket_html5_602, ht_bucket_html5_603, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_606, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_609, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_60D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_613, + ht_bucket_empty, ht_bucket_html5_615, ht_bucket_empty, ht_bucket_html5_617, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_61A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_61D, ht_bucket_empty, ht_bucket_html5_61F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_622, ht_bucket_empty, + ht_bucket_html5_624, ht_bucket_empty, ht_bucket_html5_626, ht_bucket_empty, + ht_bucket_html5_628, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_62C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_630, ht_bucket_empty, ht_bucket_html5_632, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_636, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_63A, ht_bucket_empty, + ht_bucket_html5_63C, ht_bucket_html5_63D, ht_bucket_html5_63E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_641, ht_bucket_html5_642, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_645, ht_bucket_html5_646, ht_bucket_html5_647, + ht_bucket_html5_648, ht_bucket_html5_649, ht_bucket_html5_64A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_651, ht_bucket_html5_652, ht_bucket_html5_653, + ht_bucket_empty, ht_bucket_html5_655, ht_bucket_empty, ht_bucket_html5_657, + ht_bucket_html5_658, ht_bucket_html5_659, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_65C, ht_bucket_empty, ht_bucket_html5_65E, ht_bucket_empty, + ht_bucket_html5_660, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_669, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_670, ht_bucket_html5_671, ht_bucket_html5_672, ht_bucket_html5_673, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_676, ht_bucket_empty, + ht_bucket_html5_678, ht_bucket_html5_679, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_67D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_680, ht_bucket_empty, ht_bucket_html5_682, ht_bucket_empty, + ht_bucket_html5_684, ht_bucket_html5_685, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_68A, ht_bucket_empty, + ht_bucket_html5_68C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_691, ht_bucket_empty, ht_bucket_html5_693, + ht_bucket_html5_694, ht_bucket_empty, ht_bucket_html5_696, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_699, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_6A3, + ht_bucket_html5_6A4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_6A8, ht_bucket_html5_6A9, ht_bucket_html5_6AA, ht_bucket_html5_6AB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_6AE, ht_bucket_empty, + ht_bucket_html5_6B0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_6B4, ht_bucket_empty, ht_bucket_html5_6B6, ht_bucket_empty, + ht_bucket_html5_6B8, ht_bucket_html5_6B9, ht_bucket_html5_6BA, ht_bucket_empty, + ht_bucket_html5_6BC, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_6BF, + ht_bucket_html5_6C0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_6C4, ht_bucket_html5_6C5, ht_bucket_html5_6C6, ht_bucket_html5_6C7, + ht_bucket_html5_6C8, ht_bucket_html5_6C9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_6CC, ht_bucket_empty, ht_bucket_html5_6CE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_6D1, ht_bucket_html5_6D2, ht_bucket_empty, + ht_bucket_html5_6D4, ht_bucket_html5_6D5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_6D9, ht_bucket_html5_6DA, ht_bucket_html5_6DB, + ht_bucket_html5_6DC, ht_bucket_empty, ht_bucket_html5_6DE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_6E7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_6EB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_6EE, ht_bucket_html5_6EF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_6F5, ht_bucket_empty, ht_bucket_html5_6F7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_6FB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_704, ht_bucket_html5_705, ht_bucket_html5_706, ht_bucket_html5_707, + ht_bucket_empty, ht_bucket_html5_709, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_70C, ht_bucket_empty, ht_bucket_html5_70E, ht_bucket_html5_70F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_712, ht_bucket_empty, + ht_bucket_html5_714, ht_bucket_html5_715, ht_bucket_empty, ht_bucket_html5_717, + ht_bucket_empty, ht_bucket_html5_719, ht_bucket_empty, ht_bucket_html5_71B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_71E, ht_bucket_html5_71F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_723, + ht_bucket_html5_724, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_727, + ht_bucket_empty, ht_bucket_html5_729, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_72C, ht_bucket_html5_72D, ht_bucket_html5_72E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_733, + ht_bucket_html5_734, ht_bucket_html5_735, ht_bucket_html5_736, ht_bucket_empty, + ht_bucket_html5_738, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_73B, + ht_bucket_empty, ht_bucket_html5_73D, ht_bucket_html5_73E, ht_bucket_html5_73F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_744, ht_bucket_html5_745, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_749, ht_bucket_empty, ht_bucket_html5_74B, + ht_bucket_html5_74C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_74F, + ht_bucket_empty, ht_bucket_html5_751, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_754, ht_bucket_html5_755, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_759, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_75C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_75F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_762, ht_bucket_html5_763, + ht_bucket_empty, ht_bucket_html5_765, ht_bucket_html5_766, ht_bucket_empty, + ht_bucket_html5_768, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_76E, ht_bucket_empty, + ht_bucket_html5_770, ht_bucket_empty, ht_bucket_html5_772, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_776, ht_bucket_html5_777, + ht_bucket_empty, ht_bucket_html5_779, ht_bucket_html5_77A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_77F, + ht_bucket_empty, ht_bucket_html5_781, ht_bucket_empty, ht_bucket_html5_783, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_787, + ht_bucket_empty, ht_bucket_html5_789, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_78C, ht_bucket_html5_78D, ht_bucket_html5_78E, ht_bucket_empty, + ht_bucket_html5_790, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_794, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_797, + ht_bucket_html5_798, ht_bucket_empty, ht_bucket_html5_79A, ht_bucket_html5_79B, + ht_bucket_empty, ht_bucket_html5_79D, ht_bucket_empty, ht_bucket_html5_79F, + ht_bucket_html5_7A0, ht_bucket_html5_7A1, ht_bucket_html5_7A2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_7A5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_7A8, ht_bucket_empty, ht_bucket_html5_7AA, ht_bucket_html5_7AB, + ht_bucket_html5_7AC, ht_bucket_empty, ht_bucket_html5_7AE, ht_bucket_html5_7AF, + ht_bucket_html5_7B0, ht_bucket_html5_7B1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_7B5, ht_bucket_html5_7B6, ht_bucket_html5_7B7, + ht_bucket_html5_7B8, ht_bucket_empty, ht_bucket_html5_7BA, ht_bucket_html5_7BB, + ht_bucket_empty, ht_bucket_html5_7BD, ht_bucket_html5_7BE, ht_bucket_html5_7BF, + ht_bucket_html5_7C0, ht_bucket_html5_7C1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_7C9, ht_bucket_empty, ht_bucket_html5_7CB, + ht_bucket_empty, ht_bucket_html5_7CD, ht_bucket_html5_7CE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_7D1, ht_bucket_html5_7D2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_7D5, ht_bucket_html5_7D6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_7D9, ht_bucket_html5_7DA, ht_bucket_empty, + ht_bucket_html5_7DC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_7E0, ht_bucket_empty, ht_bucket_html5_7E2, ht_bucket_empty, + ht_bucket_html5_7E4, ht_bucket_html5_7E5, ht_bucket_html5_7E6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_7EC, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_7EF, + ht_bucket_empty, ht_bucket_html5_7F1, ht_bucket_empty, ht_bucket_html5_7F3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_7F6, ht_bucket_empty, + ht_bucket_html5_7F8, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_7FB, + ht_bucket_html5_7FC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_800, ht_bucket_empty, ht_bucket_html5_802, ht_bucket_html5_803, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_808, ht_bucket_html5_809, ht_bucket_html5_80A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_810, ht_bucket_html5_811, ht_bucket_html5_812, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_816, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_819, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_81C, ht_bucket_html5_81D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_821, ht_bucket_html5_822, ht_bucket_html5_823, + ht_bucket_html5_824, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_828, ht_bucket_html5_829, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_82D, ht_bucket_html5_82E, ht_bucket_empty, + ht_bucket_html5_830, ht_bucket_html5_831, ht_bucket_html5_832, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_837, + ht_bucket_html5_838, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_83C, ht_bucket_empty, ht_bucket_html5_83E, ht_bucket_html5_83F, + ht_bucket_empty, ht_bucket_html5_841, ht_bucket_html5_842, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_846, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_84A, ht_bucket_empty, + ht_bucket_html5_84C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_84F, + ht_bucket_html5_850, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_855, ht_bucket_empty, ht_bucket_html5_857, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_85B, + ht_bucket_html5_85C, ht_bucket_empty, ht_bucket_html5_85E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_861, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_865, ht_bucket_html5_866, ht_bucket_html5_867, + ht_bucket_html5_868, ht_bucket_empty, ht_bucket_html5_86A, ht_bucket_html5_86B, + ht_bucket_html5_86C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_873, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_876, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_879, ht_bucket_empty, ht_bucket_html5_87B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_87E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_88A, ht_bucket_empty, + ht_bucket_html5_88C, ht_bucket_empty, ht_bucket_html5_88E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_892, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_895, ht_bucket_html5_896, ht_bucket_html5_897, + ht_bucket_html5_898, ht_bucket_html5_899, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_89D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_8A5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_8AC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8B3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8B6, ht_bucket_html5_8B7, + ht_bucket_html5_8B8, ht_bucket_html5_8B9, ht_bucket_html5_8BA, ht_bucket_empty, + ht_bucket_html5_8BC, ht_bucket_html5_8BD, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_8C0, ht_bucket_html5_8C1, ht_bucket_html5_8C2, ht_bucket_empty, + ht_bucket_html5_8C4, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8C7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8CF, + ht_bucket_html5_8D0, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8D3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8D6, ht_bucket_empty, + ht_bucket_html5_8D8, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_8DC, ht_bucket_html5_8DD, ht_bucket_html5_8DE, ht_bucket_html5_8DF, + ht_bucket_html5_8E0, ht_bucket_empty, ht_bucket_html5_8E2, ht_bucket_html5_8E3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8E7, + ht_bucket_html5_8E8, ht_bucket_html5_8E9, ht_bucket_empty, ht_bucket_html5_8EB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8F3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8FB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_8FE, ht_bucket_html5_8FF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_904, ht_bucket_empty, ht_bucket_html5_906, ht_bucket_html5_907, + ht_bucket_empty, ht_bucket_html5_909, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_90C, ht_bucket_empty, ht_bucket_html5_90E, ht_bucket_empty, + ht_bucket_html5_910, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_913, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_916, ht_bucket_empty, + ht_bucket_html5_918, ht_bucket_html5_919, ht_bucket_empty, ht_bucket_html5_91B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_91E, ht_bucket_html5_91F, + ht_bucket_html5_920, ht_bucket_empty, ht_bucket_html5_922, ht_bucket_html5_923, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_927, + ht_bucket_empty, ht_bucket_html5_929, ht_bucket_html5_92A, ht_bucket_empty, + ht_bucket_html5_92C, ht_bucket_empty, ht_bucket_html5_92E, ht_bucket_empty, + ht_bucket_html5_930, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_936, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_939, ht_bucket_empty, ht_bucket_html5_93B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_93F, + ht_bucket_html5_940, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_945, ht_bucket_empty, ht_bucket_html5_947, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_94D, ht_bucket_empty, ht_bucket_html5_94F, + ht_bucket_html5_950, ht_bucket_empty, ht_bucket_html5_952, ht_bucket_html5_953, + ht_bucket_html5_954, ht_bucket_html5_955, ht_bucket_html5_956, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_959, ht_bucket_empty, ht_bucket_html5_95B, + ht_bucket_empty, ht_bucket_html5_95D, ht_bucket_empty, ht_bucket_html5_95F, + ht_bucket_html5_960, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_963, + ht_bucket_html5_964, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_969, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_96C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_96F, + ht_bucket_html5_970, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_974, ht_bucket_html5_975, ht_bucket_html5_976, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_97B, + ht_bucket_html5_97C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_97F, + ht_bucket_empty, ht_bucket_html5_981, ht_bucket_empty, ht_bucket_html5_983, + ht_bucket_empty, ht_bucket_html5_985, ht_bucket_html5_986, ht_bucket_empty, + ht_bucket_html5_988, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_98C, ht_bucket_html5_98D, ht_bucket_empty, ht_bucket_html5_98F, + ht_bucket_html5_990, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_996, ht_bucket_html5_997, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_99B, + ht_bucket_html5_99C, ht_bucket_empty, ht_bucket_html5_99E, ht_bucket_html5_99F, + ht_bucket_html5_9A0, ht_bucket_html5_9A1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_9A6, ht_bucket_empty, + ht_bucket_html5_9A8, ht_bucket_empty, ht_bucket_html5_9AA, ht_bucket_empty, + ht_bucket_html5_9AC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_9B0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_9B4, ht_bucket_html5_9B5, ht_bucket_html5_9B6, ht_bucket_html5_9B7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_9BB, + ht_bucket_html5_9BC, ht_bucket_html5_9BD, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_9C1, ht_bucket_html5_9C2, ht_bucket_html5_9C3, + ht_bucket_empty, ht_bucket_html5_9C5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_9C9, ht_bucket_html5_9CA, ht_bucket_empty, + ht_bucket_html5_9CC, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_9CF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_9D5, ht_bucket_html5_9D6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_9DA, ht_bucket_html5_9DB, + ht_bucket_empty, ht_bucket_html5_9DD, ht_bucket_html5_9DE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_9E1, ht_bucket_html5_9E2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_9E5, ht_bucket_empty, ht_bucket_html5_9E7, + ht_bucket_empty, ht_bucket_html5_9E9, ht_bucket_empty, ht_bucket_html5_9EB, + ht_bucket_empty, ht_bucket_html5_9ED, ht_bucket_html5_9EE, ht_bucket_html5_9EF, + ht_bucket_html5_9F0, ht_bucket_html5_9F1, ht_bucket_html5_9F2, ht_bucket_html5_9F3, + ht_bucket_html5_9F4, ht_bucket_html5_9F5, ht_bucket_empty, ht_bucket_html5_9F7, + ht_bucket_empty, ht_bucket_html5_9F9, ht_bucket_html5_9FA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_9FD, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A01, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_A04, ht_bucket_html5_A05, ht_bucket_html5_A06, ht_bucket_empty, + ht_bucket_html5_A08, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_A0C, ht_bucket_html5_A0D, ht_bucket_html5_A0E, ht_bucket_empty, + ht_bucket_html5_A10, ht_bucket_empty, ht_bucket_html5_A12, ht_bucket_empty, + ht_bucket_html5_A14, ht_bucket_html5_A15, ht_bucket_html5_A16, ht_bucket_html5_A17, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A21, ht_bucket_empty, ht_bucket_html5_A23, + ht_bucket_html5_A24, ht_bucket_html5_A25, ht_bucket_html5_A26, ht_bucket_empty, + ht_bucket_html5_A28, ht_bucket_empty, ht_bucket_html5_A2A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A2D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_A30, ht_bucket_empty, ht_bucket_html5_A32, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_A36, ht_bucket_html5_A37, + ht_bucket_empty, ht_bucket_html5_A39, ht_bucket_empty, ht_bucket_html5_A3B, + ht_bucket_html5_A3C, ht_bucket_html5_A3D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A41, ht_bucket_empty, ht_bucket_html5_A43, + ht_bucket_html5_A44, ht_bucket_html5_A45, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_A48, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_A4F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_A53, + ht_bucket_html5_A54, ht_bucket_empty, ht_bucket_html5_A56, ht_bucket_html5_A57, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_A5A, ht_bucket_html5_A5B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A61, ht_bucket_html5_A62, ht_bucket_html5_A63, + ht_bucket_html5_A64, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A69, ht_bucket_html5_A6A, ht_bucket_html5_A6B, + ht_bucket_empty, ht_bucket_html5_A6D, ht_bucket_empty, ht_bucket_html5_A6F, + ht_bucket_html5_A70, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_A76, ht_bucket_empty, + ht_bucket_html5_A78, ht_bucket_empty, ht_bucket_html5_A7A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_A7E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A81, ht_bucket_html5_A82, ht_bucket_empty, + ht_bucket_html5_A84, ht_bucket_html5_A85, ht_bucket_html5_A86, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A89, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A8D, ht_bucket_html5_A8E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_A92, ht_bucket_empty, + ht_bucket_html5_A94, ht_bucket_empty, ht_bucket_html5_A96, ht_bucket_empty, + ht_bucket_html5_A98, ht_bucket_html5_A99, ht_bucket_html5_A9A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_A9D, ht_bucket_empty, ht_bucket_html5_A9F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_AA3, + ht_bucket_html5_AA4, ht_bucket_html5_AA5, ht_bucket_empty, ht_bucket_html5_AA7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_AAC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_AB2, ht_bucket_empty, + ht_bucket_html5_AB4, ht_bucket_html5_AB5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_ABA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_AC0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_AC4, ht_bucket_html5_AC5, ht_bucket_html5_AC6, ht_bucket_html5_AC7, + ht_bucket_html5_AC8, ht_bucket_empty, ht_bucket_html5_ACA, ht_bucket_empty, + ht_bucket_html5_ACC, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_ACF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_AD2, ht_bucket_html5_AD3, + ht_bucket_html5_AD4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_ADA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_ADD, ht_bucket_empty, ht_bucket_html5_ADF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_AE4, ht_bucket_html5_AE5, ht_bucket_html5_AE6, ht_bucket_html5_AE7, + ht_bucket_html5_AE8, ht_bucket_html5_AE9, ht_bucket_empty, ht_bucket_html5_AEB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_AF5, ht_bucket_html5_AF6, ht_bucket_html5_AF7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_AFA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_AFD, ht_bucket_html5_AFE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_B08, ht_bucket_html5_B09, ht_bucket_html5_B0A, ht_bucket_empty, + ht_bucket_html5_B0C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_B10, ht_bucket_html5_B11, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_B15, ht_bucket_html5_B16, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B1E, ht_bucket_html5_B1F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B23, + ht_bucket_html5_B24, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B27, + ht_bucket_empty, ht_bucket_html5_B29, ht_bucket_html5_B2A, ht_bucket_html5_B2B, + ht_bucket_html5_B2C, ht_bucket_html5_B2D, ht_bucket_html5_B2E, ht_bucket_html5_B2F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B33, + ht_bucket_empty, ht_bucket_html5_B35, ht_bucket_html5_B36, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B3A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_B3D, ht_bucket_html5_B3E, ht_bucket_empty, + ht_bucket_html5_B40, ht_bucket_empty, ht_bucket_html5_B42, ht_bucket_empty, + ht_bucket_html5_B44, ht_bucket_empty, ht_bucket_html5_B46, ht_bucket_html5_B47, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_B4C, ht_bucket_empty, ht_bucket_html5_B4E, ht_bucket_html5_B4F, + ht_bucket_html5_B50, ht_bucket_html5_B51, ht_bucket_html5_B52, ht_bucket_html5_B53, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B56, ht_bucket_empty, + ht_bucket_html5_B58, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_B5C, ht_bucket_html5_B5D, ht_bucket_html5_B5E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B63, + ht_bucket_html5_B64, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B67, + ht_bucket_empty, ht_bucket_html5_B69, ht_bucket_empty, ht_bucket_html5_B6B, + ht_bucket_empty, ht_bucket_html5_B6D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B72, ht_bucket_html5_B73, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B77, + ht_bucket_html5_B78, ht_bucket_empty, ht_bucket_html5_B7A, ht_bucket_html5_B7B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B7E, ht_bucket_html5_B7F, + ht_bucket_empty, ht_bucket_html5_B81, ht_bucket_html5_B82, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_B87, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_B8D, ht_bucket_empty, ht_bucket_html5_B8F, + ht_bucket_html5_B90, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_B94, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_B98, ht_bucket_html5_B99, ht_bucket_html5_B9A, ht_bucket_empty, + ht_bucket_html5_B9C, ht_bucket_html5_B9D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_BA5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_BA9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_BAE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_BB2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_BB5, ht_bucket_html5_BB6, ht_bucket_html5_BB7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_BBA, ht_bucket_empty, + ht_bucket_html5_BBC, ht_bucket_html5_BBD, ht_bucket_empty, ht_bucket_html5_BBF, + ht_bucket_empty, ht_bucket_html5_BC1, ht_bucket_html5_BC2, ht_bucket_html5_BC3, + ht_bucket_html5_BC4, ht_bucket_html5_BC5, ht_bucket_html5_BC6, ht_bucket_html5_BC7, + ht_bucket_html5_BC8, ht_bucket_html5_BC9, ht_bucket_empty, ht_bucket_html5_BCB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_BCE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_BD1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_BD7, + ht_bucket_html5_BD8, ht_bucket_html5_BD9, ht_bucket_html5_BDA, ht_bucket_html5_BDB, + ht_bucket_empty, ht_bucket_html5_BDD, ht_bucket_empty, ht_bucket_html5_BDF, + ht_bucket_empty, ht_bucket_html5_BE1, ht_bucket_html5_BE2, ht_bucket_empty, + ht_bucket_html5_BE4, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_BE7, + ht_bucket_html5_BE8, ht_bucket_html5_BE9, ht_bucket_html5_BEA, ht_bucket_html5_BEB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_BEF, + ht_bucket_html5_BF0, ht_bucket_html5_BF1, ht_bucket_html5_BF2, ht_bucket_html5_BF3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_BF7, + ht_bucket_empty, ht_bucket_html5_BF9, ht_bucket_html5_BFA, ht_bucket_empty, + ht_bucket_html5_BFC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C02, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C0B, + ht_bucket_html5_C0C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_C11, ht_bucket_html5_C12, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C16, ht_bucket_empty, + ht_bucket_html5_C18, ht_bucket_empty, ht_bucket_html5_C1A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_C1D, ht_bucket_html5_C1E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C23, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C27, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C2B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_C31, ht_bucket_html5_C32, ht_bucket_html5_C33, + ht_bucket_html5_C34, ht_bucket_html5_C35, ht_bucket_html5_C36, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C3A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C3E, ht_bucket_html5_C3F, + ht_bucket_html5_C40, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C43, + ht_bucket_html5_C44, ht_bucket_empty, ht_bucket_html5_C46, ht_bucket_empty, + ht_bucket_html5_C48, ht_bucket_empty, ht_bucket_html5_C4A, ht_bucket_html5_C4B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C4F, + ht_bucket_html5_C50, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_C54, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_C58, ht_bucket_empty, ht_bucket_html5_C5A, ht_bucket_html5_C5B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C5F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_C69, ht_bucket_empty, ht_bucket_html5_C6B, + ht_bucket_html5_C6C, ht_bucket_empty, ht_bucket_html5_C6E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C72, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C76, ht_bucket_html5_C77, + ht_bucket_html5_C78, ht_bucket_empty, ht_bucket_html5_C7A, ht_bucket_html5_C7B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_C80, ht_bucket_empty, ht_bucket_html5_C82, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_C89, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_C8E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_C91, ht_bucket_empty, ht_bucket_html5_C93, + ht_bucket_html5_C94, ht_bucket_html5_C95, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_C98, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_CA6, ht_bucket_empty, + ht_bucket_html5_CA8, ht_bucket_html5_CA9, ht_bucket_html5_CAA, ht_bucket_empty, + ht_bucket_html5_CAC, ht_bucket_html5_CAD, ht_bucket_empty, ht_bucket_html5_CAF, + ht_bucket_html5_CB0, ht_bucket_empty, ht_bucket_html5_CB2, ht_bucket_empty, + ht_bucket_html5_CB4, ht_bucket_empty, ht_bucket_html5_CB6, ht_bucket_html5_CB7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_CBA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_CBE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_CC2, ht_bucket_empty, + ht_bucket_html5_CC4, ht_bucket_html5_CC5, ht_bucket_empty, ht_bucket_html5_CC7, + ht_bucket_html5_CC8, ht_bucket_html5_CC9, ht_bucket_empty, ht_bucket_html5_CCB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_CD0, ht_bucket_empty, ht_bucket_html5_CD2, ht_bucket_html5_CD3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_CD9, ht_bucket_html5_CDA, ht_bucket_empty, + ht_bucket_html5_CDC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_CE4, ht_bucket_empty, ht_bucket_html5_CE6, ht_bucket_empty, + ht_bucket_html5_CE8, ht_bucket_html5_CE9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_CED, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_CF1, ht_bucket_html5_CF2, ht_bucket_html5_CF3, + ht_bucket_html5_CF4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_CFA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_CFF, + ht_bucket_html5_D00, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D06, ht_bucket_html5_D07, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D0B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D0E, ht_bucket_empty, + ht_bucket_html5_D10, ht_bucket_html5_D11, ht_bucket_html5_D12, ht_bucket_html5_D13, + ht_bucket_empty, ht_bucket_html5_D15, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_D18, ht_bucket_html5_D19, ht_bucket_html5_D1A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D1E, ht_bucket_html5_D1F, + ht_bucket_html5_D20, ht_bucket_empty, ht_bucket_html5_D22, ht_bucket_empty, + ht_bucket_html5_D24, ht_bucket_empty, ht_bucket_html5_D26, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D2A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D32, ht_bucket_empty, + ht_bucket_html5_D34, ht_bucket_html5_D35, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_D38, ht_bucket_html5_D39, ht_bucket_html5_D3A, ht_bucket_html5_D3B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D3E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D42, ht_bucket_empty, + ht_bucket_html5_D44, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_D49, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_D4C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D4F, + ht_bucket_empty, ht_bucket_html5_D51, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_D54, ht_bucket_html5_D55, ht_bucket_html5_D56, ht_bucket_html5_D57, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D5A, ht_bucket_html5_D5B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D5F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D63, + ht_bucket_empty, ht_bucket_html5_D65, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_D69, ht_bucket_html5_D6A, ht_bucket_empty, + ht_bucket_html5_D6C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_D6F, + ht_bucket_html5_D70, ht_bucket_html5_D71, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_D74, ht_bucket_html5_D75, ht_bucket_html5_D76, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_D7C, ht_bucket_html5_D7D, ht_bucket_html5_D7E, ht_bucket_empty, + ht_bucket_html5_D80, ht_bucket_html5_D81, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_D85, ht_bucket_empty, ht_bucket_html5_D87, + ht_bucket_empty, ht_bucket_html5_D89, ht_bucket_html5_D8A, ht_bucket_empty, + ht_bucket_html5_D8C, ht_bucket_html5_D8D, ht_bucket_html5_D8E, ht_bucket_html5_D8F, + ht_bucket_html5_D90, ht_bucket_html5_D91, ht_bucket_empty, ht_bucket_html5_D93, + ht_bucket_html5_D94, ht_bucket_html5_D95, ht_bucket_html5_D96, ht_bucket_empty, + ht_bucket_html5_D98, ht_bucket_empty, ht_bucket_html5_D9A, ht_bucket_empty, + ht_bucket_html5_D9C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_DA0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_DA5, ht_bucket_html5_DA6, ht_bucket_empty, + ht_bucket_html5_DA8, ht_bucket_html5_DA9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_DAC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_DB0, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_DB3, + ht_bucket_html5_DB4, ht_bucket_empty, ht_bucket_html5_DB6, ht_bucket_html5_DB7, + ht_bucket_empty, ht_bucket_html5_DB9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_DBC, ht_bucket_empty, ht_bucket_html5_DBE, ht_bucket_html5_DBF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_DC2, ht_bucket_html5_DC3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_DC6, ht_bucket_empty, + ht_bucket_html5_DC8, ht_bucket_empty, ht_bucket_html5_DCA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_DCF, + ht_bucket_empty, ht_bucket_html5_DD1, ht_bucket_empty, ht_bucket_html5_DD3, + ht_bucket_html5_DD4, ht_bucket_html5_DD5, ht_bucket_empty, ht_bucket_html5_DD7, + ht_bucket_empty, ht_bucket_html5_DD9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_DDC, ht_bucket_html5_DDD, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_DE4, ht_bucket_empty, ht_bucket_html5_DE6, ht_bucket_html5_DE7, + ht_bucket_empty, ht_bucket_html5_DE9, ht_bucket_empty, ht_bucket_html5_DEB, + ht_bucket_empty, ht_bucket_html5_DED, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_DF1, ht_bucket_html5_DF2, ht_bucket_html5_DF3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_DF6, ht_bucket_html5_DF7, + ht_bucket_empty, ht_bucket_html5_DF9, ht_bucket_empty, ht_bucket_html5_DFB, + ht_bucket_empty, ht_bucket_html5_DFD, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E03, + ht_bucket_html5_E04, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E08, ht_bucket_html5_E09, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E0C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_E11, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E18, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E1B, + ht_bucket_html5_E1C, ht_bucket_html5_E1D, ht_bucket_html5_E1E, ht_bucket_empty, + ht_bucket_html5_E20, ht_bucket_empty, ht_bucket_html5_E22, ht_bucket_html5_E23, + ht_bucket_html5_E24, ht_bucket_html5_E25, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E28, ht_bucket_empty, ht_bucket_html5_E2A, ht_bucket_empty, + ht_bucket_html5_E2C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E2F, + ht_bucket_html5_E30, ht_bucket_empty, ht_bucket_html5_E32, ht_bucket_html5_E33, + ht_bucket_empty, ht_bucket_html5_E35, ht_bucket_html5_E36, ht_bucket_html5_E37, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E3B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_E41, ht_bucket_html5_E42, ht_bucket_html5_E43, + ht_bucket_html5_E44, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E48, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E4C, ht_bucket_empty, ht_bucket_html5_E4E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E53, + ht_bucket_empty, ht_bucket_html5_E55, ht_bucket_empty, ht_bucket_html5_E57, + ht_bucket_html5_E58, ht_bucket_html5_E59, ht_bucket_empty, ht_bucket_html5_E5B, + ht_bucket_empty, ht_bucket_html5_E5D, ht_bucket_html5_E5E, ht_bucket_html5_E5F, + ht_bucket_html5_E60, ht_bucket_html5_E61, ht_bucket_empty, ht_bucket_html5_E63, + ht_bucket_html5_E64, ht_bucket_html5_E65, ht_bucket_html5_E66, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E6A, ht_bucket_empty, + ht_bucket_html5_E6C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E6F, + ht_bucket_html5_E70, ht_bucket_html5_E71, ht_bucket_empty, ht_bucket_html5_E73, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E78, ht_bucket_empty, ht_bucket_html5_E7A, ht_bucket_empty, + ht_bucket_html5_E7C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E80, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E83, + ht_bucket_html5_E84, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_E89, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_E8E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_E91, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_E99, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_E9C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_EA1, ht_bucket_html5_EA2, ht_bucket_empty, + ht_bucket_html5_EA4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_EA8, ht_bucket_html5_EA9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_EB1, ht_bucket_html5_EB2, ht_bucket_empty, + ht_bucket_html5_EB4, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_EB7, + ht_bucket_html5_EB8, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_ECA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_ECD, ht_bucket_empty, ht_bucket_html5_ECF, + ht_bucket_empty, ht_bucket_html5_ED1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_ED7, + ht_bucket_html5_ED8, ht_bucket_html5_ED9, ht_bucket_html5_EDA, ht_bucket_html5_EDB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_EDF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_EE2, ht_bucket_empty, + ht_bucket_html5_EE4, ht_bucket_html5_EE5, ht_bucket_empty, ht_bucket_html5_EE7, + ht_bucket_empty, ht_bucket_html5_EE9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_EEF, + ht_bucket_empty, ht_bucket_html5_EF1, ht_bucket_html5_EF2, ht_bucket_empty, + ht_bucket_html5_EF4, ht_bucket_html5_EF5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_EF9, ht_bucket_empty, ht_bucket_html5_EFB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_EFE, ht_bucket_html5_EFF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F03, + ht_bucket_empty, ht_bucket_html5_F05, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_F08, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F0B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F0F, + ht_bucket_html5_F10, ht_bucket_html5_F11, ht_bucket_empty, ht_bucket_html5_F13, + ht_bucket_html5_F14, ht_bucket_html5_F15, ht_bucket_empty, ht_bucket_html5_F17, + ht_bucket_html5_F18, ht_bucket_html5_F19, ht_bucket_html5_F1A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F1F, + ht_bucket_html5_F20, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F26, ht_bucket_empty, + ht_bucket_html5_F28, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_F2C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F2F, + ht_bucket_html5_F30, ht_bucket_html5_F31, ht_bucket_empty, ht_bucket_html5_F33, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F37, + ht_bucket_html5_F38, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_F40, ht_bucket_html5_F41, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_F44, ht_bucket_empty, ht_bucket_html5_F46, ht_bucket_html5_F47, + ht_bucket_html5_F48, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F4B, + ht_bucket_html5_F4C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_F50, ht_bucket_html5_F51, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_F55, ht_bucket_empty, ht_bucket_html5_F57, + ht_bucket_html5_F58, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F5B, + ht_bucket_empty, ht_bucket_html5_F5D, ht_bucket_empty, ht_bucket_html5_F5F, + ht_bucket_html5_F60, ht_bucket_empty, ht_bucket_html5_F62, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F67, + ht_bucket_html5_F68, ht_bucket_html5_F69, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_F6D, ht_bucket_html5_F6E, ht_bucket_html5_F6F, + ht_bucket_html5_F70, ht_bucket_html5_F71, ht_bucket_html5_F72, ht_bucket_empty, + ht_bucket_html5_F74, ht_bucket_html5_F75, ht_bucket_html5_F76, ht_bucket_html5_F77, + ht_bucket_html5_F78, ht_bucket_html5_F79, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_F81, ht_bucket_html5_F82, ht_bucket_html5_F83, + ht_bucket_html5_F84, ht_bucket_empty, ht_bucket_html5_F86, ht_bucket_empty, + ht_bucket_html5_F88, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F8B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F8F, + ht_bucket_empty, ht_bucket_html5_F91, ht_bucket_empty, ht_bucket_html5_F93, + ht_bucket_empty, ht_bucket_html5_F95, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F9A, ht_bucket_empty, + ht_bucket_html5_F9C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_F9F, + ht_bucket_html5_FA0, ht_bucket_html5_FA1, ht_bucket_html5_FA2, ht_bucket_html5_FA3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_FA9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_FB0, ht_bucket_html5_FB1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_FB4, ht_bucket_html5_FB5, ht_bucket_html5_FB6, ht_bucket_html5_FB7, + ht_bucket_empty, ht_bucket_html5_FB9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_FBC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_FC2, ht_bucket_empty, + ht_bucket_html5_FC4, ht_bucket_empty, ht_bucket_html5_FC6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_FCA, ht_bucket_empty, + ht_bucket_html5_FCC, ht_bucket_empty, ht_bucket_html5_FCE, ht_bucket_html5_FCF, + ht_bucket_html5_FD0, ht_bucket_empty, ht_bucket_html5_FD2, ht_bucket_html5_FD3, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_FD6, ht_bucket_html5_FD7, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_FDD, ht_bucket_empty, ht_bucket_html5_FDF, + ht_bucket_empty, ht_bucket_html5_FE1, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html5_FE6, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_FE9, ht_bucket_html5_FEA, ht_bucket_html5_FEB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html5_FF5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_FF8, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html5_FFC, ht_bucket_empty, ht_bucket_html5_FFE, ht_bucket_empty, +}; + +static const entity_ht ent_ht_html5 = { + 0x1000, + ht_buckets_html5 +}; + +/* end of HTML5 hash table for entity -> codepoint }}} */ + +/* {{{ Start of HTML 4.01 multi-stage table for codepoint -> entity */ + +/* {{{ Stage 3 Tables for HTML 4.01 */ + +static const entity_stage3_row stage3_table_html4_00000[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"quot", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"amp", 3} } }, {0, { {"#039", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lt", 2} } }, {0, { {NULL, 0} } }, {0, { {"gt", 2} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_00080[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"nbsp", 4} } }, {0, { {"iexcl", 5} } }, {0, { {"cent", 4} } }, {0, { {"pound", 5} } }, + {0, { {"curren", 6} } }, {0, { {"yen", 3} } }, {0, { {"brvbar", 6} } }, {0, { {"sect", 4} } }, + {0, { {"uml", 3} } }, {0, { {"copy", 4} } }, {0, { {"ordf", 4} } }, {0, { {"laquo", 5} } }, + {0, { {"not", 3} } }, {0, { {"shy", 3} } }, {0, { {"reg", 3} } }, {0, { {"macr", 4} } }, + {0, { {"deg", 3} } }, {0, { {"plusmn", 6} } }, {0, { {"sup2", 4} } }, {0, { {"sup3", 4} } }, + {0, { {"acute", 5} } }, {0, { {"micro", 5} } }, {0, { {"para", 4} } }, {0, { {"middot", 6} } }, + {0, { {"cedil", 5} } }, {0, { {"sup1", 4} } }, {0, { {"ordm", 4} } }, {0, { {"raquo", 5} } }, + {0, { {"frac14", 6} } }, {0, { {"frac12", 6} } }, {0, { {"frac34", 6} } }, {0, { {"iquest", 6} } }, +}; + +static const entity_stage3_row stage3_table_html4_000C0[] = { + {0, { {"Agrave", 6} } }, {0, { {"Aacute", 6} } }, {0, { {"Acirc", 5} } }, {0, { {"Atilde", 6} } }, + {0, { {"Auml", 4} } }, {0, { {"Aring", 5} } }, {0, { {"AElig", 5} } }, {0, { {"Ccedil", 6} } }, + {0, { {"Egrave", 6} } }, {0, { {"Eacute", 6} } }, {0, { {"Ecirc", 5} } }, {0, { {"Euml", 4} } }, + {0, { {"Igrave", 6} } }, {0, { {"Iacute", 6} } }, {0, { {"Icirc", 5} } }, {0, { {"Iuml", 4} } }, + {0, { {"ETH", 3} } }, {0, { {"Ntilde", 6} } }, {0, { {"Ograve", 6} } }, {0, { {"Oacute", 6} } }, + {0, { {"Ocirc", 5} } }, {0, { {"Otilde", 6} } }, {0, { {"Ouml", 4} } }, {0, { {"times", 5} } }, + {0, { {"Oslash", 6} } }, {0, { {"Ugrave", 6} } }, {0, { {"Uacute", 6} } }, {0, { {"Ucirc", 5} } }, + {0, { {"Uuml", 4} } }, {0, { {"Yacute", 6} } }, {0, { {"THORN", 5} } }, {0, { {"szlig", 5} } }, + {0, { {"agrave", 6} } }, {0, { {"aacute", 6} } }, {0, { {"acirc", 5} } }, {0, { {"atilde", 6} } }, + {0, { {"auml", 4} } }, {0, { {"aring", 5} } }, {0, { {"aelig", 5} } }, {0, { {"ccedil", 6} } }, + {0, { {"egrave", 6} } }, {0, { {"eacute", 6} } }, {0, { {"ecirc", 5} } }, {0, { {"euml", 4} } }, + {0, { {"igrave", 6} } }, {0, { {"iacute", 6} } }, {0, { {"icirc", 5} } }, {0, { {"iuml", 4} } }, + {0, { {"eth", 3} } }, {0, { {"ntilde", 6} } }, {0, { {"ograve", 6} } }, {0, { {"oacute", 6} } }, + {0, { {"ocirc", 5} } }, {0, { {"otilde", 6} } }, {0, { {"ouml", 4} } }, {0, { {"divide", 6} } }, + {0, { {"oslash", 6} } }, {0, { {"ugrave", 6} } }, {0, { {"uacute", 6} } }, {0, { {"ucirc", 5} } }, + {0, { {"uuml", 4} } }, {0, { {"yacute", 6} } }, {0, { {"thorn", 5} } }, {0, { {"yuml", 4} } }, +}; + +static const entity_stage3_row stage3_table_html4_00140[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"OElig", 5} } }, {0, { {"oelig", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Scaron", 6} } }, {0, { {"scaron", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"Yuml", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_00180[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"fnof", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_002C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"circ", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"tilde", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_00380[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"Alpha", 5} } }, {0, { {"Beta", 4} } }, {0, { {"Gamma", 5} } }, + {0, { {"Delta", 5} } }, {0, { {"Epsilon", 7} } }, {0, { {"Zeta", 4} } }, {0, { {"Eta", 3} } }, + {0, { {"Theta", 5} } }, {0, { {"Iota", 4} } }, {0, { {"Kappa", 5} } }, {0, { {"Lambda", 6} } }, + {0, { {"Mu", 2} } }, {0, { {"Nu", 2} } }, {0, { {"Xi", 2} } }, {0, { {"Omicron", 7} } }, + {0, { {"Pi", 2} } }, {0, { {"Rho", 3} } }, {0, { {NULL, 0} } }, {0, { {"Sigma", 5} } }, + {0, { {"Tau", 3} } }, {0, { {"Upsilon", 7} } }, {0, { {"Phi", 3} } }, {0, { {"Chi", 3} } }, + {0, { {"Psi", 3} } }, {0, { {"Omega", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"alpha", 5} } }, {0, { {"beta", 4} } }, {0, { {"gamma", 5} } }, + {0, { {"delta", 5} } }, {0, { {"epsilon", 7} } }, {0, { {"zeta", 4} } }, {0, { {"eta", 3} } }, + {0, { {"theta", 5} } }, {0, { {"iota", 4} } }, {0, { {"kappa", 5} } }, {0, { {"lambda", 6} } }, + {0, { {"mu", 2} } }, {0, { {"nu", 2} } }, {0, { {"xi", 2} } }, {0, { {"omicron", 7} } }, +}; + +static const entity_stage3_row stage3_table_html4_003C0[] = { + {0, { {"pi", 2} } }, {0, { {"rho", 3} } }, {0, { {"sigmaf", 6} } }, {0, { {"sigma", 5} } }, + {0, { {"tau", 3} } }, {0, { {"upsilon", 7} } }, {0, { {"phi", 3} } }, {0, { {"chi", 3} } }, + {0, { {"psi", 3} } }, {0, { {"omega", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"thetasym", 8} } }, {0, { {"upsih", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"piv", 3} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02000[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"ensp", 4} } }, {0, { {"emsp", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"thinsp", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"zwnj", 4} } }, {0, { {"zwj", 3} } }, {0, { {"lrm", 3} } }, {0, { {"rlm", 3} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"ndash", 5} } }, + {0, { {"mdash", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lsquo", 5} } }, {0, { {"rsquo", 5} } }, {0, { {"sbquo", 5} } }, {0, { {NULL, 0} } }, + {0, { {"ldquo", 5} } }, {0, { {"rdquo", 5} } }, {0, { {"bdquo", 5} } }, {0, { {NULL, 0} } }, + {0, { {"dagger", 6} } }, {0, { {"Dagger", 6} } }, {0, { {"bull", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"hellip", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"permil", 6} } }, {0, { {NULL, 0} } }, {0, { {"prime", 5} } }, {0, { {"Prime", 5} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"lsaquo", 6} } }, {0, { {"rsaquo", 6} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"oline", 5} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02040[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"frasl", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02080[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"euro", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02100[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"image", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"weierp", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"real", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"trade", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"alefsym", 7} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02180[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"larr", 4} } }, {0, { {"uarr", 4} } }, {0, { {"rarr", 4} } }, {0, { {"darr", 4} } }, + {0, { {"harr", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"crarr", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_021C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lArr", 4} } }, {0, { {"uArr", 4} } }, {0, { {"rArr", 4} } }, {0, { {"dArr", 4} } }, + {0, { {"hArr", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02200[] = { + {0, { {"forall", 6} } }, {0, { {NULL, 0} } }, {0, { {"part", 4} } }, {0, { {"exist", 5} } }, + {0, { {NULL, 0} } }, {0, { {"empty", 5} } }, {0, { {NULL, 0} } }, {0, { {"nabla", 5} } }, + {0, { {"isin", 4} } }, {0, { {"notin", 5} } }, {0, { {NULL, 0} } }, {0, { {"ni", 2} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"prod", 4} } }, + {0, { {NULL, 0} } }, {0, { {"sum", 3} } }, {0, { {"minus", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lowast", 6} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"radic", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"prop", 4} } }, {0, { {"infin", 5} } }, {0, { {NULL, 0} } }, + {0, { {"ang", 3} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"and", 3} } }, + {0, { {"or", 2} } }, {0, { {"cap", 3} } }, {0, { {"cup", 3} } }, {0, { {"int", 3} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"there4", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"sim", 3} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02240[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"cong", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"asymp", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"ne", 2} } }, {0, { {"equiv", 5} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"le", 2} } }, {0, { {"ge", 2} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02280[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"sub", 3} } }, {0, { {"sup", 3} } }, + {0, { {"nsub", 4} } }, {0, { {NULL, 0} } }, {0, { {"sube", 4} } }, {0, { {"supe", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"oplus", 5} } }, {0, { {NULL, 0} } }, {0, { {"otimes", 6} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"perp", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_022C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"sdot", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02300[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lceil", 5} } }, {0, { {"rceil", 5} } }, {0, { {"lfloor", 6} } }, {0, { {"rfloor", 6} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {"lang", 4} } }, {0, { {"rang", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_025C0[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"loz", 3} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +static const entity_stage3_row stage3_table_html4_02640[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"spades", 6} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"clubs", 5} } }, + {0, { {NULL, 0} } }, {0, { {"hearts", 6} } }, {0, { {"diams", 5} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, +}; + +/* end of stage 3 Tables for HTML 4.01 }}} */ + +/* {{{ Stage 2 Tables for HTML 4.01 */ + +static const entity_stage2_row stage2_table_html4_00000[] = { + stage3_table_html4_00000, empty_stage3_table, stage3_table_html4_00080, stage3_table_html4_000C0, + empty_stage3_table, stage3_table_html4_00140, stage3_table_html4_00180, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, stage3_table_html4_002C0, + empty_stage3_table, empty_stage3_table, stage3_table_html4_00380, stage3_table_html4_003C0, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, +}; + +static const entity_stage2_row stage2_table_html4_02000[] = { + stage3_table_html4_02000, stage3_table_html4_02040, stage3_table_html4_02080, empty_stage3_table, + stage3_table_html4_02100, empty_stage3_table, stage3_table_html4_02180, stage3_table_html4_021C0, + stage3_table_html4_02200, stage3_table_html4_02240, stage3_table_html4_02280, stage3_table_html4_022C0, + stage3_table_html4_02300, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, stage3_table_html4_025C0, + empty_stage3_table, stage3_table_html4_02640, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, + empty_stage3_table, empty_stage3_table, empty_stage3_table, empty_stage3_table, +}; + +/* end of stage 2 tables for HTML 4.01 }}} */ + +static const entity_stage1_row entity_ms_table_html4[] = { + stage2_table_html4_00000, + empty_stage2_table, + stage2_table_html4_02000, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, + empty_stage2_table, +}; + +/* end of HTML 4.01 multi-stage table for codepoint -> entity }}} */ + +/* {{{ HTML 4.01 hash table for entity -> codepoint */ + +static const entity_cp_map ht_bucket_html4_000[] = { {"gt", 2, 0x0003E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_003[] = { {"Igrave", 6, 0x000CC, 0}, {"amp", 3, 0x00026, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_006[] = { {"oacute", 6, 0x000F3, 0}, {"Xi", 2, 0x0039E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_008[] = { {"uuml", 4, 0x000FC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_00B[] = { {"Alpha", 5, 0x00391, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_00E[] = { {"sim", 3, 0x0223C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_012[] = { {"kappa", 5, 0x003BA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_016[] = { {"lArr", 4, 0x021D0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_018[] = { {"and", 3, 0x02227, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_01B[] = { {"ang", 3, 0x02220, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_020[] = { {"copy", 4, 0x000A9, 0}, {"Iacute", 6, 0x000CD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_023[] = { {"igrave", 6, 0x000EC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_026[] = { {"xi", 2, 0x003BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_027[] = { {"Acirc", 5, 0x000C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_02B[] = { {"Ecirc", 5, 0x000CA, 0}, {"alpha", 5, 0x003B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_02C[] = { {"hearts", 6, 0x02665, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_02F[] = { {"Icirc", 5, 0x000CE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_030[] = { {"Yacute", 6, 0x000DD, 0}, {"int", 3, 0x0222B, 0}, {"rlm", 3, 0x0200F, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_034[] = { {"empty", 5, 0x02205, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_036[] = { {"larr", 4, 0x02190, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_03B[] = { {"Ucirc", 5, 0x000DB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_03C[] = { {"oline", 5, 0x0203E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_040[] = { {"iacute", 6, 0x000ED, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_046[] = { {"middot", 6, 0x000B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_047[] = { {"acirc", 5, 0x000E2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_04B[] = { {"ecirc", 5, 0x000EA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_04F[] = { {"icirc", 5, 0x000EE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_050[] = { {"yacute", 6, 0x000FD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_051[] = { {"minus", 5, 0x02212, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_054[] = { {"Auml", 4, 0x000C4, 0}, {"thetasym", 8, 0x003D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_056[] = { {"Sigma", 5, 0x003A3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_059[] = { {"lsquo", 5, 0x02018, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_05B[] = { {"ucirc", 5, 0x000FB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_05C[] = { {"rArr", 4, 0x021D2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_064[] = { {"brvbar", 6, 0x000A6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_067[] = { {"AElig", 5, 0x000C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_069[] = { {"Ccedil", 6, 0x000C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_071[] = { {"Psi", 3, 0x003A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_072[] = { {"exist", 5, 0x02203, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_074[] = { {"auml", 4, 0x000E4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_076[] = { {"sigma", 5, 0x003C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_078[] = { {"isin", 4, 0x02208, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_07C[] = { {"rarr", 4, 0x02192, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_089[] = { {"ccedil", 6, 0x000E7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_08D[] = { {"raquo", 5, 0x000BB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_08E[] = { {"Omega", 5, 0x003A9, 0}, {"zwnj", 4, 0x0200C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_091[] = { {"psi", 3, 0x003C8, 0}, {"there4", 6, 0x02234, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_092[] = { {"hArr", 4, 0x021D4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_096[] = { {"le", 2, 0x02264, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_098[] = { {"Atilde", 6, 0x000C3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_099[] = { {"Zeta", 4, 0x00396, 0}, {"infin", 5, 0x0221E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_09D[] = { {"frasl", 5, 0x02044, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0A0[] = { {"euro", 4, 0x020AC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0A5[] = { {"lt", 2, 0x0003C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0A7[] = { {"aelig", 5, 0x000E6, 0}, {"Mu", 2, 0x0039C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0A8[] = { {"macr", 4, 0x000AF, 0}, {"image", 5, 0x02111, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0AA[] = { {"ldquo", 5, 0x0201C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0AE[] = { {"omega", 5, 0x003C9, 0}, {"upsih", 5, 0x003D2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0B0[] = { {"THORN", 5, 0x000DE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0B2[] = { {"Iota", 4, 0x00399, 0}, {"harr", 4, 0x02194, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0B4[] = { {"bull", 4, 0x02022, 0}, {"rceil", 5, 0x02309, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0B8[] = { {"atilde", 6, 0x000E3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0B9[] = { {"zeta", 4, 0x003B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0BA[] = { {"emsp", 4, 0x02003, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0BC[] = { {"perp", 4, 0x022A5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0C2[] = { {"Prime", 5, 0x02033, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0C4[] = { {"frac12", 6, 0x000BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0C5[] = { {"Ntilde", 6, 0x000D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0C6[] = { {"frac14", 6, 0x000BC, 0}, {"circ", 4, 0x002C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0C7[] = { {"mu", 2, 0x003BC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0C8[] = { {"Gamma", 5, 0x00393, 0}, {"Nu", 2, 0x0039D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0CE[] = { {"fnof", 4, 0x00192, 0}, {"quot", 4, 0x00022, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0D2[] = { {"iota", 4, 0x003B9, 0}, {"mdash", 5, 0x02014, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0D8[] = { {"ne", 2, 0x02260, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0DB[] = { {"Theta", 5, 0x00398, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0DC[] = { {"ni", 2, 0x0220B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0E2[] = { {"prime", 5, 0x02032, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0E5[] = { {"ntilde", 6, 0x000F1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0E6[] = { {"Lambda", 6, 0x0039B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0E8[] = { {"gamma", 5, 0x003B3, 0}, {"nu", 2, 0x003BD, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0EB[] = { {"pound", 5, 0x000A3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0EE[] = { {"permil", 6, 0x02030, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0F9[] = { {"cap", 3, 0x02229, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0FA[] = { {"iexcl", 5, 0x000A1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0FB[] = { {"Agrave", 6, 0x000C0, 0}, {"theta", 5, 0x003B8, 0}, {"ensp", 4, 0x02002, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0FE[] = { {"Pi", 2, 0x003A0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_0FF[] = { {"crarr", 5, 0x021B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_100[] = { {"iquest", 6, 0x000BF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_105[] = { {"forall", 6, 0x02200, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_106[] = { {"Phi", 3, 0x003A6, 0}, {"lambda", 6, 0x003BB, 0}, {"or", 2, 0x02228, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_108[] = { {"frac34", 6, 0x000BE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_10D[] = { {"notin", 5, 0x02209, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_10E[] = { {"dArr", 4, 0x021D3, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_10F[] = { {"Dagger", 6, 0x02021, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_111[] = { {"yen", 3, 0x000A5, 0}, {"weierp", 6, 0x02118, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_113[] = { {"uml", 3, 0x000A8, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_117[] = { {"tilde", 5, 0x002DC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_118[] = { {"Aacute", 6, 0x000C1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_11A[] = { {"loz", 3, 0x025CA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_11B[] = { {"agrave", 6, 0x000E0, 0}, {"thinsp", 6, 0x02009, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_11E[] = { {"pi", 2, 0x003C0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_11F[] = { {"micro", 5, 0x000B5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_125[] = { {"spades", 6, 0x02660, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_126[] = { {"phi", 3, 0x003C6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_12E[] = { {"darr", 4, 0x02193, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_12F[] = { {"Oslash", 6, 0x000D8, 0}, {"Tau", 3, 0x003A4, 0}, {"dagger", 6, 0x02020, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_135[] = { {"Ocirc", 5, 0x000D4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_136[] = { {"alefsym", 7, 0x02135, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_138[] = { {"aacute", 6, 0x000E1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_13A[] = { {"divide", 6, 0x000F7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_13F[] = { {"sdot", 4, 0x022C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_143[] = { {"reg", 3, 0x000AE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_149[] = { {"real", 4, 0x0211C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_14B[] = { {"Scaron", 6, 0x00160, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_14F[] = { {"cent", 4, 0x000A2, 0}, {"oslash", 6, 0x000F8, 0}, {"tau", 3, 0x003C4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_150[] = { {"thorn", 5, 0x000FE, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_153[] = { {"ndash", 5, 0x02013, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_154[] = { {"piv", 3, 0x003D6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_155[] = { {"ocirc", 5, 0x000F4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_156[] = { {"Aring", 5, 0x000C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_158[] = { {"nbsp", 4, 0x000A0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_15C[] = { {"Iuml", 4, 0x000CF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_15F[] = { {"rsquo", 5, 0x02019, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_160[] = { {"rsaquo", 6, 0x0203A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_163[] = { {"hellip", 6, 0x02026, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_166[] = { {"Otilde", 6, 0x000D5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_16B[] = { {"scaron", 6, 0x00161, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_16C[] = { {"Yuml", 4, 0x00178, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_16E[] = { {"sup1", 4, 0x000B9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_16F[] = { {"sup2", 4, 0x000B2, 0}, {"Delta", 5, 0x00394, 0}, {"sbquo", 5, 0x0201A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_170[] = { {"sup3", 4, 0x000B3, 0}, {"lrm", 3, 0x0200E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_173[] = { {"diams", 5, 0x02666, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_175[] = { {"OElig", 5, 0x00152, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_176[] = { {"aring", 5, 0x000E5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_178[] = { {"oplus", 5, 0x02295, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_17C[] = { {"iuml", 4, 0x000EF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_17F[] = { {"Egrave", 6, 0x000C8, 0}, {"uArr", 4, 0x021D1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_181[] = { {"Beta", 4, 0x00392, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_183[] = { {"nabla", 5, 0x02207, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_186[] = { {"ETH", 3, 0x000D0, 0}, {"otilde", 6, 0x000F5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_187[] = { {"laquo", 5, 0x000AB, 0}, {"times", 5, 0x000D7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_18C[] = { {"yuml", 4, 0x000FF, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_18D[] = { {"cup", 3, 0x0222A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_18E[] = { {"Rho", 3, 0x003A1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_18F[] = { {"Ugrave", 6, 0x000D9, 0}, {"delta", 5, 0x003B4, 0}, {"equiv", 5, 0x02261, 0}, {"sub", 3, 0x02282, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_194[] = { {"curren", 6, 0x000A4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_196[] = { {"not", 3, 0x000AC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_197[] = { {"acute", 5, 0x000B4, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_19A[] = { {"prod", 4, 0x0220F, 0}, {"sum", 3, 0x02211, 0}, {"lsaquo", 6, 0x02039, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_19C[] = { {"Eacute", 6, 0x000C9, 0}, {"Omicron", 7, 0x0039F, 0}, {"sigmaf", 6, 0x003C2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_19D[] = { {"sup", 3, 0x02283, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_19F[] = { {"egrave", 6, 0x000E8, 0}, {"uarr", 4, 0x02191, 0}, {"lowast", 6, 0x02217, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1A0[] = { {"zwj", 3, 0x0200D, 0}, {"bdquo", 5, 0x0201E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1A1[] = { {"beta", 4, 0x003B2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1A2[] = { {"Ouml", 4, 0x000D6, 0}, {"supe", 4, 0x02287, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1A4[] = { {"plusmn", 6, 0x000B1, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1A6[] = { {"cedil", 5, 0x000B8, 0}, {"prop", 4, 0x0221D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1A7[] = { {"lang", 4, 0x02329, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1A8[] = { {"radic", 5, 0x0221A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1A9[] = { {"para", 4, 0x000B6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1AC[] = { {"Uacute", 6, 0x000DA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1AE[] = { {"szlig", 5, 0x000DF, 0}, {"rho", 3, 0x003C1, 0}, {"lceil", 5, 0x02308, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1AF[] = { {"ugrave", 6, 0x000F9, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1B0[] = { {"rdquo", 5, 0x0201D, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1B5[] = { {"deg", 3, 0x000B0, 0}, {"trade", 5, 0x02122, 0}, {"oelig", 5, 0x00153, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1B9[] = { {"Chi", 3, 0x003A7, 0}, {"rfloor", 6, 0x0230B, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1BC[] = { {"eacute", 6, 0x000E9, 0}, {"omicron", 7, 0x003BF, 0}, {"part", 4, 0x02202, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1BE[] = { {"clubs", 5, 0x02663, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1BF[] = { {"Epsilon", 7, 0x00395, 0}, {"Eta", 3, 0x00397, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1C2[] = { {"ouml", 4, 0x000F6, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1C4[] = { {"#039", 4, 0x00027, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1C9[] = { {"Ograve", 6, 0x000D2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1CC[] = { {"uacute", 6, 0x000FA, 0}, {"cong", 4, 0x02245, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1CF[] = { {"Upsilon", 7, 0x003A5, 0}, {"asymp", 5, 0x02248, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1D0[] = { {"ordf", 4, 0x000AA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1D4[] = { {"sube", 4, 0x02286, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1D7[] = { {"ordm", 4, 0x000BA, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1D8[] = { {"Euml", 4, 0x000CB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1D9[] = { {"chi", 3, 0x003C7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1DD[] = { {"nsub", 4, 0x02284, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1DF[] = { {"epsilon", 7, 0x003B5, 0}, {"eta", 3, 0x003B7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1E6[] = { {"Oacute", 6, 0x000D3, 0}, {"eth", 3, 0x000F0, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1E8[] = { {"Uuml", 4, 0x000DC, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1E9[] = { {"ograve", 6, 0x000F2, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1ED[] = { {"rang", 4, 0x0232A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1EF[] = { {"upsilon", 7, 0x003C5, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1F1[] = { {"ge", 2, 0x02265, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1F2[] = { {"Kappa", 5, 0x0039A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1F3[] = { {"lfloor", 6, 0x0230A, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1F4[] = { {"sect", 4, 0x000A7, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1F6[] = { {"otimes", 6, 0x02297, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1F8[] = { {"euml", 4, 0x000EB, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_html4_1F9[] = { {"shy", 3, 0x000AD, 0}, {NULL, 0, 0, 0} }; + +static const entity_cp_map *const ht_buckets_html4[] = { + ht_bucket_html4_000, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_003, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_006, ht_bucket_empty, + ht_bucket_html4_008, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_00B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_00E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_012, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_016, ht_bucket_empty, + ht_bucket_html4_018, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_01B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_020, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_023, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_026, ht_bucket_html4_027, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_02B, + ht_bucket_html4_02C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_02F, + ht_bucket_html4_030, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_034, ht_bucket_empty, ht_bucket_html4_036, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_03B, + ht_bucket_html4_03C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_040, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_046, ht_bucket_html4_047, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_04B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_04F, + ht_bucket_html4_050, ht_bucket_html4_051, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_054, ht_bucket_empty, ht_bucket_html4_056, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_059, ht_bucket_empty, ht_bucket_html4_05B, + ht_bucket_html4_05C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_064, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_067, + ht_bucket_empty, ht_bucket_html4_069, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_071, ht_bucket_html4_072, ht_bucket_empty, + ht_bucket_html4_074, ht_bucket_empty, ht_bucket_html4_076, ht_bucket_empty, + ht_bucket_html4_078, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_07C, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_089, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_08D, ht_bucket_html4_08E, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_091, ht_bucket_html4_092, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_096, ht_bucket_empty, + ht_bucket_html4_098, ht_bucket_html4_099, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_09D, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_0A0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_0A5, ht_bucket_empty, ht_bucket_html4_0A7, + ht_bucket_html4_0A8, ht_bucket_empty, ht_bucket_html4_0AA, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0AE, ht_bucket_empty, + ht_bucket_html4_0B0, ht_bucket_empty, ht_bucket_html4_0B2, ht_bucket_empty, + ht_bucket_html4_0B4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_0B8, ht_bucket_html4_0B9, ht_bucket_html4_0BA, ht_bucket_empty, + ht_bucket_html4_0BC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0C2, ht_bucket_empty, + ht_bucket_html4_0C4, ht_bucket_html4_0C5, ht_bucket_html4_0C6, ht_bucket_html4_0C7, + ht_bucket_html4_0C8, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0CE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0D2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_0D8, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0DB, + ht_bucket_html4_0DC, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0E2, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_0E5, ht_bucket_html4_0E6, ht_bucket_empty, + ht_bucket_html4_0E8, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0EB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0EE, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_0F9, ht_bucket_html4_0FA, ht_bucket_html4_0FB, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_0FE, ht_bucket_html4_0FF, + ht_bucket_html4_100, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_105, ht_bucket_html4_106, ht_bucket_empty, + ht_bucket_html4_108, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_10D, ht_bucket_html4_10E, ht_bucket_html4_10F, + ht_bucket_empty, ht_bucket_html4_111, ht_bucket_empty, ht_bucket_html4_113, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_117, + ht_bucket_html4_118, ht_bucket_empty, ht_bucket_html4_11A, ht_bucket_html4_11B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_11E, ht_bucket_html4_11F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_125, ht_bucket_html4_126, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_12E, ht_bucket_html4_12F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_135, ht_bucket_html4_136, ht_bucket_empty, + ht_bucket_html4_138, ht_bucket_empty, ht_bucket_html4_13A, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_13F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_143, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_149, ht_bucket_empty, ht_bucket_html4_14B, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_14F, + ht_bucket_html4_150, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_153, + ht_bucket_html4_154, ht_bucket_html4_155, ht_bucket_html4_156, ht_bucket_empty, + ht_bucket_html4_158, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_15C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_15F, + ht_bucket_html4_160, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_163, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_166, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_16B, + ht_bucket_html4_16C, ht_bucket_empty, ht_bucket_html4_16E, ht_bucket_html4_16F, + ht_bucket_html4_170, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_173, + ht_bucket_empty, ht_bucket_html4_175, ht_bucket_html4_176, ht_bucket_empty, + ht_bucket_html4_178, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_17C, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_17F, + ht_bucket_empty, ht_bucket_html4_181, ht_bucket_empty, ht_bucket_html4_183, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_186, ht_bucket_html4_187, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_18C, ht_bucket_html4_18D, ht_bucket_html4_18E, ht_bucket_html4_18F, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_194, ht_bucket_empty, ht_bucket_html4_196, ht_bucket_html4_197, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_19A, ht_bucket_empty, + ht_bucket_html4_19C, ht_bucket_html4_19D, ht_bucket_empty, ht_bucket_html4_19F, + ht_bucket_html4_1A0, ht_bucket_html4_1A1, ht_bucket_html4_1A2, ht_bucket_empty, + ht_bucket_html4_1A4, ht_bucket_empty, ht_bucket_html4_1A6, ht_bucket_html4_1A7, + ht_bucket_html4_1A8, ht_bucket_html4_1A9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_1AC, ht_bucket_empty, ht_bucket_html4_1AE, ht_bucket_html4_1AF, + ht_bucket_html4_1B0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_1B5, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_1B9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_1BC, ht_bucket_empty, ht_bucket_html4_1BE, ht_bucket_html4_1BF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_1C2, ht_bucket_empty, + ht_bucket_html4_1C4, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_1C9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_1CC, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_1CF, + ht_bucket_html4_1D0, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_html4_1D4, ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_1D7, + ht_bucket_html4_1D8, ht_bucket_html4_1D9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_1DD, ht_bucket_empty, ht_bucket_html4_1DF, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_html4_1E6, ht_bucket_empty, + ht_bucket_html4_1E8, ht_bucket_html4_1E9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_html4_1ED, ht_bucket_empty, ht_bucket_html4_1EF, + ht_bucket_empty, ht_bucket_html4_1F1, ht_bucket_html4_1F2, ht_bucket_html4_1F3, + ht_bucket_html4_1F4, ht_bucket_empty, ht_bucket_html4_1F6, ht_bucket_empty, + ht_bucket_html4_1F8, ht_bucket_html4_1F9, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, +}; + +static const entity_ht ent_ht_html4 = { + 0x200, + ht_buckets_html4 +}; + +/* end of HTML 4.01 hash table for entity -> codepoint }}} */ + +/* {{{ Start of Basic entities (no apos) table for codepoint -> entity */ + +static const entity_stage3_row stage3_table_be_noapos_00000[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"quot", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"amp", 3} } }, {0, { {"#039", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lt", 2} } }, {0, { {NULL, 0} } }, {0, { {"gt", 2} } }, {0, { {NULL, 0} } }, +}; + +/* {{{ Basic entities (no apos) hash table for entity -> codepoint */ + +static const entity_cp_map ht_bucket_be_noapos_000[] = { {"gt", 2, 0x0003E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_be_noapos_003[] = { {"amp", 3, 0x00026, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_be_noapos_004[] = { {"#039", 4, 0x00027, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_be_noapos_005[] = { {"lt", 2, 0x0003C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_be_noapos_00E[] = { {"quot", 4, 0x00022, 0}, {NULL, 0, 0, 0} }; + +static const entity_cp_map *const ht_buckets_be_noapos[] = { + ht_bucket_be_noapos_000, ht_bucket_empty, ht_bucket_empty, ht_bucket_be_noapos_003, + ht_bucket_be_noapos_004, ht_bucket_be_noapos_005, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_be_noapos_00E, ht_bucket_empty, +}; + +static const entity_ht ent_ht_be_noapos = { + 0x10, + ht_buckets_be_noapos +}; + +/* end of Basic entities (no apos) hash table for entity -> codepoint }}} */ + +/* {{{ Start of Basic entities (with apos) table for codepoint -> entity */ + +static const entity_stage3_row stage3_table_be_apos_00000[] = { + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"quot", 4} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"amp", 3} } }, {0, { {"apos", 4} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, + {0, { {"lt", 2} } }, {0, { {NULL, 0} } }, {0, { {"gt", 2} } }, {0, { {NULL, 0} } }, +}; + +/* {{{ Basic entities (with apos) hash table for entity -> codepoint */ + +static const entity_cp_map ht_bucket_be_apos_000[] = { {"gt", 2, 0x0003E, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_be_apos_003[] = { {"amp", 3, 0x00026, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_be_apos_005[] = { {"lt", 2, 0x0003C, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_be_apos_008[] = { {"apos", 4, 0x00027, 0}, {NULL, 0, 0, 0} }; +static const entity_cp_map ht_bucket_be_apos_00E[] = { {"quot", 4, 0x00022, 0}, {NULL, 0, 0, 0} }; + +static const entity_cp_map *const ht_buckets_be_apos[] = { + ht_bucket_be_apos_000, ht_bucket_empty, ht_bucket_empty, ht_bucket_be_apos_003, + ht_bucket_empty, ht_bucket_be_apos_005, ht_bucket_empty, ht_bucket_empty, + ht_bucket_be_apos_008, ht_bucket_empty, ht_bucket_empty, ht_bucket_empty, + ht_bucket_empty, ht_bucket_empty, ht_bucket_be_apos_00E, ht_bucket_empty, +}; + +static const entity_ht ent_ht_be_apos = { + 0x10, + ht_buckets_be_apos +}; + +/* end of Basic entities (with apos) hash table for entity -> codepoint }}} */ + +#endif /* HTML_TABLES_H */ diff --git a/include/php/ext/standard/info.h b/include/php/ext/standard/info.h new file mode 100644 index 0000000..e8eda9c --- /dev/null +++ b/include/php/ext/standard/info.h @@ -0,0 +1,75 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rasmus Lerdorf | + | Zeev Suraski | + | Colin Viebrock | + +----------------------------------------------------------------------+ +*/ + +#ifndef INFO_H +#define INFO_H + +#define PHP_ENTRY_NAME_COLOR "#ccf" +#define PHP_CONTENTS_COLOR "#ccc" +#define PHP_HEADER_COLOR "#99c" + +#define PHP_INFO_GENERAL (1<<0) +#define PHP_INFO_CREDITS (1<<1) +#define PHP_INFO_CONFIGURATION (1<<2) +#define PHP_INFO_MODULES (1<<3) +#define PHP_INFO_ENVIRONMENT (1<<4) +#define PHP_INFO_VARIABLES (1<<5) +#define PHP_INFO_LICENSE (1<<6) +#define PHP_INFO_ALL 0xFFFFFFFF + +#ifndef HAVE_CREDITS_DEFS +#define HAVE_CREDITS_DEFS + +#define PHP_CREDITS_GROUP (1<<0) +#define PHP_CREDITS_GENERAL (1<<1) +#define PHP_CREDITS_SAPI (1<<2) +#define PHP_CREDITS_MODULES (1<<3) +#define PHP_CREDITS_DOCS (1<<4) +#define PHP_CREDITS_FULLPAGE (1<<5) +#define PHP_CREDITS_QA (1<<6) +#define PHP_CREDITS_WEB (1<<7) +#define PHP_CREDITS_ALL 0xFFFFFFFF + +#endif /* HAVE_CREDITS_DEFS */ + +#define PHP_LOGO_DATA_URI "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHkAAABACAYAAAA+j9gsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAD4BJREFUeNrsnXtwXFUdx8/dBGihmE21QCrQDY6oZZykon/gY5qizjgM2KQMfzFAOioOA5KEh+j4R9oZH7zT6MAMKrNphZFSQreKHRgZmspLHSCJ2Co6tBtJk7Zps7tJs5t95F5/33PvWU4293F29ybdlPzaM3df2XPv+Zzf4/zOuWc1tkjl+T0HQ3SQC6SBSlD6WKN4rusGm9F1ps/o5mPriOf8dd0YoNfi0nt4ntB1PT4zYwzQkf3kR9/sW4xtpS0CmE0SyPUFUJXFMIxZcM0jAZ4xrKMudQT7963HBF0n6EaUjkP0vI9K9OEHWqJLkNW1s8mC2WgVTwGAqWTafJzTWTKZmQuZ/k1MpAi2+eys6mpWfVaAPzcILu8EVKoCAaYFtPxrAXo8qyNwzZc7gSgzgN9Hx0Ecn3j8xr4lyHOhNrlpaJIgptM5DjCdzrJ0Jmce6bWFkOpqs0MErA4gXIBuAmY53gFmOPCcdaTXCbq+n16PPLXjewMfGcgEttECeouTpk5MplhyKsPBTiXNYyULtwIW7Cx1vlwuJyDLR9L0mQiVPb27fhA54yBbGttMpc1OWwF1cmKaH2FSF7vAjGezOZZJZ9j0dIZlMhnuRiToMO0c+N4X7oksasgEt9XS2KZCHzoem2Ixq5zpAuDTqTR14FMslZyepeEI4Ogj26n0vLj33uiigExgMWRpt+CGCsEePZqoePM738BPTaJzT7CpU0nu1yXpAXCC3VeRkCW4bfJYFZo6dmJyQTW2tvZc1nb719iyZWc5fmZ6Osu6H3uVzit52oBnMll2YizGxk8muFZLAshb/YKtzQdcaO3Y2CQ7eiy+YNGvLN+4+nJetm3bxhKJxJz316xZw1pbW9kLew+w1944XBEaPj6eYCeOx1gqNe07bK1MwIDbKcOFOR49GuePT5fcfOMX2drPXcQ0zf7y2tvbWVdXF/v1k2+yQ4dPVpQ5P0Um/NjoCX6UBMFZR6k+u7qMYVBYDIEqBW7eXAfPZX19zp2/oaGBHysNMGTFinPZik9fWggbI5Omb13zUDeB3lLsdwaK/YPeyAFU0i8Aw9/2Dwyx4SPjFQEYUlf3MTYw4Jx7CIVCbHR0oqIDNMD+FMG+ZE0dO/tsHlvAWnYS6H4qjfMC+Zld/wg92/tuv2WeeYT87j+H2aFDxysGLuSy+o/z49DQkONnmpqa2MjRyoYsZOXKGnb5Z+vZqlUrxUsAvI9At/oK+elnBpoNw+Dai9TekSMxDrgSh0KrSYshTprc2NhoRf1JtlikqirAVl98AddsSavDBDrsC+QdT7/TSoB344tzOZ39+70RbporVerqasyw1MEnC8iV6I9VTDi0uqbmfPFSq2W+gyUHXuEdb3WR5rab5jnD3i/BNMN8ChNaqsTiKa55KmBWX+Tuj0XQdQVF307nhTH0CPls+O0UPbaT5TQG/8qX68u6LpV67LQ6dNknaYgaYyPDx2TzvYGCsnhRkH8b/rsF2GDj1MCInkvxvRjOuCUlipWD/zrKx7ZOwBF0vfSSM2ShyaqAAOC1Nw+zt9/5YNbrN1zfwIdpfgnqebv/A6pnWAn4qlW1HPgHQ6OeoG3N9RO/+StMdDtmV2LxJPfBpQCGfwTgrVu38jFrKaW2tpZt2LCBdXR0sEgkwhv21u9cxQsyW3ZB1+DgoOM54btU6tu8eTPr6elhy5fr7IZNDey+e76e9/fCLcAllHpdKKinpaUlX8+111xB9VzNrYxqUAY/XVVVJYMOekLu2fFGM8VWYQRYiYkU9bD4vPlHFYnH4/zvkb1CgwACHgMoUpdyw3sFXcXUh4YHaNSHDqaxdL5jwVTXBpeXVY9oF3RcUQ+O09NT7Cayfld+4RJlP42gTIq8w66Qf/X4a6FTSSMMDcaE/NhYecMM+MdyG90OAhodWoAGkTUaSZByO5WdiA4GqwStrrM6k5vFKEXQserr63l7oR5V0NBojKctaSZtbneErOtGmFxwkGewjk0UzpCUlJSIRqMcjN8CkHLDqyRByq0PEGBBhDmdj7rQVujAaLfrrlk7xyW5gUaxpEtOmOQDr0e799NYmDVBi0+OT7FcbsaXxEQk8qprEBQMBm0vVKUBRcNjskFE8W71lSt79uzhda1d6w4ZGTUUp3NWAQ3TvW/fPvbVq+rZH/ceULOcF1/I06CY3QJohCCzNJnYdgEwwvpUKuNbUsLNpO3evZtfSGHp7+/nS2pw3LLFPVWLoA5yHQUtXvXFYjH+vU4F5yOibzsRUL38MTqC3XWh8GCWziMcDjt2BNEZUIfoUOpJkwvziT3S5ua8Jj/4yD5E0yERbPkhKv4RF4mhkN1wCMHN2rWfYZ2dnWz9+vXchNkJzBoaQ8Bxqg91wWo41YdO2dzczD+3bt06Rw0rBG4nOF8oi9M0Jsw9OgLqQ124BifLgeuHyVbN0NXUrODBmDWxgRR0pNrUYqMNgDOZGZbNzvgCuc4j0kX+GPJ2//CcMagQmKkbrm/knwVEp++SIXulM1+nhj9AY207QRDnpsnye24WA59DkuPlV/5j+z5eB2hE0W1tbTyQdNJmDpksRzFp2E9csFJAboRvDvz8gZdJgw2ek55KZphfAv+Inu8UdKnmkEUHQK93EjEZ4Rbkifq8JiactEpYAy9Nli2Gm6CjIZPn1qlKFWizleOG3BIwdKNZ+KRMxr9VHKvr1NKLXo2BhlAVFRPq1qlWW6MBr3NWyY2rTGXO5ySJlN9uDuiGsV7XTVPtl8CHYGizf/9+V5Om0hAwVV4ahuU8qia03HP26kyqFkMOTudDzjs/P/QKBUiBYa5ZNucfZJUkCG/0IhpCxYyqBF3lnLOII8q1GKqdStQ3rTh5MStwXX5O/nE1metGQzPHUH6JatA1OppQ8u1eUbpX44tO4GY5vM5Z9sduFgOfG1GwUOK6VFzaSAmrWCSfzGCuuT/O+bi6QwRdTtqXN2keJ4/ejgkJ5HedRARkbkGe6ARulgMWQ+Wc3cDAWohhoZdcue7ifJ7crfP6Me8dELd0Mv8U2begC2k9SHd3t+NnNm7cqKwRbiYUkykqvlZlmOYVLIq5bHRep46JzotOc9BhuFc0ZHGLph+CJIaXr1FZSIfxsdBiN1+LpALEK2By61Aqs0rwtV7DNBU3BMCYixYTLU6C8bM5hBwum0k1mesBpmPtlj+qXFenFsAgCVLon9DYeIxUnmh05HCdBIkCVRP6ussiepVZJZXIutCHwt2I0YGY2Kiz3AIyeG5aLNooVULQBbHy1/nAK2oEtEanheil+GO3aFg0FnwSilNC4q6OrXzywc0XCy1WMaFu/tgrCBLRuWpHuP+n1zqmRXFN0GAnwKgHeW1E1C/86UDJHFKptATZMPZTafbLXHtN3OPixKRC4ev4GwB2Gy6JxhQNEYul+KoKp79RMaGqKzy9ovzt27c7pidVZtYAGJMYOP7u6bdK1mLI1GQ+/ogSZBahwKuLO2jSZt0odw65xrUhAMNrZskLsGiIXz72F3bTjV+ixvtbWcMQr3NWCbog5VyXAIy63PLrqpJITIqHkcD9P7suSiYbG53wvTLKDbr8WBbjZqIF4F3PD3ItRn1eQd5CBF3lCM5RAIYfVp0/dgZ8SvbJ2/l8MmlvNw+8qJTjm+drWQwaAXO9KMuWncc1GBMXKkGeV/pU5ZxFIsTvzovOCu3HvDnOE7NTu3rLr+PE8fy6+IEX9947YM4n/+LbPT/88R8QqoYAuVSDrZLFKcYso2AcLBIeGDPu6h3M+yqvIE/4Y6w4LdUfi+jcr86L75KvC9+PcbVfd1hCi6U7Innwk1/+Q5rcoetsdyBg3s9aCmivBsNFifGfG9zCJUFiztmpEXAbqhMgr6SLWBPu9R1enRfm1ktrC6cVYWH+/Mqg43x6sYK1edaCex7vkRZHZkF+6P6NkXvvi/TpLNBUaqTtdcsoLtIrVTcem2EHDh7m2uq0ikMINBvafOmazzt+BkGMW9CF70DndPsOaJqb38Y1oXjdCYHOiqwbPofrKid6thMAlnxxPtMy6w4K0ubNhq73U5wd5PtVleCTd+50D2CEafLloqixyv0ufMcOGq64CVaMYN2119gfAdPpuscKOxWgCMDwxfm0pvzBhx9siRLoFt3ca7Ikf+x2yygaYzHdTSi7IT9y8fMJ2Lpdhg+ZCPA2+f05d1A88mBLHzQaoA1dL6ohVLJGi+1uQj8XQMyHIMgaGT6eDxuozMkD294LRaB7CPI27DLHQSskSFRvGa30O/zndF4fF0DMhwa//9//iZ2DcILqN7xBHn1oUweNn7eJ3WO9QHvdMlrMsphKEj8XQPgpuHVVMtGOgF0hC9CGTqbb2kHOzXx73aKiuiymEv2x22ICMYYeWSALBQ7RQ0fkoZIr4DnRtS3ohzf1dNzTG9d0PcwMLahZO8UyKTMm38wteratSVtkplq4oWj0PcfrEinPhYg14H+hvdIwCVs1bvb6O+UBMYFGl90d0LRGLRDgoHEUwYnXDniQStocTVUwfPLaKQGA/RoWOmkvtnsaG8unK+PWMKlH5e+Lznp03N27RdO0TkxmYNZKszYBlyfI3RpjsQkmMOo8ls4Wsx1EKcEVAEvayyNoeRzsO2RI+93PNRLesGYtNpBhL4l/prlgZz5ob0mbtZVFhWC301d0EuQgAHPgS7D9hssTHKyMbRfLptF213NBDRuoaqxNA2yh2VUBDnxJ1M1yRW6gOgt2x64gqXK7ht1yOWyW1+wl7bYXvhUygQXgit4KuVDuBGzSbA2bmmtayNzpRgJOGu7XosHFChZzvrGTiUKt5UMiVsmbmtsCb3+2lZmwm3hFNsA/CiYdKyfhYx3Aws8urp8nsJM72naGCG8zYwZMecjk/WHVVRbsMwU6tBVQsWJS2sNDlrgVTO0RE/vzKQtuN2+/85k5PxlUaL75D3BZwKss+JUqSFRAO/F7Eqlkmj+2gbrgYE8rZFluu+P3pOGsyWCG/Y9/GR8exC+vYfc5flxgzRdDGsDEz/8AJsxwQcBUKPCtmKOMFJO8OKMgF8r3b3sKkAm69TN+2OZCAm5ID/g9XPypwX29ufWgudq0urrKes/8nPkxgy1bdg6z/or/SFc2mzV/xs+6HwySTmdYJp2dpaWKEregYrVfn9/B0xkD2U6+e+sOaHqImTfLrycUOIZM1hJwC3oemPXbi/y5PnsrJ136bUa8pxu69BklmANWwDRkgR1wmwVaglyi3Nz6JLQ+ZG5NxQsgNdAhmIfJN7wxgoWg9fxzPQ+c/g9YAIXgeUKCyipJO4uR/wswAOIwB/5IgxvbAAAAAElFTkSuQmCC" +#define PHP_EGG_LOGO_DATA_URI "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHkAAABACAMAAAAJUSgeAAADAFBMVEVHcExweqyBiLNHS42mqtBgY5dbXpVjd7tMTotISotMTo+VmrutsNanq9CusdaYnL6Tmb+qrMZKTIx0eK1hY6BISotITY+Ok8JmbqdvcauorMp8f7R9gKx3gaxecK1ISouTlsVZXHx3e7MBAQBISoszSacgKYQ6UrAvQqM9VbIdJn4hLIo4T60mNpYtPqQfKYcmNJ4sPpgzRp8pOpQpOaMzRqYnNZs1TKowRacyRqOustYlMZsqOoslMIkiLYYlMpYnNIwxRZstPpUcJYIxRasnN5AyR68lMpEkMY0wQpYqOpsvQZkfKZUmNZEkMHwZIHUsPpsvQacuPpI6ULU+Vr0wQ60uPp8wQp8pOacdJXs2S68kL3YjLY8tQZ4zSaMiLIEpOpgoN580SKsfKWwZIXseKJB+g7Y3TrIhL5RCWrhAV7QZIG0pN4crOp+DiLgsP6t6f7QhK3InNIA6Uro5TaosPqgqOpEfLY0dJXU9VLdyebAeJ4wlMoQ2S6cfK5EgK3kiMJkgLZotPI9BWr0aI18jMJ4VG2Y4TqQaJolvda2LkrmTl8U0SLIZJJGZncYiNaJrb6k1S54NDAYbGhFHYMA/PjptfLxNZscZK58cMZFEW8NNZLlHX7s8U6s2SrZddsgWJplXaK8oPZ9DWKpqesZHXbVZb8BiaqaMkMGlqc5YXpgSGFIUGVtTaL1QVJOeosyGjL48QVNmanoKCxAOE0crKytUa8knJR40N0Jjcq4iObA+UqE4SJUMHI+qrtNudqZJSUNshMYVHoN7gJIsQbX9/f5NT1JMT2KFl9BYWV9aX20xQo0dMadietZrcpFHYMwmMWYtZccLF4NXbdZ3iLtgb7l+jMctTrAGCC4wR7wWL7FJWp9LUnRxh9J8g6JLYatNhdk8d9FcaJ1lbqB3e4RUXYMIDUF6kt8bNZmpteoLE3YSFB9GdcKutL6Lj5d1dnUZS6lPZKQwPHXDx8+PlqudreVja4m/yuyKptoZIkODne/U2us5Usedoa8oL1YtYLdNAseBAAAAInRSTlMAq2nohiAy/EfPEE/pZ8E5/SCegWV7wMHI4w/MHpjVr9eBwELx9AAAFs9JREFUWMOs1XtUkmkeB/Bmxt1mtkybdrY9OzuX42uEGS8oSCQqIiiCECqgyKqJi3JxBQsFSSWMUFPRSREIvGAKocVoetI0b5nHMrVmTDtHy9qZmtPk6TJdpman086+XpqZ3bmcZmd+f8HLOXze7/P7Pc+zatXPlUfTwdhk1uatLPO7yw/We7i7ua2Dam1g4MBAS0tLW1vF+xs3bnTb8KqHx6rfsNyJfbGKuILsCGWJm7vbIvf9WqTbILqirMzpdLZLpelvv7PB46+/ifyOX98/8imZcRrf4QffehBWtlRSqbQdIj09KxarrMyzFNKl6VmvbPj9r5bfDevb/TckXZSXqN430NJW5mxP9/qu0qWlpaXtp5sbHA6Hy9okkdhdDkdDQ0OzcVr69q/T11wJ6tuxf29aiRKPLznwrZgFic729mmjy+7DUkGg1VorwYGpLDnbYNCKtWz5iMxnZk/WK6//f+x697WB1N3jQcf+DkMS6PqpVijjUshp42qHy2AwiIVk8DCNsE2yVWIwGVIzM0GxSVwrlojFYonGZraZC3oG3/zluPs6qKUtyL27xjOOJQjo+JTrPZA447DWimuhstrrJPa6AAQBgYgjq8QGk0UYp06LU/moxLXQO/nAURqR2tbf3zT42lu/+wXsX9wWp3igQloSUpSxqyj4VPGdeYdDYq1NLi5usttr7XZJdoHEZBDj4BIxLlWrFRsMZIIaD+aUk8FUKDObhSOIRBqRpt/c+Kn3Swdfdtvavbz2LGTs8B5/2Hr9uvfVK/ZalxiRskkCyWKJisUDVSaTxWAy8Xy0FnkMCBJEBEyELEeHj4lgsyLIeDUWROlQ9P7CQW/vP73+su5A2dIMtxZ9uLrB1fpwfLKj+kizw+powrBrodXUqthalgZVX681aYWpKpXFwqWr+Xw8P4KL0qjpmbwITA5GRAC5GIyGMjzV+uHL2O5LbtbyDPc0nu7SSogPTF0VPdB2cTU11LLYKqh4qUIxD68r5JMxWJxQxS7n6tR4FAYD8vEoPB4LCstlGBGKr0NxUVgGcmH8hre393s/22+Pdd+5XqVGKHDXnW8+Od13ZbWkydQ12bXNZeel4kB4ADyAR84E+RoNXQOm8oQxdF1hmgiMwYCyCA6HQxbK61F6rowOPcajIkMWxrOg2K+99dOwG9TfihfutNVqtZvO3fn4m10fXdkcdtDQ1TXpkliT46IRiJS4ABxIw4pEeDWdjsfGkPm6QjWCBmJy6stlEeWccra8Mg3PLSyk69NElMjQqStZRyD7jZ84XdZDgVuky6502sfHas8m+zism7cFNFn9g6KgrdM1WSu2KhhoNJoWB4fHiQiZhLy8Er1tpDcHm5YmwoIcWbmMw+Fyy1X1XB2dXqjT6PV5SmV4eP8Brz2tUOw//uiBtXZgoGzlkCo9VVngI+EdJtBEyJBE+uYmYqxi+2Yxm21RaetCQ8P9/KKTaCm0GLgIqdSBrkkLV5Sn12tQHI6Mi9HhwfKICA6Gri/U0bmGnP4SiiJYD0X6AIr95o+MFnTlrQQubaxEoAsKaEmHaQxf5JYFQV0d0Q/tFw3HlcvlOJZ/fqhfVHwSmhEdAI+haXrnH9195ujPy1scLlQOB6XByuo5MhBaaZuNe/nM4JfGYUqkbxP0x4ux3/jD/7a4raVtucOle3CfK9H+2WgSMpJGYVAEx4qKtxOJYX7xAalyi0XIyd5HDYvyj0IrwrZv3xQAjtwarbo/b8tEYUB8oYafg8Lzc2QcLgqS6baZUaDq+TNJfyQVnb7490d+QLtBN98KfBADD96piI9GCnwTwxHRNMHRY0lhQVGKsORtPJXloqmeR42lUqPCqAridv/s5LiR5m5gbHJudmTCpibwKyt1ZjNXJsPgC9P09N5Pq4HqmoovVfSog4zrUukPafeKtpUWlxZ/zvCFwUIoeSTYbj9ENA4rKCrKDxfko/38cTgW+6JJLqQGxYZRicT4JBo2E4ybNXYDZ27PNDc3OybMfPmlxYPt0sXe/pI0un7iRjXwJPDuV/M5FGLfwlSSsdTrg/+i11RUOFfgukPBJBLSt4TJhKn3/xvcBE8UMJlFuTtDFGh0EnQPWiwxPGqQIgVBiCtuajzSeJ08e6AaOD5aU1Mz1HF5tvlxR8f5jidPnng12IZLhvuNNcDVS4HnJl16RF0Qc7jfPOOEUr/37XbyrHix1MWHFUjf4DTB1TPnH/om/GtfKkgQMLcwizL2hqETaalCiCYLicE7/Wd6Wj87Ozo0NHbh4oPqKmC5huYvn1j+VNV9c9I2PDxl6gCG2Iav/mkspPj35ebD8mwTq9O9vV+cKRvLXsD+iDAGBUEY/uzuo7sdu4f37zgMqklMgS/z2NGgaCQFi2PJtUI5EXnqwlhN97JXfeBIFXDy/thYN9AJXDtXDXSeGBrqhn640DVVohkZrOo2zt+6M2POrDuYm5sA883r7zXe8F4+UtY4l+8Hr6xTh/aFpyAoU97Pnt59eu+jhaP5WAqSxNyihGUUUcNJSgScJ2fxVLHKrpOLaHcN5ABjjwHg/u2Gr69Bb3KtrAqoabl8qwWKXmM0p6EmmmuAe08/vmM0q7eJdxQxE3IFSPPciPHPS/L7zpUm7xkOT0lKQqjzH3fcDHx27+HCLjQi0ReWwfQNYYZSQ0mRtCV5ayzFDsknOnpmWjsB4OTjTuCs1TZ3rgao8rwGAGO35uYunQE6qwdH6GrNxTHgwtdfTDfbYMrsfZCckQEj6Mxz7I3rV6161elcXmvpIUZYEhyeMtw6CnQ+f9QxnsZgUCKVJGYRk0Txj1bAlCk4HguHyw46ZIXkm82VMvFZSD7TCZx3VY5ALT5xG/o+2sClz3pCuylrli4yW58/+OSLxnMyUkIIMTYXGpncBAoWpZvodUFddrYvw9HYqCQ4Dp6JPA6c6Hx873g8BsFgKJFbcjMySMnJ8X5IZcp/uC7XoKbSM46z9kOnsx+2/dKZjvuJeJJDLoSckJOckpOTkxhzOZsQUidHmuQkAWQjJAjZLFBIQFIx1pbJBIYtdKVcK6uOrtFVClhXhh1QVJDBRddVC15GHXa9bLvrZWztE+xuse9k8iEzmd/7/N/n/1zQje+iuUR0lTwzbsI238mQebxre9//AgyUfgK/zy7ktyw8AE0ujf0N//zju8uPUh9/2Mcv5uuixYVlZZWVGom/tXXL+ay3j3z06pUf38NYglAoisgV+NuNswd2lBAWt1TP5wsLaxOERyY1SgZUJegmzLujHwjT48xARRrUzZDF+XNwiZn7EOqtF11Xn56G2C90jf7+6dLL7u4917soN1+krS8WCgsrC70mKq8luSVr3ZFXIZffY1iOQBWE032F1z4zM4sNKBELgDUmoQZLKQmDXkQNbEQt76aiecPHee3XaDRvQwePd3SG13FnU9fCDK99zx6gP3+xcP82ZN7shUXgXn50c2XmRJtQL5KZhDavpri+WKMxhlpb/VlvHFntE+WJXIyFjo8SdveuldMPJ8fvKQUKu1XPF0n1OlkMwUxSUSB3YygEhaQIimLnzT7laCbFbx/njRzO7+s9zRu5fxQusv/Gg4eQ5lN3J67Pzz+6N/F1e3pfm15vlJtPSndbvVFSpJWEClrystZXrYrdkExxBKtACSUhaaJvjia6UaVASfj4IJHWQCN+Ti6SBnI3WSwl6sIIKHv21PDsaSDMzoK9Du8Y+6CD99cnaYiVt+rzqcXe3vn5y55LExMj6d42oci4u6H61snugNVnNVpCeS0tWVWr5CoORThCQaB2VhlDizYN4GxEKRYrffzCXV6zgQhYMblb2hhSWfyIelfkGq/9+FRnBjFz97uVY6dH27afejgy+S2kd+fISEfH8ckzL/Z9tfwS7HR1qGN6oamYNEgy2jZ8WdfqM4Ry81sas8qrMp4avYfFCKdCgVokTAwhVAqWjQgArfLwixk5J9lNc1ZpYwD3SUKEbddgmreyWiI7jx7y/POne/7V35Y/9O2p+w0dvKn7H1RXf7p4dyxnYhnsNNE1d4P33ZylkG9MrGpbnf24O+B05geAnOmbVTKDjCBgwoH+Y/CII6oSJYso4SCsiLHLORnbgxnr3BROUShmK4TUPjY9PX3n1ui4xBM7dGivxFJ0fmzzHBhrauHqZ19Ax0x+PjS/9HL0vbEznZ1D2518fqD/+7WsYRzfEcKbXpEbuuVsLMOxezy18ogA4Tj4xBAE7bZiJh3NRlK1Jr5UMiCxKuiwFcjtN3orFBKr3EHbcdzv9DmdVHJutp03faIPJpO8/OSh68tLyz/+88TDqSd/Spq0mu6G/22EwE7mZ60Hcvm4hxOLBQJxhCEIuQETKzNcjEMUCh8mN6UYu0dndEv5EqeVUtBq+1/SvPa0R+eIq2FGMNOs04nCVNZyIZPaC0ncZ6Goll+fWVpa6t3/j8lfLo5J+AbSvnb/rW4YTGa9UQ3kgR5xRAwngnExQibDIkoOQSBmtATBSCYhk9UaTI0ik9Fnoohz53QfQpH8d8LsiMfVMJwwGMGyuXhu8sTXkw/2/6GFshgbm97pmnj6cn55aeLMYu4OkpRJxteSs4cPDGetqy7P/t32QUFELAC5OYYWY3ImFuNiXI6AUykjHkOC1ulMIpNGapIYSScWVBv2ATmdommzOm5maNCJtTvtTr9i6PnzEy2NVF5BU1NjwWeLTyd6v5q49H5AK9LIJI/XgrMPbPhR1tuQbv2bcnIEghwxghC6eCwhq01FkFjYJXhPKU7JsITawZikGr5I4jNZS3ThoHZw8uztG2pHKhWPm2mMxgjCY7cTCrzvfF+b203l4ZRRZEluH/po8VJ/axNJksJayWvg7MOZ8Xd9dvmgOAfQYF8E8xjUiZjB3BPhdMFn3/y2p9baA2Stxusl3bhcYyGCNpdNO/xB/8mgw2GGD4NhYEgIm0VZiyQQcFN+HPfVuWEBOb9lS/Ida1BLktDrXhMbhjGYDdZll8d6cioqlDGxOEYzDpujh9FFEtyvYisXt2EkCWLXCoUak6kOt5IenS3qKrUJy8qEUbM57qB1DItBIsYIBRQhRZG/AMdDOG5xS0JuqdFiIb2kVktqRXVfVr8e8k8yk8EvqlUZskDBRTiadgSbz40zHJfYvPPZXMKhrU3J5AaTnm+yBii+tSTuCttqaprDYZstGIfMdtAYRiCQiyoVolAVFRWFQn4/sHHKTcJt+SC1Br7q+v8v5NWl9s1PVRUVoDbiwTiM0ambS1MROpX4zc6Lf0zJZTQj15JGGIStFo0whAZrXOFmVzgYjAfrm9UOtQPEBhOUICUqVYacm5vrp4xuihKJRHy9FOZnDV+vJesa1oAbDm/4+asJ8PHlCghZICDkarMublZXusbpVCqy85u9tIxJMXITaZVLpSKjV5qU19SUuuCl1eDl+vpmEuyMYVDuYlB4UZYocoZCeX63yF1XJwWyUC8s9mo0GlJjrnotsf87Af4MEmxbRQ64WVZvUwfV8WBlOGU+GXl2cW9Kx9C1coNW7pOK3HphU766tKa01OYKg5PV4frKZgdthu2OVWQOiqKWAEUFmgJbpdDXjUY+gIu9Xq9Wa1zrqeEfpt63BsUV27bliGMI660sLd1Z6nLVgGmDV1w9CZ3cXGuAA9qRZWUBu81VU1oTDofhfvFotLk+6mBkMkLBEpEIbPMhitpK4QV51O6tdbvdbr6wrFioiXo1DNbwGvj7Sf+tHkHmncUlCCEj6yt3Hvzk4MGL6fTxdNVJzmBgakmtmoT09BbqcXhlm+vVK+vM2mA46g3ClsMpYrFMxCi0HBzPz4dCEigokEpN0ozYUY2u5+/la7Prh+3mTXAziK1UYoxMF6zfdfCTK8+OZZr7fwoz39g06jCO709mjb4yW8xmMhM7gfb4Uw6OfwLXA46DQgtcj6OFtlw5mNdyxQ4olLa01JU1xRCtydS02UjUbG/ghTpiNDNZYlLf+Gbv1sQlvpmNie/cSxPjc2y23dZtP17w8nPPv+/ze57fzkcOL+F0yuWE2+31IOIKmk0GchLZZpMS22YbKAccOr9fBmG29PTwkYyBxxJa68WVfqPRq5yXyBznneu9dNjig7EKyGnQEZPOOUyUK+ut5l5bAl94sPPNb+P24rAckRN6tTqampxJZoEcyOXKNvD28EDcWZ5xOvwjFl4y2szTtNnMa7RGKzRy77gSZm9E3jeuu/7j0eBjJyQFA7Qh5C4Hks12e/fRcPRwp7s2by/aEU6O6ye50rx7DEoKyLYA1BOMkwOfDjidRYcfDUX8OnOPgeZjPE9mrEY6YlTKoRj6ECgqj2nf109P7iegP8JRyUJ6ghurtnfvf9Y5O/90v7/ldrpdUBV2vNQ3mUtmpezKzUg224owRussfrvbPxTyo8sSlVcJAp/pNxoiHiVMpB653E54er7+H/zMtqJDVqlkI1A+XAXID3cenfe6Lw2oiSHc7h5SinKfLQlZL51yGSQE3O1HJ5b1nFKP+tH4nEKQhJ9hFAafz6ce8iKIl7BDVUTSHxwY/NSG5oQJGpXJEEH1xEwlW91rP9qUf/yxFJetIYLACbuITPyazI4lIdCBSiVQJop+v1/niCtQCATqdMZVUrdbEEwmki1giQTv88zbZ4qTRT3/OLuO2kqdJsFkQyQUQolKNlnd+/ewxN7e2vLAQJeKSBYnq9XqenZ9XRSjCFd0OHTx2ARO+FG9RF5gFlQyk0BR9UaDauTDtLrMXZ4wL+47+tlN3HlKJV0yR4BcAqFo31984vagm5ryoLpctdpqNlvNVgvAwSg0KzlEeEKPB5GiE9UtLyuWDWZ+IRxmGo1GvU4xYRoKyzuxzz1q+whkk0oGw4UerwSA/EettngYXvv9+o2fkq323l4TTBZLCAJgl3LKGCLKiBgkLl8m4qp4yNvPbG+vhWkNhVkzJBUzZ3oUitpjPx+9cT1+D4pZZohb9NFKAHL7ndPnagA/xP5y2iFK4OZ6EsDRVCq1AQ2Y5PUcUrKPFHN3hx3q/pVBJpxnNINGDK6eGEnxwo1rn3fXIK+eu+kFMswxMovFy5UD2Wrz1WOvddgH8Nq0fr3VaoliqcLhrmDQpdZo6BiJmWMjhHO4kgsM+SThwlg2swqyjY3OsmRMmP7+5h3J3Odv1o/f6+2dsyzP9eBRLgBJ1EnAM2c3O/AOfVHmDYqiWClzHA4RVoIzKYon6dha2JJttbM+OnFxaWlJS2PaVavVemWUrbNCb/qLrnelvHr+dvlsLA3uNsT10WhlLLlefZz6p86c29zcrG0C/Y4fh35X4nAYpYPR8QhJa+AOQJI8s72Q3d0dM2eUPy8NDmq1VuuHV8DVLJwO+eSLHxLeBg1QzI2g0WClkkyKdw++8RWwXDp39FHEjiO4y5WKuuYxMhajaZKEv9jC1eqFW2OkcWkVsPBbxQqfjM4WCmw91pu+2vWy5zAB6llhUAajHIiEePeJ571TZ46f65DlStwll7tcUxmSZAErSMt9Jhz++69bOcqopepsIZHAsAIICaZNkAzTO32t662XkaFV9RrmUymuFMg9Re7Qzw+4oOcoXYhyaQmrxyi2zuTzULphhsnf/mWXKGhImqLYRIZk2Ua+MVvACvBh6fTLyGchwxRCT/8GRLHEHfb2/jm54VF7lX2QRSssRYJAhbfX8gLDkEwY/e6H6Fc0VZA0M6EpsCAj7CxLCQtMerrrjReTIbfTCplZ4/P2caWKOHYE+c0/J/uVuNq6sTGoqQtMHsBreYaJCWvh0INvgxqKEmgsYUwUsNGChtZgbD5PUYrpm6+/APsfPpGyoTDU6NQAAAAASUVORK5CYII=" +#define ZEND_LOGO_DATA_URI "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAAvCAYAAADKH9ehAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEWJJREFUeNrsXQl0VNUZvjNJSAgEAxHCGsNitSBFxB1l0boUW1pp3VAUrKLWKgUPUlEB13K0Yq1alaXWuh5EadWK1F0s1gJaoaCgQDRKBBJDVhKSzPR+zPfg5vLevCUzmZnwvnP+k8ybN3fevfff73/vBAJTHxc+khL5kr6T1ODk5nAgTRTWloghFVtEg/zfh2PkSvq9pJGSKiX9SdKittbJoD/PSYkrJD0vKeB4IsNNotfuUtHk/CM+IvijpF9KGiDpGEkLJZ3lC7qPeKKTpD9IWiDpUOfWPCi61ZeLvD2VIhTwp9QlTjK5NsIXdB/xxHmSpvD/OucWPSAyQw2+LfeG1SbXVra1Tqb785xUaNdMel0g7Iu5V1zPv6dJqpD0kKR/+ILuI55o8oeg1bFT0kWSOkraQxK+oPvw0TZR3ZY758foyQXf//ZxUFh0Q/GEfNf9gHkaJ6m7pHJJSyTt9tnXhxtBR2EGlnHCMbZMaHuHzX19JZ0u6VRJh0k6hM+BpMjnklZIelPSNhff3V5StkNlEWBMFm+3LcC+BW3GuZP2GvfmiEiCCMUzxZIKRGSt9zeML/fdGAW9JB3O8c6SlMZ+b5f0qaQiF7EpnieXY1auvZfG7zhSUk8RSS428F7M5xfsh1eAV/vxOzoq16sklZBqbdpo5H2qDPRQXoP3Ki0+20FSFyrZUgt+Rt/7KH2vZb8/t/iMG2Sy/0dI6sbvgHGoV8a3xErQb5Q0iTfHCplkzlkW7w+VNF3ST7QJUzFK0pVkDFiw+yV95uC7r5Z0k3CW2ApwIkrJ9B9IelfSh2SIlqC/pDFUZAVk0rQoMhk2GYswx+AtWvMKPtcyEckW37pPwsIHNAuBniDpYhEpBMmJwvibJL0gIlVh39r0C8UlczkXQ/mM6OtEzuf3RfPVAxUY47f5PStcGKPxpOMldbbxiBptPMavJX1PuQ/P/olyz12S7rD4PLyqBTQ8gyXVSOot6VK+dxR53wyl7POjkv7pkpcwpleJSCHP4eQjM0BB/ZuG4Hl9EO8mQx4ZQ0FfL+k+k+t4wNlULpkO24IGnSzpQklzKPDRAMvZ1eXz9uXfH/Pvx5Ie44C5zYQXUgDPj6LEnMCQ3AFkjjupjGF9/kJmxPw1oiquz+6dalXcCRSmYxwK0kDSRI71azb3Y+6GiMi6P/5ey3F3YpExjxdQoG61uX8gBetkh2OWFkUIVGUT1pS9yosZNu1nkl8uZH+mikhxkx1wz7mkB0WkXsKJFw1ZuSWKotY9wjNJS6mUy41JK5P0c2qCnBgIeQWZvEK7Dnf6WUljTT5TS7d0KwezkJShdWIeGeuKKJo7FktUQylcl0i6RtL/HH4OjP+wB0UTLTGHfubRDWyi1g7SaoZQ495z9w7RpaHKqHEfLeklEyWzk+7dl3TTu1KQCpV7+pBB4IWstFFAgvOpJnTL6DoW0xPbw3k/nIYkW+kbmHeXhUEABklazrBDBdzTDfyuBo5DPq1eoUk7ZbSk70l6n3MZjUdCDpQvMF/rezn7/hX7Xs8wsj/7rsrWdQxnZtrwwENUosJkDDZxTjOUkEH1ds6lzJyDZzGScRsonGNcMCIG+WgRKTRQ8Su2p7uRi/mlKjZKekREChS2KIOcTvfqp3RZDlM+cxnfv8Thc75Pt8kqo92VzNTbxBqcQlceivAdByHDIxbvFTMOLovyHAGGK3qc/jJDoDc4hpjABzBm4UAglBFqEAOqt8mB29ss4uJnNCHfSK/tVZMYEfMykt7Bcco1eDLDHCT8gmzzRdLHZL6wRSgzg6GIgVl8Xj2uhPA+oQn53yTdK2mVMC8NzuJ8zaSyM/ApxyzWCFJRvUQ3eQ29BTNFcRgt+FTl2g30zDZZtD/ZRMifE5ES6Y9MxqAHQ7XZikI9nd97j5p1f83GZTPr6Crt2sOcOB1zTYT8HrqjVRZx4wbSAt47SXn/YsZV9zp4zuvJgNGQRaszmoN1rBY6IH4dHiVHcA5dZd2zeIbPv8ZBkghYTQFTx/h1WvSz6c3kM5ewGG8Prvxc5DZWS2u+dypnM5Y3sIJMXmbxfXW0misZN56oxITnWsyl2fg+6+C+zWTefMWr68RwaYF271htHBZqCsKqL28wB/ACjYShrE9nUjfWmEU33A7woqbR4k5UlNk4yoYOzOHvtGs30KO1QgnlZC2VohGOIGn7WEvW0ZdoMeCHfBgdo8X++m3V+s2wEHKzJMblJom92+ne2SHDwT1gknUispPpJLrrVZqwLxTmy5F5jOdVS72F/b6UwlbrcEytrD00+a8l/ZUM82jEZd8peu8uNYS8JxNWqis5IYqQCy1rPUULh8Y7fOYal3zzmPb6aJN7zlf+32bBV9ESclNE85WUX4j4oNbl/fM1b2eoxX3jyXNqiDTP4Xe8Rm9ItfSjvAr6DM0d+o5MXW/CuHO0a7eZTLYT3KF9LktYZ/WdCI+IkoV+lFZ6l3J9OF14HdM0F3MrhXxFjJmqhh5FBera24XqxaCqL0UosK97Z2ku+yJaEqf4D62ByoROcjZuN78Xaa9zTBSzKvxvC+vlrmgWVPU2h4j4FCO5lZ+vNBnpYHHfOOX/PfR83eApTaGM8CLop5l88WSLWAOu4AiNme5owcBO1xhlLGO/eGAFkyYqrtFe5zKzqU7KBE5o/BAIiv7VJSK7qV4GhEF1XtSk0YseWl6lWYI+cXj6pigJLkH3Vk0qfebxe4q0JGOGSDxCWn/Nchk9qJgMfGKS87LDes1IHeVW0LszgaC6sPMYE5lBt4CzRcuy4lVMLKlWfWwcJ+YpxtcGjtOYfzRjTgNIlv0rnpyCveeHNFSJ/jUlonH/3nNYqyOU28qYhHOLbzVPqFc81JQDKxnQ5twLdmjfmQzlxU6eoZ/mma3y8D3VonlhUr6bElhMwJ81RseSxW+jfOYULdYGAw5s4WBtpeU0ijKwxnp/HCfn70piCNlMFEUU8/WpmnZe1Bq80r96m5yMkIwx9nnNHTWFs114q0ArM1HsiUY7j5/rKFIThdrrzR7agHyoy9vd3Ag64uEfKa+xjIKlLqtTUBB7FWgJrQ9joFl1d2cQ2wzHaeDXa6/ztO9Wx+OT+FrzSAKuV12ptOZp+ljnaVawk8uxDpnMZXYCGB3PXqe5sl7QQ5ubhhQR9B4mQpvjIR+gJgrbOxV0rK/rVUyXmyRWdI2a2YLEhVP3BwmN9sJ9BtQpKkxiSDOrUeUhaeQaPevKzKQ3oIVTSGatcynoRl29sIkh440a8pURNoz00Ab4Ts1obxCps1FKl8k5IpKbcmsgu6nz6ETQC+iSqoKKOPmVJBmYnDjHX4EozB9s7TgwykkyYS13URAHpmstYIloOP/HEi6Wx5a4+DwSpH2V18tTyHUPm3iQeS1s09ai4/0ntVgNRQmzHTRulGwaQNnei3FgHqPcMBEJlXrNioAaE8AcupKBd7ElBu1uTxCzg+dmKB4TahiQNX/OxssAb00Uzdeci4S3FYhEQdfkWCrc1cI2K+2EDhsP1OUxZGUnOWTmcgphV0UgZ4jUR1hLlBiuJfqJpb61CXimOrq8RqiEeu6TU3iMwdzYgWhUnWHDDKr0ptLar6USqmOfYYiGMMTUN/KgziGVTo+pNJHBBfF0zVAQc6N2DUL+tcO2Yc1Rk2ss+yBmOko43yCSCljJXAWA7PD4eAt6MBy2yiNACRvVVN05t40pPLYPsT+zlRDpOLG/Jt8OSGKhmnBpivV7q/Y6JkucVgkyWKb52rVZwl0tvNDi+AzRvKjfK1Dnjvpd1FhPEc1LBVsbqENXN35cFaPY2BIVGdlWYZKqgPPj/RythNtpcNycpoOxwAae0bGwhAkAQg01cfiDWDRqZtHhCqFQ5FAtOXKXh/Yh6Ci2N5YMUDW2SHg/N3scn02N++cnMIZCBdwS9gtApRxqDc6OlzWtSrdc8cJGlzP5fzZDri1tQNixISWL/5fSQvcVzfe/wzXfSG8Kuw03pHB/t5KMik+EYJ1EC1d0zCw6fofqRI2ZJwpvyxN4uPs0q/6UR2szyESobxatf3aa7jvfrT0DGPNpYV3H3CI0BYLGllQdy7TX14rUP/zzDHpuRp0EPLnJvH68Qij/RXnyIyku5Ea+5S3NO7s01q77eMY1qqY8T7Qs+4qtq+o2UWhjZO6HuWhjJBlZXWbAHvbFSTAxqMW+RbuG3VfviAP36tshujINh6Tr3kE0BNMl5x8Qq6+mVTdwrMlzpRrGaGPzVpw9NDNFngjoFZZzRCS/FRPXHRZT31X2MgfYTQYX1WE1moaaQJfKEFTs/camkXnUwt9YtNWPiuc67VmRlb0yiRgS/cAe7is0QXuTAm9kikM2DNc5OkeGRaMU8tq0TJHbUCOtezMeRfITiSv1PLLbGE5gb/NOB/1AuR1KlLETDltidyR4XIPasyEnc6eIbRa9kfNifFeXJOAnVJBiKfFCvobcLKccLHWojHJpIPH3iXQlpoNLrdcH44sucvmQOHHjZ9rDrGdbixVmbk/XGy4mtiKuoQDjmQpFJLs6wuSZvqKmL0ky6zOZLry+420UKUaue5ooyeqy9+iopgM989cp1Dcp16bSU1tOJbyFyjedTID5wOk6OAUFFXUDKFRLkmBM3xH7fzIJwPLsxexDMWP2b8g38DqN45ywCuH0VNuv+XmjwOYCjtUakbg6AkGlNoQGBMB5A9g8hh2g7zFE2U4F35FxfHfmwwbxcz3Yl32C/oAwPwDAS6UXdpOhXPZ27Trc9R/SLTla0zzGoXl2QAexnLVZJB/CZMpV7HthfL4lJIrb54u+tdv3/rCiSbw+k88yM9ZxXgKwlHmZycq13iSr0KeMHmUZw6r1VICrLT4D5fy4wq/5DAvfjaWC9oAd9KxwTNUJynUjL+EqpwSTME1zOWMBuIxmZ7p9RCsNq+NmdxW09I1MdNkJeYZNHsIt0qKEO2Z4kvmHadS+Xqv2cqzc93rpuhdl54tg2DISuJljBW3uZjMHrAPqHOYK6zPIM23G2+14Rts4cyLbdxo3Y667UskOo/W/m/PwRhQBwZFkT2vXzDbTtLMZCyfP1155bbfDrpjKZoYH41bO+d97jmEgMPVxFMF0iHESIkiNtDhKuwV058cw0dBZNP+lFsSU/6VWf0E4P/x+IF2eJnokr4uW/2jAKPYjjRb7Cxef70c3qsCl0im1Gj/Uu2eF6sWo0rUiTQq7zS+pYjywnXYwcyOZfI4mKgHj9N2ttHqbRfSlQXhjw5XXy4S7ZbzOovkxVRsphHp8ia3HlyleZS1zHcvoVrdjuNFdEe7edGHzSbpSria/WZ3+cxYV5DCx/4w7FUfyfTW0WO+i7x2YrzKUXZFw/sut+OxJDGkHUxEZPwgCquQcIgxZR9oXekDQk8FF60bqwocupaIoEz6EmaC3C+0Ro6Wgp4eb2tpPJqN+4xXFXQ3TfUfCc5PDNnLZDpLIV1NADKyjZa87mHgmWX57bYdIfIY3pdCGf43xQUXI62kBn3fZxi4SPC8crIjDQ4yzFAaz/XcPJn7xf03VRzIB5Z7qCbBzPQi5jga2E9bCD+ELug8ficEZCk/Cmj8Ro3aLtLxDR1/QffhIHNRTUZCf+S5G7SJBp2b7G31B9+EjcVAFEInZQ2LU7jiN1zf4gu7DR+KwTvkfO9bGx6BNnEQ8XXmN5cT3fEH34SNxwN4A9dgknIEwyWNbeRTwV7WYHBVwFQfbwKb7vOUjiYAiKVT1PczXqCLD/n5UbuLcNxTKoCgExSFNmsFCHI6iJBQFnUbqqbWPHyFceDAOrC/oPpIN+FVaVLrNUa6dLPbvoEQdO4pd1OUylBVkCutsOkqosbNvwcE6qL6g+0hG3MY4ejots1pT3kE4P9QDdfuLKeDfHswD6gu6j2TF2yQcLoqEGurre9EdP1QTfmxJRdn0NlrvD+jmY69Egz+UQvxfgAEALJ4EcRDa/toAAAAASUVORK5CYII=" + +BEGIN_EXTERN_C() +PHPAPI zend_string *php_info_html_esc(const char *string); +PHPAPI void php_print_info_htmlhead(void); +PHPAPI void php_print_info(int flag); +PHPAPI void php_print_style(void); +PHPAPI void php_info_print_style(void); +PHPAPI void php_info_print_table_colspan_header(int num_cols, const char *header); +PHPAPI void php_info_print_table_header(int num_cols, ...); +PHPAPI void php_info_print_table_row(int num_cols, ...); +PHPAPI void php_info_print_table_row_ex(int num_cols, const char *, ...); +PHPAPI void php_info_print_table_start(void); +PHPAPI void php_info_print_table_end(void); +PHPAPI void php_info_print_box_start(int bg); +PHPAPI void php_info_print_box_end(void); +PHPAPI void php_info_print_hr(void); +PHPAPI void php_info_print_module(zend_module_entry *module); +PHPAPI zend_string *php_get_uname(char mode); + +void register_phpinfo_constants(INIT_FUNC_ARGS); +END_EXTERN_C() + +#endif /* INFO_H */ diff --git a/include/php/ext/standard/md5.h b/include/php/ext/standard/md5.h new file mode 100644 index 0000000..0003a93 --- /dev/null +++ b/include/php/ext/standard/md5.h @@ -0,0 +1,50 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Alexander Peslyak (Solar Designer) | + | Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +#ifndef MD5_H +#define MD5_H + +PHPAPI void make_digest(char *md5str, const unsigned char *digest); +PHPAPI void make_digest_ex(char *md5str, const unsigned char *digest, int len); + +#include "ext/standard/basic_functions.h" + +/* + * This is an OpenSSL-compatible implementation of the RSA Data Security, + * Inc. MD5 Message-Digest Algorithm (RFC 1321). + * + * Written by Solar Designer in 2001, and placed + * in the public domain. There's absolutely no warranty. + * + * See md5.c for more information. + */ + +/* MD5 context. */ +typedef struct { + uint32_t lo, hi; + uint32_t a, b, c, d; + unsigned char buffer[64]; + uint32_t block[16]; +} PHP_MD5_CTX; +#define PHP_MD5_SPEC "llllllb64l16." + +#define PHP_MD5Init(ctx) PHP_MD5InitArgs(ctx, NULL) +PHPAPI void PHP_MD5InitArgs(PHP_MD5_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args); +PHPAPI void PHP_MD5Update(PHP_MD5_CTX *ctx, const void *data, size_t size); +PHPAPI void PHP_MD5Final(unsigned char *result, PHP_MD5_CTX *ctx); + +#endif diff --git a/include/php/ext/standard/pack.h b/include/php/ext/standard/pack.h new file mode 100644 index 0000000..5e12d55 --- /dev/null +++ b/include/php/ext/standard/pack.h @@ -0,0 +1,22 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +#ifndef PACK_H +#define PACK_H + +PHP_MINIT_FUNCTION(pack); + +#endif /* PACK_H */ diff --git a/include/php/ext/standard/pageinfo.h b/include/php/ext/standard/pageinfo.h new file mode 100644 index 0000000..029ce8b --- /dev/null +++ b/include/php/ext/standard/pageinfo.h @@ -0,0 +1,25 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Jim Winstead | + +----------------------------------------------------------------------+ +*/ + +#ifndef PAGEINFO_H +#define PAGEINFO_H + +PHPAPI void php_statpage(void); +PHPAPI time_t php_getlastmod(void); +extern zend_long php_getuid(void); +extern zend_long php_getgid(void); + +#endif diff --git a/include/php/ext/standard/php_array.h b/include/php/ext/standard/php_array.h new file mode 100644 index 0000000..5d42a22 --- /dev/null +++ b/include/php/ext/standard/php_array.h @@ -0,0 +1,72 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + | Rasmus Lerdorf | + | Andrei Zmievski | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_ARRAY_H +#define PHP_ARRAY_H + +# include "ext/random/php_random.h" + +PHP_MINIT_FUNCTION(array); +PHP_MSHUTDOWN_FUNCTION(array); + +PHPAPI int php_array_merge(HashTable *dest, HashTable *src); +PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src); +PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src); +PHPAPI int php_multisort_compare(const void *a, const void *b); +PHPAPI zend_long php_count_recursive(HashTable *ht); + +PHPAPI bool php_array_data_shuffle(const php_random_algo *algo, php_random_status *status, zval *array); +PHPAPI bool php_array_pick_keys(const php_random_algo *algo, php_random_status *status, zval *input, zend_long num_req, zval *retval, bool silent); + +#define PHP_EXTR_OVERWRITE 0 +#define PHP_EXTR_SKIP 1 +#define PHP_EXTR_PREFIX_SAME 2 +#define PHP_EXTR_PREFIX_ALL 3 +#define PHP_EXTR_PREFIX_INVALID 4 +#define PHP_EXTR_PREFIX_IF_EXISTS 5 +#define PHP_EXTR_IF_EXISTS 6 + +#define PHP_EXTR_REFS 0x100 + +#define PHP_CASE_LOWER 0 +#define PHP_CASE_UPPER 1 + +#define PHP_SORT_REGULAR 0 +#define PHP_SORT_NUMERIC 1 +#define PHP_SORT_STRING 2 +#define PHP_SORT_DESC 3 +#define PHP_SORT_ASC 4 +#define PHP_SORT_LOCALE_STRING 5 +#define PHP_SORT_NATURAL 6 +#define PHP_SORT_FLAG_CASE 8 + +#define PHP_COUNT_NORMAL 0 +#define PHP_COUNT_RECURSIVE 1 + +#define ARRAY_FILTER_USE_BOTH 1 +#define ARRAY_FILTER_USE_KEY 2 + +ZEND_BEGIN_MODULE_GLOBALS(array) + bucket_compare_func_t *multisort_func; + bool compare_deprecation_thrown; +ZEND_END_MODULE_GLOBALS(array) + +#define ARRAYG(v) ZEND_MODULE_GLOBALS_ACCESSOR(array, v) + +#endif /* PHP_ARRAY_H */ diff --git a/include/php/ext/standard/php_assert.h b/include/php/ext/standard/php_assert.h new file mode 100644 index 0000000..103a770 --- /dev/null +++ b/include/php/ext/standard/php_assert.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Thies C. Arntzen | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_ASSERT_H +#define PHP_ASSERT_H + +PHP_MINIT_FUNCTION(assert); +PHP_MSHUTDOWN_FUNCTION(assert); +PHP_RINIT_FUNCTION(assert); +PHP_RSHUTDOWN_FUNCTION(assert); +PHP_MINFO_FUNCTION(assert); + +enum { + PHP_ASSERT_ACTIVE=1, + PHP_ASSERT_CALLBACK, + PHP_ASSERT_BAIL, + PHP_ASSERT_WARNING, + PHP_ASSERT_EXCEPTION +}; + +extern PHPAPI zend_class_entry *assertion_error_ce; + +#endif /* PHP_ASSERT_H */ diff --git a/include/php/ext/standard/php_browscap.h b/include/php/ext/standard/php_browscap.h new file mode 100644 index 0000000..4fc4f66 --- /dev/null +++ b/include/php/ext/standard/php_browscap.h @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_BROWSCAP_H +#define PHP_BROWSCAP_H + +PHP_MINIT_FUNCTION(browscap); +PHP_MSHUTDOWN_FUNCTION(browscap); + +#endif /* PHP_BROWSCAP_H */ diff --git a/include/php/ext/standard/php_crypt.h b/include/php/ext/standard/php_crypt.h new file mode 100644 index 0000000..b7111df --- /dev/null +++ b/include/php/ext/standard/php_crypt.h @@ -0,0 +1,30 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Stig Bakken | + | Zeev Suraski | + | Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_CRYPT_H +#define PHP_CRYPT_H + +PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_len, bool quiet); +PHP_MINIT_FUNCTION(crypt); +PHP_MSHUTDOWN_FUNCTION(crypt); +PHP_RINIT_FUNCTION(crypt); + +/* sha512 crypt has the maximal salt length of 123 characters */ +#define PHP_MAX_SALT_LEN 123 + +#endif diff --git a/include/php/ext/standard/php_crypt_r.h b/include/php/ext/standard/php_crypt_r.h new file mode 100644 index 0000000..817ce36 --- /dev/null +++ b/include/php/ext/standard/php_crypt_r.h @@ -0,0 +1,39 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Pierre Alain Joye | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_DIR_H +#define PHP_DIR_H + +/* directory functions */ +PHP_MINIT_FUNCTION(dir); +PHP_RINIT_FUNCTION(dir); + +#define PHP_SCANDIR_SORT_ASCENDING 0 +#define PHP_SCANDIR_SORT_DESCENDING 1 +#define PHP_SCANDIR_SORT_NONE 2 + +#endif /* PHP_DIR_H */ diff --git a/include/php/ext/standard/php_dns.h b/include/php/ext/standard/php_dns.h new file mode 100644 index 0000000..4e04799 --- /dev/null +++ b/include/php/ext/standard/php_dns.h @@ -0,0 +1,94 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: The typical suspects | + | Marcus Boerger | + | Pollita | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_DNS_H +#define PHP_DNS_H + +#if defined(HAVE_DNS_SEARCH) +#define php_dns_search(res, dname, class, type, answer, anslen) \ + ((int)dns_search(res, dname, class, type, (char *) answer, anslen, (struct sockaddr *)&from, &fromsize)) +#define php_dns_free_handle(res) \ + dns_free(res) +#define php_dns_errno(handle) h_errno + +#elif defined(HAVE_RES_NSEARCH) +#define php_dns_search(res, dname, class, type, answer, anslen) \ + res_nsearch(res, dname, class, type, answer, anslen); +#ifdef HAVE_RES_NDESTROY +#define php_dns_free_handle(res) \ + res_ndestroy(res); \ + php_dns_free_res(res) +#else +#define php_dns_free_handle(res) \ + res_nclose(res); \ + php_dns_free_res(res) +#endif +#define php_dns_errno(handle) handle->res_h_errno + +#elif defined(HAVE_RES_SEARCH) +#define php_dns_search(res, dname, class, type, answer, anslen) \ + res_search(dname, class, type, answer, anslen) +#define php_dns_free_handle(res) /* noop */ +#define php_dns_errno(handle) h_errno + +#endif + +#if defined(HAVE_DNS_SEARCH) || defined(HAVE_RES_NSEARCH) || defined(HAVE_RES_SEARCH) +#define HAVE_DNS_SEARCH_FUNC 1 +#endif + +#if defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_DN_EXPAND) && defined(HAVE_DN_SKIPNAME) +#define HAVE_FULL_DNS_FUNCS 1 +#endif + +#if defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS)) +#define PHP_DNS_A 0x00000001 +#define PHP_DNS_NS 0x00000002 +#define PHP_DNS_CNAME 0x00000010 +#define PHP_DNS_SOA 0x00000020 +#define PHP_DNS_PTR 0x00000800 +#define PHP_DNS_HINFO 0x00001000 +#if !defined(PHP_WIN32) +# define PHP_DNS_CAA 0x00002000 +#endif +#define PHP_DNS_MX 0x00004000 +#define PHP_DNS_TXT 0x00008000 +#define PHP_DNS_A6 0x01000000 +#define PHP_DNS_SRV 0x02000000 +#define PHP_DNS_NAPTR 0x04000000 +#define PHP_DNS_AAAA 0x08000000 +#define PHP_DNS_ANY 0x10000000 + +#if defined(PHP_WIN32) +# define PHP_DNS_NUM_TYPES 12 /* Number of DNS Types Supported by PHP currently */ +# define PHP_DNS_ALL (PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_AAAA) +#else +# define PHP_DNS_NUM_TYPES 13 /* Number of DNS Types Supported by PHP currently */ +# define PHP_DNS_ALL (PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_CAA|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_AAAA) +#endif +#endif + +#ifndef INT16SZ +#define INT16SZ 2 +#endif + +#ifndef INT32SZ +#define INT32SZ 4 +#endif + +#endif /* PHP_DNS_H */ diff --git a/include/php/ext/standard/php_ext_syslog.h b/include/php/ext/standard/php_ext_syslog.h new file mode 100644 index 0000000..fd7958f --- /dev/null +++ b/include/php/ext/standard/php_ext_syslog.h @@ -0,0 +1,29 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Stig Sæther Bakken | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_EXT_SYSLOG_H +#define PHP_EXT_SYSLOG_H + +#ifdef HAVE_SYSLOG_H + +#include "php_syslog.h" + +PHP_MINIT_FUNCTION(syslog); +PHP_RSHUTDOWN_FUNCTION(syslog); + +#endif + +#endif /* PHP_EXT_SYSLOG_H */ diff --git a/include/php/ext/standard/php_filestat.h b/include/php/ext/standard/php_filestat.h new file mode 100644 index 0000000..ef3c1cd --- /dev/null +++ b/include/php/ext/standard/php_filestat.h @@ -0,0 +1,67 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Jim Winstead | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_FILESTAT_H +#define PHP_FILESTAT_H + +PHP_RINIT_FUNCTION(filestat); +PHP_RSHUTDOWN_FUNCTION(filestat); + +#ifdef PHP_WIN32 +#define S_IRUSR S_IREAD +#define S_IWUSR S_IWRITE +#define S_IXUSR S_IEXEC +#define S_IRGRP S_IREAD +#define S_IWGRP S_IWRITE +#define S_IXGRP S_IEXEC +#define S_IROTH S_IREAD +#define S_IWOTH S_IWRITE +#define S_IXOTH S_IEXEC + +#undef getgid +#define getgroups(a, b) 0 +#define getgid() 1 +#define getuid() 1 +#endif + +/* Compatibility. */ +typedef size_t php_stat_len; + +PHPAPI void php_clear_stat_cache(bool clear_realpath_cache, const char *filename, size_t filename_len); +PHPAPI void php_stat(zend_string *filename, int type, zval *return_value); + +/* Switches for various filestat functions: */ +#define FS_PERMS 0 +#define FS_INODE 1 +#define FS_SIZE 2 +#define FS_OWNER 3 +#define FS_GROUP 4 +#define FS_ATIME 5 +#define FS_MTIME 6 +#define FS_CTIME 7 +#define FS_TYPE 8 +#define FS_IS_W 9 +#define FS_IS_R 10 +#define FS_IS_X 11 +#define FS_IS_FILE 12 +#define FS_IS_DIR 13 +#define FS_IS_LINK 14 +#define FS_EXISTS 15 +#define FS_LSTAT 16 +#define FS_STAT 17 +#define FS_LPERMS 18 + +#endif /* PHP_FILESTAT_H */ diff --git a/include/php/ext/standard/php_fopen_wrappers.h b/include/php/ext/standard/php_fopen_wrappers.h new file mode 100644 index 0000000..885e31f --- /dev/null +++ b/include/php/ext/standard/php_fopen_wrappers.h @@ -0,0 +1,29 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rasmus Lerdorf | + | Jim Winstead | + | Hartmut Holzgraefe | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_FOPEN_WRAPPERS_H +#define PHP_FOPEN_WRAPPERS_H + +php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC); +php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC); +extern PHPAPI const php_stream_wrapper php_stream_http_wrapper; +extern PHPAPI const php_stream_wrapper php_stream_ftp_wrapper; +extern PHPAPI const php_stream_wrapper php_stream_php_wrapper; +extern PHPAPI /*const*/ php_stream_wrapper php_plain_files_wrapper; + +#endif diff --git a/include/php/ext/standard/php_http.h b/include/php/ext/standard/php_http.h new file mode 100644 index 0000000..9350be5 --- /dev/null +++ b/include/php/ext/standard/php_http.h @@ -0,0 +1,29 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Sara Golemon | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_HTTP_H +#define PHP_HTTP_H + +#include "php.h" +#include "zend_types.h" /* for zend_string */ +#include "zend_smart_str.h" + +PHPAPI void php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, + const char *num_prefix, size_t num_prefix_len, + const zend_string *key_prefix, + zval *type, const zend_string *arg_sep, int enc_type); + +#endif diff --git a/include/php/ext/standard/php_image.h b/include/php/ext/standard/php_image.h new file mode 100644 index 0000000..a41273e --- /dev/null +++ b/include/php/ext/standard/php_image.h @@ -0,0 +1,58 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rasmus Lerdorf | + | Marcus Boerger | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IMAGE_H +#define PHP_IMAGE_H + +/* {{{ enum image_filetype + This enum is used to have ext/standard/image.c and ext/exif/exif.c use + the same constants for file types. +*/ +typedef enum +{ IMAGE_FILETYPE_UNKNOWN=0, + IMAGE_FILETYPE_GIF=1, + IMAGE_FILETYPE_JPEG, + IMAGE_FILETYPE_PNG, + IMAGE_FILETYPE_SWF, + IMAGE_FILETYPE_PSD, + IMAGE_FILETYPE_BMP, + IMAGE_FILETYPE_TIFF_II, /* intel */ + IMAGE_FILETYPE_TIFF_MM, /* motorola */ + IMAGE_FILETYPE_JPC, + IMAGE_FILETYPE_JP2, + IMAGE_FILETYPE_JPX, + IMAGE_FILETYPE_JB2, + IMAGE_FILETYPE_SWC, + IMAGE_FILETYPE_IFF, + IMAGE_FILETYPE_WBMP, + /* IMAGE_FILETYPE_JPEG2000 is a userland alias for IMAGE_FILETYPE_JPC */ + IMAGE_FILETYPE_XBM, + IMAGE_FILETYPE_ICO, + IMAGE_FILETYPE_WEBP, + IMAGE_FILETYPE_AVIF, +/* WHEN EXTENDING: PLEASE ALSO REGISTER IN basic_function.stub.php */ + IMAGE_FILETYPE_COUNT +} image_filetype; +/* }}} */ + +PHPAPI int php_getimagetype(php_stream *stream, const char *input, char *filetype); + +PHPAPI char * php_image_type_to_mime_type(int image_type); + +PHPAPI bool php_is_image_avif(php_stream *stream); + +#endif /* PHP_IMAGE_H */ diff --git a/include/php/ext/standard/php_incomplete_class.h b/include/php/ext/standard/php_incomplete_class.h new file mode 100644 index 0000000..07eabf6 --- /dev/null +++ b/include/php/ext/standard/php_incomplete_class.h @@ -0,0 +1,60 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_INCOMPLETE_CLASS_H +#define PHP_INCOMPLETE_CLASS_H + +#include "ext/standard/basic_functions.h" + +extern PHPAPI zend_class_entry *php_ce_incomplete_class; + +#define PHP_IC_ENTRY php_ce_incomplete_class + +#define PHP_SET_CLASS_ATTRIBUTES(struc) \ + /* OBJECTS_FIXME: Fix for new object model */ \ + if (Z_OBJCE_P(struc) == php_ce_incomplete_class) { \ + class_name = php_lookup_class_name(Z_OBJ_P(struc)); \ + if (!class_name) { \ + class_name = zend_string_init(INCOMPLETE_CLASS, sizeof(INCOMPLETE_CLASS) - 1, 0); \ + } \ + incomplete_class = 1; \ + } else { \ + class_name = zend_string_copy(Z_OBJCE_P(struc)->name); \ + } + +#define PHP_CLEANUP_CLASS_ATTRIBUTES() \ + zend_string_release_ex(class_name, 0) + +#define PHP_CLASS_ATTRIBUTES \ + zend_string *class_name; \ + bool incomplete_class ZEND_ATTRIBUTE_UNUSED = 0 + +#define INCOMPLETE_CLASS "__PHP_Incomplete_Class" +#define MAGIC_MEMBER "__PHP_Incomplete_Class_Name" + +#ifdef __cplusplus +extern "C" { +#endif + +PHPAPI void php_register_incomplete_class_handlers(void); +PHPAPI zend_string *php_lookup_class_name(zend_object *object); +PHPAPI void php_store_class_name(zval *object, zend_string *name); + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/include/php/ext/standard/php_lcg.h b/include/php/ext/standard/php_lcg.h new file mode 100644 index 0000000..b86bb00 --- /dev/null +++ b/include/php/ext/standard/php_lcg.h @@ -0,0 +1 @@ +#include "ext/random/php_random.h" diff --git a/include/php/ext/standard/php_mail.h b/include/php/ext/standard/php_mail.h new file mode 100644 index 0000000..9536d1f --- /dev/null +++ b/include/php/ext/standard/php_mail.h @@ -0,0 +1,53 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Rasmus Lerdorf | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_MAIL_H +#define PHP_MAIL_H + +PHP_MINFO_FUNCTION(mail); + +PHPAPI zend_string *php_mail_build_headers(HashTable *headers); +PHPAPI extern int php_mail(const char *to, const char *subject, const char *message, const char *headers, const char *extra_cmd); + +#define PHP_MAIL_BUILD_HEADER_CHECK(target, s, key, val) \ +do { \ + if (Z_TYPE_P(val) == IS_STRING) { \ + php_mail_build_headers_elem(&s, key, val); \ + } else if (Z_TYPE_P(val) == IS_ARRAY) { \ + if (zend_string_equals_literal_ci(key, target)) { \ + zend_type_error("Header \"%s\" must be of type string, array given", target); \ + break; \ + } \ + php_mail_build_headers_elems(&s, key, val); \ + } else { \ + zend_type_error("Header \"%s\" must be of type array|string, %s given", ZSTR_VAL(key), zend_zval_value_name(val)); \ + } \ +} while(0) + + +#define PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val) \ +do { \ + if (Z_TYPE_P(val) == IS_STRING) { \ + php_mail_build_headers_elem(&s, key, val); \ + } else if (Z_TYPE_P(val) == IS_ARRAY) { \ + php_mail_build_headers_elems(&s, key, val); \ + } else { \ + zend_type_error("Header \"%s\" must be of type array|string, %s given", ZSTR_VAL(key), zend_zval_value_name(val)); \ + } \ +} while(0) + + +#endif /* PHP_MAIL_H */ diff --git a/include/php/ext/standard/php_math.h b/include/php/ext/standard/php_math.h new file mode 100644 index 0000000..1cdba0f --- /dev/null +++ b/include/php/ext/standard/php_math.h @@ -0,0 +1,117 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Jim Winstead | + | Stig Sæther Bakken | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_MATH_H +#define PHP_MATH_H + +PHPAPI double _php_math_round(double value, int places, int mode); +PHPAPI zend_string *_php_math_number_format(double d, int dec, char dec_point, char thousand_sep); +PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, const char *dec_point, size_t dec_point_len, const char *thousand_sep, size_t thousand_sep_len); +PHPAPI zend_string *_php_math_number_format_long(zend_long num, zend_long dec, const char *dec_point, size_t dec_point_len, const char *thousand_sep, size_t thousand_sep_len); +PHPAPI zend_string * _php_math_longtobase(zend_long arg, int base); +PHPAPI zend_long _php_math_basetolong(zval *arg, int base); +PHPAPI void _php_math_basetozval(zend_string *str, int base, zval *ret); +PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base); + +#include + +#ifndef M_E +#define M_E 2.7182818284590452354 /* e */ +#endif + +#ifndef M_LOG2E +#define M_LOG2E 1.4426950408889634074 /* log_2 e */ +#endif + +#ifndef M_LOG10E +#define M_LOG10E 0.43429448190325182765 /* log_10 e */ +#endif + +#ifndef M_LN2 +#define M_LN2 0.69314718055994530942 /* log_e 2 */ +#endif + +#ifndef M_LN10 +#define M_LN10 2.30258509299404568402 /* log_e 10 */ +#endif + +#ifndef M_PI +#define M_PI 3.14159265358979323846 /* pi */ +#endif + +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 /* pi/2 */ +#endif + +#ifndef M_PI_4 +#define M_PI_4 0.78539816339744830962 /* pi/4 */ +#endif + +#ifndef M_1_PI +#define M_1_PI 0.31830988618379067154 /* 1/pi */ +#endif + +#ifndef M_2_PI +#define M_2_PI 0.63661977236758134308 /* 2/pi */ +#endif + +#ifndef M_SQRTPI +#define M_SQRTPI 1.77245385090551602729 /* sqrt(pi) */ +#endif + +#ifndef M_2_SQRTPI +#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ +#endif + +#ifndef M_LNPI +#define M_LNPI 1.14472988584940017414 /* ln(pi) */ +#endif + +#ifndef M_EULER +#define M_EULER 0.57721566490153286061 /* Euler constant */ +#endif + +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ +#endif + +#ifndef M_SQRT1_2 +#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ +#endif + +#ifndef M_SQRT3 +#define M_SQRT3 1.73205080756887729352 /* sqrt(3) */ +#endif + +/* Define rounding modes (all are round-to-nearest) */ +#ifndef PHP_ROUND_HALF_UP +#define PHP_ROUND_HALF_UP 0x01 /* Arithmetic rounding, up == away from zero */ +#endif + +#ifndef PHP_ROUND_HALF_DOWN +#define PHP_ROUND_HALF_DOWN 0x02 /* Down == towards zero */ +#endif + +#ifndef PHP_ROUND_HALF_EVEN +#define PHP_ROUND_HALF_EVEN 0x03 /* Banker's rounding */ +#endif + +#ifndef PHP_ROUND_HALF_ODD +#define PHP_ROUND_HALF_ODD 0x04 +#endif + +#endif /* PHP_MATH_H */ diff --git a/include/php/ext/standard/php_mt_rand.h b/include/php/ext/standard/php_mt_rand.h new file mode 100644 index 0000000..b86bb00 --- /dev/null +++ b/include/php/ext/standard/php_mt_rand.h @@ -0,0 +1 @@ +#include "ext/random/php_random.h" diff --git a/include/php/ext/standard/php_net.h b/include/php/ext/standard/php_net.h new file mode 100644 index 0000000..5873913 --- /dev/null +++ b/include/php/ext/standard/php_net.h @@ -0,0 +1,25 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Sara Golemon | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_NET_H +#define PHP_NET_H + +#include "php.h" +#include "php_network.h" + +PHPAPI zend_string* php_inet_ntop(const struct sockaddr *addr); + +#endif /* PHP_NET_H */ diff --git a/include/php/ext/standard/php_password.h b/include/php/ext/standard/php_password.h new file mode 100644 index 0000000..50f330d --- /dev/null +++ b/include/php/ext/standard/php_password.h @@ -0,0 +1,64 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Anthony Ferrara | + | Charles R. Portwood II | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_PASSWORD_H +#define PHP_PASSWORD_H + +PHP_MINIT_FUNCTION(password); +PHP_MSHUTDOWN_FUNCTION(password); + +#define PHP_PASSWORD_DEFAULT PHP_PASSWORD_BCRYPT +#define PHP_PASSWORD_BCRYPT_COST 10 + +#ifdef HAVE_ARGON2LIB +/** + * When updating these values, synchronize ext/sodium/sodium_pwhash.c values. + * Note that libargon expresses memlimit in KB, while libsoidum uses bytes. + */ +#define PHP_PASSWORD_ARGON2_MEMORY_COST (64 << 10) +#define PHP_PASSWORD_ARGON2_TIME_COST 4 +#define PHP_PASSWORD_ARGON2_THREADS 1 +#endif + +typedef struct _php_password_algo { + const char *name; + zend_string *(*hash)(const zend_string *password, zend_array *options); + bool (*verify)(const zend_string *password, const zend_string *hash); + bool (*needs_rehash)(const zend_string *password, zend_array *options); + int (*get_info)(zval *return_value, const zend_string *hash); + bool (*valid)(const zend_string *hash); +} php_password_algo; + +extern const php_password_algo php_password_algo_bcrypt; +#ifdef HAVE_ARGON2LIB +extern const php_password_algo php_password_algo_argon2i; +extern const php_password_algo php_password_algo_argon2id; +#endif + +PHPAPI int php_password_algo_register(const char*, const php_password_algo*); +PHPAPI void php_password_algo_unregister(const char*); +PHPAPI const php_password_algo* php_password_algo_default(void); +PHPAPI zend_string *php_password_algo_extract_ident(const zend_string*); +PHPAPI const php_password_algo* php_password_algo_find(const zend_string*); + +PHPAPI const php_password_algo* php_password_algo_identify_ex(const zend_string*, const php_password_algo*); +static inline const php_password_algo* php_password_algo_identify(const zend_string *hash) { + return php_password_algo_identify_ex(hash, php_password_algo_default()); +} + + +#endif diff --git a/include/php/ext/standard/php_rand.h b/include/php/ext/standard/php_rand.h new file mode 100644 index 0000000..b86bb00 --- /dev/null +++ b/include/php/ext/standard/php_rand.h @@ -0,0 +1 @@ +#include "ext/random/php_random.h" diff --git a/include/php/ext/standard/php_random.h b/include/php/ext/standard/php_random.h new file mode 100644 index 0000000..9af3eef --- /dev/null +++ b/include/php/ext/standard/php_random.h @@ -0,0 +1 @@ +#include "ext/random/php_random.h" \ No newline at end of file diff --git a/include/php/ext/standard/php_smart_string.h b/include/php/ext/standard/php_smart_string.h new file mode 100644 index 0000000..0013775 --- /dev/null +++ b/include/php/ext/standard/php_smart_string.h @@ -0,0 +1,19 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + | Xinchen Hui | + +----------------------------------------------------------------------+ + */ + +/* Header moved to Zend. This file is retained for BC. */ +#include "zend_smart_string.h" diff --git a/include/php/ext/standard/php_smart_string_public.h b/include/php/ext/standard/php_smart_string_public.h new file mode 100644 index 0000000..264723e --- /dev/null +++ b/include/php/ext/standard/php_smart_string_public.h @@ -0,0 +1,19 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + | Xinchen Hui | + +----------------------------------------------------------------------+ + */ + +/* Header moved to Zend. This file is retained for BC. */ +#include "zend_smart_string_public.h" diff --git a/include/php/ext/standard/php_standard.h b/include/php/ext/standard/php_standard.h new file mode 100644 index 0000000..5bf4143 --- /dev/null +++ b/include/php/ext/standard/php_standard.h @@ -0,0 +1,55 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: | + +----------------------------------------------------------------------+ +*/ + +#include "basic_functions.h" +#include "php_math.h" +#include "php_string.h" +#include "base64.h" +#include "php_dir.h" +#include "php_dns.h" +#include "php_mail.h" +#include "md5.h" +#include "sha1.h" +#include "html.h" +#include "exec.h" +#include "file.h" +#include "php_ext_syslog.h" +#include "php_filestat.h" +#include "php_browscap.h" +#include "pack.h" +#include "datetime.h" +#include "url.h" +#include "pageinfo.h" +#include "fsock.h" +#include "php_image.h" +#include "info.h" +#include "php_var.h" +#include "quot_print.h" +#include "dl.h" +#include "php_crypt.h" +#include "head.h" +#include "php_output.h" +#include "php_array.h" +#include "php_assert.h" +#include "php_versioning.h" +#include "php_password.h" + +#include "php_version.h" +#define PHP_STANDARD_VERSION PHP_VERSION + +#define phpext_standard_ptr basic_functions_module_ptr +PHP_MINIT_FUNCTION(standard_filters); +PHP_MSHUTDOWN_FUNCTION(standard_filters); diff --git a/include/php/ext/standard/php_string.h b/include/php/ext/standard/php_string.h new file mode 100644 index 0000000..e3143a5 --- /dev/null +++ b/include/php/ext/standard/php_string.h @@ -0,0 +1,90 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rasmus Lerdorf | + | Stig Sæther Bakken | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_STRING_H +#define PHP_STRING_H + +# include "ext/random/php_random.h" + +#ifdef ZTS +PHP_MINIT_FUNCTION(localeconv); +PHP_MSHUTDOWN_FUNCTION(localeconv); +#endif +#ifdef ZEND_INTRIN_SSE4_2_FUNC_PTR +PHP_MINIT_FUNCTION(string_intrin); +#endif + +#define strnatcmp(a, b) \ + strnatcmp_ex(a, strlen(a), b, strlen(b), 0) +#define strnatcasecmp(a, b) \ + strnatcmp_ex(a, strlen(a), b, strlen(b), 1) +PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, bool is_case_insensitive); +PHPAPI struct lconv *localeconv_r(struct lconv *out); +PHPAPI char *php_strtoupper(char *s, size_t len); +PHPAPI char *php_strtolower(char *s, size_t len); +PHPAPI zend_string *php_string_toupper(zend_string *s); +PHPAPI zend_string *php_string_tolower(zend_string *s); +PHPAPI char *php_strtr(char *str, size_t len, const char *str_from, const char *str_to, size_t trlen); +PHPAPI zend_string *php_addslashes(zend_string *str); +PHPAPI void php_stripslashes(zend_string *str); +PHPAPI zend_string *php_addcslashes_str(const char *str, size_t len, const char *what, size_t what_len); +PHPAPI zend_string *php_addcslashes(zend_string *str, const char *what, size_t what_len); +PHPAPI void php_stripcslashes(zend_string *str); +PHPAPI zend_string *php_basename(const char *s, size_t len, const char *suffix, size_t sufflen); +PHPAPI size_t php_dirname(char *str, size_t len); +PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len); +PHPAPI zend_string *php_str_to_str(const char *haystack, size_t length, const char *needle, + size_t needle_len, const char *str, size_t str_len); +PHPAPI zend_string *php_trim(zend_string *str, const char *what, size_t what_len, int mode); +PHPAPI size_t php_strip_tags(char *rbuf, size_t len, const char *allow, size_t allow_len); +PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, const char *allow, size_t allow_len, bool allow_tag_spaces); +PHPAPI void php_implode(const zend_string *delim, HashTable *arr, zval *return_value); +PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit); + +PHPAPI size_t php_strspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end); +PHPAPI size_t php_strcspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end); + +PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive); +PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2); +PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2); + +PHPAPI bool php_binary_string_shuffle(const php_random_algo *algo, php_random_status *status, char *str, zend_long len); + +#ifdef _REENTRANT +# ifdef PHP_WIN32 +# include +# endif +# define php_mblen(ptr, len) ((int) mbrlen(ptr, len, &BG(mblen_state))) +# define php_mb_reset() memset(&BG(mblen_state), 0, sizeof(BG(mblen_state))) +#else +# define php_mblen(ptr, len) mblen(ptr, len) +# define php_mb_reset() php_ignore_value(mblen(NULL, 0)) +#endif + +#define PHP_STR_PAD_LEFT 0 +#define PHP_STR_PAD_RIGHT 1 +#define PHP_STR_PAD_BOTH 2 +#define PHP_PATHINFO_DIRNAME 1 +#define PHP_PATHINFO_BASENAME 2 +#define PHP_PATHINFO_EXTENSION 4 +#define PHP_PATHINFO_FILENAME 8 +#define PHP_PATHINFO_ALL (PHP_PATHINFO_DIRNAME | PHP_PATHINFO_BASENAME | PHP_PATHINFO_EXTENSION | PHP_PATHINFO_FILENAME) + +#define PHP_STR_STRSPN 0 +#define PHP_STR_STRCSPN 1 + +#endif /* PHP_STRING_H */ diff --git a/include/php/ext/standard/php_uuencode.h b/include/php/ext/standard/php_uuencode.h new file mode 100644 index 0000000..da3d601 --- /dev/null +++ b/include/php/ext/standard/php_uuencode.h @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Ilia Alshanetsky | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_UUENCODE_H +#define PHP_UUENCODE_H + +PHPAPI zend_string *php_uudecode(const char *src, size_t src_len); +PHPAPI zend_string *php_uuencode(const char *src, size_t src_len); + +#endif /* PHP_UUENCODE_H */ diff --git a/include/php/ext/standard/php_var.h b/include/php/ext/standard/php_var.h new file mode 100644 index 0000000..b816da8 --- /dev/null +++ b/include/php/ext/standard/php_var.h @@ -0,0 +1,69 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Jani Lehtimäki | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_VAR_H +#define PHP_VAR_H + +#include "ext/standard/basic_functions.h" +#include "zend_smart_str_public.h" + +PHP_MINIT_FUNCTION(var); + +PHPAPI void php_var_dump(zval *struc, int level); +PHPAPI void php_var_export(zval *struc, int level); +PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf); + +PHPAPI void php_debug_zval_dump(zval *struc, int level); + +typedef struct php_serialize_data *php_serialize_data_t; +typedef struct php_unserialize_data *php_unserialize_data_t; + +PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data); +PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash); +PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash); +PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash); + +PHPAPI php_serialize_data_t php_var_serialize_init(void); +PHPAPI void php_var_serialize_destroy(php_serialize_data_t d); +PHPAPI php_unserialize_data_t php_var_unserialize_init(void); +PHPAPI void php_var_unserialize_destroy(php_unserialize_data_t d); +PHPAPI HashTable *php_var_unserialize_get_allowed_classes(php_unserialize_data_t d); +PHPAPI void php_var_unserialize_set_allowed_classes(php_unserialize_data_t d, HashTable *classes); +PHPAPI void php_var_unserialize_set_max_depth(php_unserialize_data_t d, zend_long max_depth); +PHPAPI zend_long php_var_unserialize_get_max_depth(php_unserialize_data_t d); +PHPAPI void php_var_unserialize_set_cur_depth(php_unserialize_data_t d, zend_long cur_depth); +PHPAPI zend_long php_var_unserialize_get_cur_depth(php_unserialize_data_t d); + +#define PHP_VAR_SERIALIZE_INIT(d) \ + (d) = php_var_serialize_init() + +#define PHP_VAR_SERIALIZE_DESTROY(d) \ + php_var_serialize_destroy(d) + +#define PHP_VAR_UNSERIALIZE_INIT(d) \ + (d) = php_var_unserialize_init() + +#define PHP_VAR_UNSERIALIZE_DESTROY(d) \ + php_var_unserialize_destroy(d) + +PHPAPI void php_unserialize_with_options(zval *return_value, const char *buf, const size_t buf_len, HashTable *options, const char* function_name); + +PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval *nzval); +PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval *val); +PHPAPI zval *var_tmp_var(php_unserialize_data_t *var_hashx); +PHPAPI void var_destroy(php_unserialize_data_t *var_hash); + +#endif /* PHP_VAR_H */ diff --git a/include/php/ext/standard/php_versioning.h b/include/php/ext/standard/php_versioning.h new file mode 100644 index 0000000..307ac12 --- /dev/null +++ b/include/php/ext/standard/php_versioning.h @@ -0,0 +1,25 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Stig Sæther Bakken | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_VERSIONING_H +#define PHP_VERSIONING_H + +#include "ext/standard/basic_functions.h" + +PHPAPI char *php_canonicalize_version(const char *); +PHPAPI int php_version_compare(const char *, const char *); + +#endif diff --git a/include/php/ext/standard/proc_open.h b/include/php/ext/standard/proc_open.h new file mode 100644 index 0000000..411e7e3 --- /dev/null +++ b/include/php/ext/standard/proc_open.h @@ -0,0 +1,52 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ + */ + +#ifdef PHP_WIN32 +typedef HANDLE php_file_descriptor_t; +typedef DWORD php_process_id_t; +# define PHP_INVALID_FD INVALID_HANDLE_VALUE +#else +typedef int php_file_descriptor_t; +typedef pid_t php_process_id_t; +# define PHP_INVALID_FD (-1) +#endif + +/* Environment block under Win32 is a NUL terminated sequence of NUL terminated + * name=value strings. + * Under Unix, it is an argv style array. */ +typedef struct _php_process_env { + char *envp; +#ifndef PHP_WIN32 + char **envarray; +#endif +} php_process_env; + +typedef struct _php_process_handle { + php_process_id_t child; +#ifdef PHP_WIN32 + HANDLE childHandle; +#endif + int npipes; + zend_resource **pipes; + zend_string *command; + php_process_env env; +#if HAVE_SYS_WAIT_H + /* We can only request the status once before it becomes unavailable. + * Cache the result so we can request it multiple times. */ + int cached_exit_wait_status_value; + bool has_cached_exit_wait_status; +#endif +} php_process_handle; diff --git a/include/php/ext/standard/quot_print.h b/include/php/ext/standard/quot_print.h new file mode 100644 index 0000000..11b829d --- /dev/null +++ b/include/php/ext/standard/quot_print.h @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Kirill Maximov (kir@rus.net) | + +----------------------------------------------------------------------+ +*/ + +#ifndef QUOT_PRINT_H +#define QUOT_PRINT_H + +PHPAPI zend_string *php_quot_print_decode(const unsigned char *str, size_t length, int replace_us_by_ws); +PHPAPI zend_string *php_quot_print_encode(const unsigned char *str, size_t length); + +#endif /* QUOT_PRINT_H */ diff --git a/include/php/ext/standard/scanf.h b/include/php/ext/standard/scanf.h new file mode 100644 index 0000000..d2ef2fc --- /dev/null +++ b/include/php/ext/standard/scanf.h @@ -0,0 +1,42 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Clayton Collie | + +----------------------------------------------------------------------+ +*/ + +#ifndef SCANF_H +#define SCANF_H + + +#define SCAN_MAX_ARGS 0xFF /* Maximum number of variable which can be */ + /* passed to (f|s)scanf. This is an artificial */ + /* upper limit to keep resources in check and */ + /* minimize the possibility of exploits */ + +#define SCAN_SUCCESS SUCCESS +#define SCAN_ERROR_EOF -1 /* indicates premature termination of scan */ + /* can be caused by bad parameters or format*/ + /* string. */ +#define SCAN_ERROR_INVALID_FORMAT (SCAN_ERROR_EOF - 1) +#define SCAN_ERROR_WRONG_PARAM_COUNT (SCAN_ERROR_INVALID_FORMAT - 1) + +/* + * The following are here solely for the benefit of the scanf type functions + * e.g. fscanf + */ +PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars); +PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval *args, + int varStart, zval *return_value); + + +#endif /* SCANF_H */ diff --git a/include/php/ext/standard/sha1.h b/include/php/ext/standard/sha1.h new file mode 100644 index 0000000..afec812 --- /dev/null +++ b/include/php/ext/standard/sha1.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Stefan Esser | + +----------------------------------------------------------------------+ +*/ + +#ifndef SHA1_H +#define SHA1_H + +#include "ext/standard/basic_functions.h" + +/* SHA1 context. */ +typedef struct { + uint32_t state[5]; /* state (ABCD) */ + uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} PHP_SHA1_CTX; +#define PHP_SHA1_SPEC "l5l2b64." + +#define PHP_SHA1Init(ctx) PHP_SHA1InitArgs(ctx, NULL) +PHPAPI void PHP_SHA1InitArgs(PHP_SHA1_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); +PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, size_t); +PHPAPI void PHP_SHA1Final(unsigned char[20], PHP_SHA1_CTX *); +PHPAPI void make_sha1_digest(char *sha1str, const unsigned char *digest); + +#endif diff --git a/include/php/ext/standard/streamsfuncs.h b/include/php/ext/standard/streamsfuncs.h new file mode 100644 index 0000000..4105847 --- /dev/null +++ b/include/php/ext/standard/streamsfuncs.h @@ -0,0 +1,20 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +/* Flags for stream_socket_client */ +#define PHP_STREAM_CLIENT_PERSISTENT 1 +#define PHP_STREAM_CLIENT_ASYNC_CONNECT 2 +#define PHP_STREAM_CLIENT_CONNECT 4 diff --git a/include/php/ext/standard/url.h b/include/php/ext/standard/url.h new file mode 100644 index 0000000..5ce9e75 --- /dev/null +++ b/include/php/ext/standard/url.h @@ -0,0 +1,53 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Jim Winstead | + +----------------------------------------------------------------------+ + */ + +#ifndef URL_H +#define URL_H + +typedef struct php_url { + zend_string *scheme; + zend_string *user; + zend_string *pass; + zend_string *host; + unsigned short port; + zend_string *path; + zend_string *query; + zend_string *fragment; +} php_url; + +PHPAPI void php_url_free(php_url *theurl); +PHPAPI php_url *php_url_parse(char const *str); +PHPAPI php_url *php_url_parse_ex(char const *str, size_t length); +PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port); +PHPAPI size_t php_url_decode(char *str, size_t len); /* return value: length of decoded string */ +PHPAPI size_t php_raw_url_decode(char *str, size_t len); /* return value: length of decoded string */ +PHPAPI zend_string *php_url_encode(char const *s, size_t len); +PHPAPI zend_string *php_raw_url_encode(char const *s, size_t len); +PHPAPI char *php_replace_controlchars_ex(char *str, size_t len); + +#define PHP_URL_SCHEME 0 +#define PHP_URL_HOST 1 +#define PHP_URL_PORT 2 +#define PHP_URL_USER 3 +#define PHP_URL_PASS 4 +#define PHP_URL_PATH 5 +#define PHP_URL_QUERY 6 +#define PHP_URL_FRAGMENT 7 + +#define PHP_QUERY_RFC1738 1 +#define PHP_QUERY_RFC3986 2 + +#endif /* URL_H */ diff --git a/include/php/ext/standard/url_scanner_ex.h b/include/php/ext/standard/url_scanner_ex.h new file mode 100644 index 0000000..2e469cc --- /dev/null +++ b/include/php/ext/standard/url_scanner_ex.h @@ -0,0 +1,63 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ +*/ + +#ifndef URL_SCANNER_EX_H +#define URL_SCANNER_EX_H + +PHP_MINIT_FUNCTION(url_scanner_ex); +PHP_MSHUTDOWN_FUNCTION(url_scanner_ex); + +PHP_RINIT_FUNCTION(url_scanner_ex); +PHP_RSHUTDOWN_FUNCTION(url_scanner_ex); + +PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen, int encode); +PHPAPI int php_url_scanner_add_session_var(const char *name, size_t name_len, const char *value, size_t value_len, int encode); +PHPAPI int php_url_scanner_reset_session_var(zend_string *name, int encode); +PHPAPI int php_url_scanner_reset_session_vars(void); +PHPAPI int php_url_scanner_add_var(const char *name, size_t name_len, const char *value, size_t value_len, int encode); +PHPAPI int php_url_scanner_reset_var(zend_string *name, int encode); +PHPAPI int php_url_scanner_reset_vars(void); + +#include "zend_smart_str_public.h" + +typedef struct { + /* Used by the mainloop of the scanner */ + smart_str tag; /* read only */ + smart_str arg; /* read only */ + smart_str val; /* read only */ + smart_str buf; + + /* The result buffer */ + smart_str result; + + /* The data which is appended to each relative URL/FORM */ + smart_str form_app, url_app; + + int active; + + char *lookup_data; + int state; + + int type; + smart_str attr_val; + int tag_type; + int attr_type; + + /* Everything above is zeroed in RINIT */ + HashTable *tags; +} url_adapt_state_ex_t; + +#endif diff --git a/include/php/ext/standard/user_filters_arginfo.h b/include/php/ext/standard/user_filters_arginfo.h new file mode 100644 index 0000000..ccfbc5e --- /dev/null +++ b/include/php/ext/standard/user_filters_arginfo.h @@ -0,0 +1,66 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 1c03251b4e0b22056da43bf86087d6996454d2a0 */ + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_php_user_filter_filter, 0, 4, IS_LONG, 0) + ZEND_ARG_INFO(0, in) + ZEND_ARG_INFO(0, out) + ZEND_ARG_INFO(1, consumed) + ZEND_ARG_TYPE_INFO(0, closing, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_php_user_filter_onCreate, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_php_user_filter_onClose, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + + +ZEND_METHOD(php_user_filter, filter); +ZEND_METHOD(php_user_filter, onCreate); +ZEND_METHOD(php_user_filter, onClose); + + +static const zend_function_entry class_php_user_filter_methods[] = { + ZEND_ME(php_user_filter, filter, arginfo_class_php_user_filter_filter, ZEND_ACC_PUBLIC) + ZEND_ME(php_user_filter, onCreate, arginfo_class_php_user_filter_onCreate, ZEND_ACC_PUBLIC) + ZEND_ME(php_user_filter, onClose, arginfo_class_php_user_filter_onClose, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + +static void register_user_filters_symbols(int module_number) +{ + REGISTER_LONG_CONSTANT("PSFS_PASS_ON", PSFS_PASS_ON, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PSFS_FEED_ME", PSFS_FEED_ME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PSFS_ERR_FATAL", PSFS_ERR_FATAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PSFS_FLAG_NORMAL", PSFS_FLAG_NORMAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_INC", PSFS_FLAG_FLUSH_INC, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_CLOSE", PSFS_FLAG_FLUSH_CLOSE, CONST_PERSISTENT); +} + +static zend_class_entry *register_class_php_user_filter(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "php_user_filter", class_php_user_filter_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + + zval property_filtername_default_value; + ZVAL_EMPTY_STRING(&property_filtername_default_value); + zend_string *property_filtername_name = zend_string_init("filtername", sizeof("filtername") - 1, 1); + zend_declare_typed_property(class_entry, property_filtername_name, &property_filtername_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_string_release(property_filtername_name); + + zval property_params_default_value; + ZVAL_EMPTY_STRING(&property_params_default_value); + zend_string *property_params_name = zend_string_init("params", sizeof("params") - 1, 1); + zend_declare_typed_property(class_entry, property_params_name, &property_params_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); + zend_string_release(property_params_name); + + zval property_stream_default_value; + ZVAL_NULL(&property_stream_default_value); + zend_string *property_stream_name = zend_string_init("stream", sizeof("stream") - 1, 1); + zend_declare_typed_property(class_entry, property_stream_name, &property_stream_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); + zend_string_release(property_stream_name); + + return class_entry; +} diff --git a/include/php/ext/standard/winver.h b/include/php/ext/standard/winver.h new file mode 100644 index 0000000..d985181 --- /dev/null +++ b/include/php/ext/standard/winver.h @@ -0,0 +1,133 @@ +#ifndef _PHP_WINVER_H +#define _PHP_WINVER_H + +#ifndef SM_TABLETPC +#define SM_TABLETPC 86 +#endif +#ifndef SM_MEDIACENTER +#define SM_MEDIACENTER 87 +#endif +#ifndef SM_STARTER +#define SM_STARTER 88 +#endif +#ifndef SM_SERVERR2 +#define SM_SERVERR2 89 +#endif +#ifndef VER_SUITE_WH_SERVER +#define VER_SUITE_WH_SERVER 0x8000 +#endif + +#ifndef PRODUCT_ULTIMATE +#define PRODUCT_UNDEFINED 0x00000000 +#define PRODUCT_ULTIMATE 0x00000001 +#define PRODUCT_HOME_BASIC 0x00000002 +#define PRODUCT_HOME_PREMIUM 0x00000003 +#define PRODUCT_ENTERPRISE 0x00000004 +#define PRODUCT_HOME_BASIC_N 0x00000005 +#define PRODUCT_BUSINESS 0x00000006 +#define PRODUCT_STANDARD_SERVER 0x00000007 +#define PRODUCT_DATACENTER_SERVER 0x00000008 +#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009 +#define PRODUCT_ENTERPRISE_SERVER 0x0000000A +#define PRODUCT_STARTER 0x0000000B +#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C +#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D +#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E +#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F +#define PRODUCT_BUSINESS_N 0x00000010 +#define PRODUCT_WEB_SERVER 0x00000011 +#define PRODUCT_CLUSTER_SERVER 0x00000012 +#define PRODUCT_HOME_SERVER 0x00000013 +#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014 +#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015 +#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016 +#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017 +#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018 +#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019 +#define PRODUCT_HOME_PREMIUM_N 0x0000001A +#define PRODUCT_ENTERPRISE_N 0x0000001B +#define PRODUCT_ULTIMATE_N 0x0000001C +#define PRODUCT_WEB_SERVER_CORE 0x0000001D +#define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E +#define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F +#define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020 +#define PRODUCT_SERVER_FOUNDATION 0x00000021 +#define PRODUCT_HOME_PREMIUM_SERVER 0x00000022 +#define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023 +#define PRODUCT_STANDARD_SERVER_V 0x00000024 +#define PRODUCT_DATACENTER_SERVER_V 0x00000025 +#define PRODUCT_ENTERPRISE_SERVER_V 0x00000026 +#define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027 +#define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028 +#define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029 +#define PRODUCT_HYPERV 0x0000002A +#define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B +#define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C +#define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D +#define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E +#define PRODUCT_STARTER_N 0x0000002F +#define PRODUCT_PROFESSIONAL 0x00000030 +#define PRODUCT_PROFESSIONAL_N 0x00000031 +#define PRODUCT_SB_SOLUTION_SERVER 0x00000032 +#define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033 +#define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034 +#define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035 +#define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036 +#define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037 +#define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038 +#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B +#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C +#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D +#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E +#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F +#define PRODUCT_CLUSTER_SERVER_V 0x00000040 +#define PRODUCT_ENTERPRISE_EVALUATION 0x00000048 +#define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C +#define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D +#define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F +#define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050 +#define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054 +#define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F +#define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060 +#define PRODUCT_CORE_N 0x00000062 +#define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063 +#define PRODUCT_CORE_SINGLELANGUAGE 0x00000064 +#define PRODUCT_CORE 0x00000065 +#define PRODUCT_PROFESSIONAL_WMC 0x00000067 +#endif + +#ifndef VER_NT_WORKSTATION +#define VER_NT_WORKSTATION 0x0000001 +#define VER_NT_DOMAIN_CONTROLLER 0x0000002 +#define VER_NT_SERVER 0x0000003 +#endif + +#ifndef VER_SUITE_SMALLBUSINESS +#define VER_SUITE_SMALLBUSINESS 0x00000001 +#define VER_SUITE_ENTERPRISE 0x00000002 +#define VER_SUITE_BACKOFFICE 0x00000004 +#define VER_SUITE_COMMUNICATIONS 0x00000008 +#define VER_SUITE_TERMINAL 0x00000010 +#define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020 +#define VER_SUITE_EMBEDDEDNT 0x00000040 +#define VER_SUITE_DATACENTER 0x00000080 +#define VER_SUITE_SINGLEUSERTS 0x00000100 +#define VER_SUITE_PERSONAL 0x00000200 +#define VER_SUITE_BLADE 0x00000400 +#define VER_SUITE_EMBEDDED_RESTRICTED 0x00000800 +#define VER_SUITE_SECURITY_APPLIANCE 0x00001000 +#endif + +#ifndef VER_SUITE_STORAGE_SERVER +# define VER_SUITE_STORAGE_SERVER 0x00002000 +#endif + +#ifndef VER_SUITE_COMPUTE_SERVER +# define VER_SUITE_COMPUTE_SERVER 0x00004000 +#endif + +#ifndef PROCESSOR_ARCHITECTURE_AMD64 +#define PROCESSOR_ARCHITECTURE_AMD64 9 +#endif + +#endif diff --git a/include/php/ext/xml/expat_compat.h b/include/php/ext/xml/expat_compat.h new file mode 100644 index 0000000..001c7e3 --- /dev/null +++ b/include/php/ext/xml/expat_compat.h @@ -0,0 +1,157 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Sterling Hughes | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_EXPAT_COMPAT_H +#define PHP_EXPAT_COMPAT_H + +#ifdef PHP_WIN32 +#include "config.w32.h" +#else +#include +#endif + +#ifdef PHP_WIN32 +# define PHP_XML_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_XML_API __attribute__ ((visibility("default"))) +#else +# define PHP_XML_API +#endif + +#if !defined(HAVE_LIBEXPAT) && defined(HAVE_LIBXML) +#define LIBXML_EXPAT_COMPAT 1 + +#include "php.h" +#include "php_compat.h" + +#include +#include +#include +#include + +/* For compatibility with the misspelled version. */ +#define _ns_seperator _ns_separator + +typedef xmlChar XML_Char; + +typedef void (*XML_StartElementHandler)(void *, const XML_Char *, const XML_Char **); +typedef void (*XML_EndElementHandler)(void *, const XML_Char *); +typedef void (*XML_CharacterDataHandler)(void *, const XML_Char *, int); +typedef void (*XML_ProcessingInstructionHandler)(void *, const XML_Char *, const XML_Char *); +typedef void (*XML_CommentHandler)(void *, const XML_Char *); +typedef void (*XML_DefaultHandler)(void *, const XML_Char *, int); +typedef void (*XML_UnparsedEntityDeclHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); +typedef void (*XML_NotationDeclHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); +typedef int (*XML_ExternalEntityRefHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); +typedef void (*XML_StartNamespaceDeclHandler)(void *, const XML_Char *, const XML_Char *); +typedef void (*XML_EndNamespaceDeclHandler)(void *, const XML_Char *); + +typedef struct _XML_Memory_Handling_Suite { + void *(*malloc_fcn)(size_t size); + void *(*realloc_fcn)(void *ptr, size_t size); + void (*free_fcn)(void *ptr); +} XML_Memory_Handling_Suite; + +typedef struct _XML_Parser { + int use_namespace; + + xmlChar *_ns_separator; + + void *user; + xmlParserCtxtPtr parser; + + XML_StartElementHandler h_start_element; + XML_EndElementHandler h_end_element; + XML_CharacterDataHandler h_cdata; + XML_ProcessingInstructionHandler h_pi; + XML_CommentHandler h_comment; + XML_DefaultHandler h_default; + XML_UnparsedEntityDeclHandler h_unparsed_entity_decl; + XML_NotationDeclHandler h_notation_decl; + XML_ExternalEntityRefHandler h_external_entity_ref; + XML_StartNamespaceDeclHandler h_start_ns; + XML_EndNamespaceDeclHandler h_end_ns; +} *XML_Parser; + +enum XML_Error { + XML_ERROR_NONE, + XML_ERROR_NO_MEMORY, + XML_ERROR_SYNTAX, + XML_ERROR_NO_ELEMENTS, + XML_ERROR_INVALID_TOKEN, + XML_ERROR_UNCLOSED_TOKEN, + XML_ERROR_PARTIAL_CHAR, + XML_ERROR_TAG_MISMATCH, + XML_ERROR_DUPLICATE_ATTRIBUTE, + XML_ERROR_JUNK_AFTER_DOC_ELEMENT, + XML_ERROR_PARAM_ENTITY_REF, + XML_ERROR_UNDEFINED_ENTITY, + XML_ERROR_RECURSIVE_ENTITY_REF, + XML_ERROR_ASYNC_ENTITY, + XML_ERROR_BAD_CHAR_REF, + XML_ERROR_BINARY_ENTITY_REF, + XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, + XML_ERROR_MISPLACED_XML_PI, + XML_ERROR_UNKNOWN_ENCODING, + XML_ERROR_INCORRECT_ENCODING, + XML_ERROR_UNCLOSED_CDATA_SECTION, + XML_ERROR_EXTERNAL_ENTITY_HANDLING, + XML_ERROR_NOT_STANDALONE, + XML_ERROR_UNEXPECTED_STATE, + XML_ERROR_ENTITY_DECLARED_IN_PE, + XML_ERROR_FEATURE_REQUIRES_XML_DTD, + XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING +}; + +enum XML_Content_Type { + XML_CTYPE_EMPTY = 1, + XML_CTYPE_ANY, + XML_CTYPE_MIXED, + XML_CTYPE_NAME, + XML_CTYPE_CHOICE, + XML_CTYPE_SEQ +}; + +PHP_XML_API XML_Parser XML_ParserCreate(const XML_Char *); +PHP_XML_API XML_Parser XML_ParserCreateNS(const XML_Char *, const XML_Char); +PHP_XML_API XML_Parser XML_ParserCreate_MM(const XML_Char *, const XML_Memory_Handling_Suite *, const XML_Char *); +PHP_XML_API void XML_SetUserData(XML_Parser, void *); +PHP_XML_API void *XML_GetUserData(XML_Parser); +PHP_XML_API void XML_SetElementHandler(XML_Parser, XML_StartElementHandler, XML_EndElementHandler); +PHP_XML_API void XML_SetCharacterDataHandler(XML_Parser, XML_CharacterDataHandler); +PHP_XML_API void XML_SetProcessingInstructionHandler(XML_Parser, XML_ProcessingInstructionHandler); +PHP_XML_API void XML_SetDefaultHandler(XML_Parser, XML_DefaultHandler); +PHP_XML_API void XML_SetUnparsedEntityDeclHandler(XML_Parser, XML_UnparsedEntityDeclHandler); +PHP_XML_API void XML_SetNotationDeclHandler(XML_Parser, XML_NotationDeclHandler); +PHP_XML_API void XML_SetExternalEntityRefHandler(XML_Parser, XML_ExternalEntityRefHandler); +PHP_XML_API void XML_SetStartNamespaceDeclHandler(XML_Parser, XML_StartNamespaceDeclHandler); +PHP_XML_API void XML_SetEndNamespaceDeclHandler(XML_Parser, XML_EndNamespaceDeclHandler); +PHP_XML_API int XML_Parse(XML_Parser, const XML_Char *, int data_len, int is_final); +PHP_XML_API int XML_GetErrorCode(XML_Parser); +PHP_XML_API const XML_Char *XML_ErrorString(int); +PHP_XML_API int XML_GetCurrentLineNumber(XML_Parser); +PHP_XML_API int XML_GetCurrentColumnNumber(XML_Parser); +PHP_XML_API int XML_GetCurrentByteIndex(XML_Parser); +PHP_XML_API int XML_GetCurrentByteCount(XML_Parser); +PHP_XML_API const XML_Char *XML_ExpatVersion(void); +PHP_XML_API void XML_ParserFree(XML_Parser); + +#elif defined(HAVE_LIBEXPAT) +#include "php.h" +#include +#endif /* HAVE_LIBEXPAT */ + +#endif /* PHP_EXPAT_COMPAT_H */ diff --git a/include/php/ext/xml/php_xml.h b/include/php/ext/xml/php_xml.h new file mode 100644 index 0000000..e01a026 --- /dev/null +++ b/include/php/ext/xml/php_xml.h @@ -0,0 +1,55 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Stig Sæther Bakken | + | Thies C. Arntzen | + | Sterling Hughes | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_XML_H +#define PHP_XML_H + +#ifdef HAVE_XML + +extern zend_module_entry xml_module_entry; +#define xml_module_ptr &xml_module_entry + +#include "php_version.h" +#define PHP_XML_VERSION PHP_VERSION + +#include "expat_compat.h" + +#ifdef XML_UNICODE +#error "UTF-16 Unicode support not implemented!" +#endif + +#else +#define xml_module_ptr NULL +#endif /* HAVE_XML */ + +#define phpext_xml_ptr xml_module_ptr + +enum php_xml_option { + PHP_XML_OPTION_CASE_FOLDING = 1, + PHP_XML_OPTION_TARGET_ENCODING, + PHP_XML_OPTION_SKIP_TAGSTART, + PHP_XML_OPTION_SKIP_WHITE +}; + +#ifdef LIBXML_EXPAT_COMPAT +#define PHP_XML_SAX_IMPL "libxml" +#else +#define PHP_XML_SAX_IMPL "expat" +#endif + +#endif /* PHP_XML_H */ diff --git a/include/php/ext/xml/xml_arginfo.h b/include/php/ext/xml/xml_arginfo.h new file mode 100644 index 0000000..48cd269 --- /dev/null +++ b/include/php/ext/xml/xml_arginfo.h @@ -0,0 +1,181 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: f87e295b35cd43db72a936ee5745297a45730090 */ + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_xml_parser_create, 0, 0, XMLParser, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_xml_parser_create_ns, 0, 0, XMLParser, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\":\"") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_set_object, 0, 2, IS_TRUE, 0) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) + ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_set_element_handler, 0, 3, IS_TRUE, 0) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) + ZEND_ARG_INFO(0, start_handler) + ZEND_ARG_INFO(0, end_handler) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_set_character_data_handler, 0, 2, IS_TRUE, 0) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) + ZEND_ARG_INFO(0, handler) +ZEND_END_ARG_INFO() + +#define arginfo_xml_set_processing_instruction_handler arginfo_xml_set_character_data_handler + +#define arginfo_xml_set_default_handler arginfo_xml_set_character_data_handler + +#define arginfo_xml_set_unparsed_entity_decl_handler arginfo_xml_set_character_data_handler + +#define arginfo_xml_set_notation_decl_handler arginfo_xml_set_character_data_handler + +#define arginfo_xml_set_external_entity_ref_handler arginfo_xml_set_character_data_handler + +#define arginfo_xml_set_start_namespace_decl_handler arginfo_xml_set_character_data_handler + +#define arginfo_xml_set_end_namespace_decl_handler arginfo_xml_set_character_data_handler + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_parse, 0, 2, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, is_final, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_xml_parse_into_struct, 0, 3, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) + ZEND_ARG_INFO(1, values) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, index, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_get_error_code, 0, 1, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_error_string, 0, 1, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, error_code, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_xml_get_current_line_number arginfo_xml_get_error_code + +#define arginfo_xml_get_current_column_number arginfo_xml_get_error_code + +#define arginfo_xml_get_current_byte_index arginfo_xml_get_error_code + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_parser_free, 0, 1, _IS_BOOL, 0) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_parser_set_option, 0, 3, _IS_BOOL, 0) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) + ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_xml_parser_get_option, 0, 2, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_BOOL) + ZEND_ARG_OBJ_INFO(0, parser, XMLParser, 0) + ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) +ZEND_END_ARG_INFO() + + +ZEND_FUNCTION(xml_parser_create); +ZEND_FUNCTION(xml_parser_create_ns); +ZEND_FUNCTION(xml_set_object); +ZEND_FUNCTION(xml_set_element_handler); +ZEND_FUNCTION(xml_set_character_data_handler); +ZEND_FUNCTION(xml_set_processing_instruction_handler); +ZEND_FUNCTION(xml_set_default_handler); +ZEND_FUNCTION(xml_set_unparsed_entity_decl_handler); +ZEND_FUNCTION(xml_set_notation_decl_handler); +ZEND_FUNCTION(xml_set_external_entity_ref_handler); +ZEND_FUNCTION(xml_set_start_namespace_decl_handler); +ZEND_FUNCTION(xml_set_end_namespace_decl_handler); +ZEND_FUNCTION(xml_parse); +ZEND_FUNCTION(xml_parse_into_struct); +ZEND_FUNCTION(xml_get_error_code); +ZEND_FUNCTION(xml_error_string); +ZEND_FUNCTION(xml_get_current_line_number); +ZEND_FUNCTION(xml_get_current_column_number); +ZEND_FUNCTION(xml_get_current_byte_index); +ZEND_FUNCTION(xml_parser_free); +ZEND_FUNCTION(xml_parser_set_option); +ZEND_FUNCTION(xml_parser_get_option); + + +static const zend_function_entry ext_functions[] = { + ZEND_FE(xml_parser_create, arginfo_xml_parser_create) + ZEND_FE(xml_parser_create_ns, arginfo_xml_parser_create_ns) + ZEND_FE(xml_set_object, arginfo_xml_set_object) + ZEND_FE(xml_set_element_handler, arginfo_xml_set_element_handler) + ZEND_FE(xml_set_character_data_handler, arginfo_xml_set_character_data_handler) + ZEND_FE(xml_set_processing_instruction_handler, arginfo_xml_set_processing_instruction_handler) + ZEND_FE(xml_set_default_handler, arginfo_xml_set_default_handler) + ZEND_FE(xml_set_unparsed_entity_decl_handler, arginfo_xml_set_unparsed_entity_decl_handler) + ZEND_FE(xml_set_notation_decl_handler, arginfo_xml_set_notation_decl_handler) + ZEND_FE(xml_set_external_entity_ref_handler, arginfo_xml_set_external_entity_ref_handler) + ZEND_FE(xml_set_start_namespace_decl_handler, arginfo_xml_set_start_namespace_decl_handler) + ZEND_FE(xml_set_end_namespace_decl_handler, arginfo_xml_set_end_namespace_decl_handler) + ZEND_FE(xml_parse, arginfo_xml_parse) + ZEND_FE(xml_parse_into_struct, arginfo_xml_parse_into_struct) + ZEND_FE(xml_get_error_code, arginfo_xml_get_error_code) + ZEND_FE(xml_error_string, arginfo_xml_error_string) + ZEND_FE(xml_get_current_line_number, arginfo_xml_get_current_line_number) + ZEND_FE(xml_get_current_column_number, arginfo_xml_get_current_column_number) + ZEND_FE(xml_get_current_byte_index, arginfo_xml_get_current_byte_index) + ZEND_FE(xml_parser_free, arginfo_xml_parser_free) + ZEND_FE(xml_parser_set_option, arginfo_xml_parser_set_option) + ZEND_FE(xml_parser_get_option, arginfo_xml_parser_get_option) + ZEND_FE_END +}; + + +static const zend_function_entry class_XMLParser_methods[] = { + ZEND_FE_END +}; + +static void register_xml_symbols(int module_number) +{ + REGISTER_LONG_CONSTANT("XML_ERROR_NONE", XML_ERROR_NONE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_NO_MEMORY", XML_ERROR_NO_MEMORY, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_SYNTAX", XML_ERROR_SYNTAX, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_NO_ELEMENTS", XML_ERROR_NO_ELEMENTS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_INVALID_TOKEN", XML_ERROR_INVALID_TOKEN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_UNCLOSED_TOKEN", XML_ERROR_UNCLOSED_TOKEN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_PARTIAL_CHAR", XML_ERROR_PARTIAL_CHAR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_TAG_MISMATCH", XML_ERROR_TAG_MISMATCH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_DUPLICATE_ATTRIBUTE", XML_ERROR_DUPLICATE_ATTRIBUTE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_JUNK_AFTER_DOC_ELEMENT", XML_ERROR_JUNK_AFTER_DOC_ELEMENT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_PARAM_ENTITY_REF", XML_ERROR_PARAM_ENTITY_REF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_UNDEFINED_ENTITY", XML_ERROR_UNDEFINED_ENTITY, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_RECURSIVE_ENTITY_REF", XML_ERROR_RECURSIVE_ENTITY_REF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_ASYNC_ENTITY", XML_ERROR_ASYNC_ENTITY, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_BAD_CHAR_REF", XML_ERROR_BAD_CHAR_REF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_BINARY_ENTITY_REF", XML_ERROR_BINARY_ENTITY_REF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF", XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_MISPLACED_XML_PI", XML_ERROR_MISPLACED_XML_PI, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_UNKNOWN_ENCODING", XML_ERROR_UNKNOWN_ENCODING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_INCORRECT_ENCODING", XML_ERROR_INCORRECT_ENCODING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_UNCLOSED_CDATA_SECTION", XML_ERROR_UNCLOSED_CDATA_SECTION, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_ERROR_EXTERNAL_ENTITY_HANDLING", XML_ERROR_EXTERNAL_ENTITY_HANDLING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_OPTION_CASE_FOLDING", PHP_XML_OPTION_CASE_FOLDING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_OPTION_TARGET_ENCODING", PHP_XML_OPTION_TARGET_ENCODING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_TAGSTART", PHP_XML_OPTION_SKIP_TAGSTART, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHITE", PHP_XML_OPTION_SKIP_WHITE, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XML_SAX_IMPL", PHP_XML_SAX_IMPL, CONST_PERSISTENT); +} + +static zend_class_entry *register_class_XMLParser(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "XMLParser", class_XMLParser_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; + + return class_entry; +} diff --git a/include/php/main/SAPI.h b/include/php/main/SAPI.h new file mode 100644 index 0000000..33c0e28 --- /dev/null +++ b/include/php/main/SAPI.h @@ -0,0 +1,320 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef SAPI_H +#define SAPI_H + +#include "php.h" +#include "zend.h" +#include "zend_API.h" +#include "zend_llist.h" +#include "zend_operators.h" +#include + +#define SAPI_OPTION_NO_CHDIR 1 +#define SAPI_POST_BLOCK_SIZE 0x4000 + +#ifdef PHP_WIN32 +# ifdef SAPI_EXPORTS +# define SAPI_API __declspec(dllexport) +# else +# define SAPI_API __declspec(dllimport) +# endif +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define SAPI_API __attribute__ ((visibility("default"))) +#else +# define SAPI_API +#endif + +#undef shutdown + +typedef struct { + char *header; + size_t header_len; +} sapi_header_struct; + + +typedef struct { + zend_llist headers; + int http_response_code; + unsigned char send_default_content_type; + char *mimetype; + char *http_status_line; +} sapi_headers_struct; + + +typedef struct _sapi_post_entry sapi_post_entry; +typedef struct _sapi_module_struct sapi_module_struct; + +BEGIN_EXTERN_C() +extern SAPI_API sapi_module_struct sapi_module; /* true global */ +END_EXTERN_C() + +/* Some values in this structure needs to be filled in before + * calling sapi_activate(). We WILL change the `char *' entries, + * so make sure that you allocate a separate buffer for them + * and that you free them after sapi_deactivate(). + */ + +typedef struct { + const char *request_method; + char *query_string; + char *cookie_data; + zend_long content_length; + + char *path_translated; + char *request_uri; + + /* Do not use request_body directly, but the php://input stream wrapper instead */ + struct _php_stream *request_body; + + const char *content_type; + + bool headers_only; + bool no_headers; + bool headers_read; + + sapi_post_entry *post_entry; + + char *content_type_dup; + + /* for HTTP authentication */ + char *auth_user; + char *auth_password; + char *auth_digest; + + /* this is necessary for the CGI SAPI module */ + char *argv0; + + char *current_user; + int current_user_length; + + /* this is necessary for CLI module */ + int argc; + char **argv; + int proto_num; +} sapi_request_info; + + +typedef struct _sapi_globals_struct { + void *server_context; + sapi_request_info request_info; + sapi_headers_struct sapi_headers; + int64_t read_post_bytes; + unsigned char post_read; + unsigned char headers_sent; + zend_stat_t global_stat; + char *default_mimetype; + char *default_charset; + HashTable *rfc1867_uploaded_files; + zend_long post_max_size; + int options; + bool sapi_started; + double global_request_time; + HashTable known_post_content_types; + zval callback_func; + zend_fcall_info_cache fci_cache; +} sapi_globals_struct; + + +BEGIN_EXTERN_C() +#ifdef ZTS +# define SG(v) ZEND_TSRMG_FAST(sapi_globals_offset, sapi_globals_struct *, v) +SAPI_API extern int sapi_globals_id; +SAPI_API extern size_t sapi_globals_offset; +#else +# define SG(v) (sapi_globals.v) +extern SAPI_API sapi_globals_struct sapi_globals; +#endif + +SAPI_API void sapi_startup(sapi_module_struct *sf); +SAPI_API void sapi_shutdown(void); +SAPI_API void sapi_activate(void); +SAPI_API void sapi_deactivate_module(void); +SAPI_API void sapi_deactivate_destroy(void); +SAPI_API void sapi_deactivate(void); +SAPI_API void sapi_initialize_empty_request(void); +SAPI_API void sapi_add_request_header(const char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg); +END_EXTERN_C() + +/* + * This is the preferred and maintained API for + * operating on HTTP headers. + */ + +/* + * Always specify a sapi_header_line this way: + * + * sapi_header_line ctr = {0}; + */ + +typedef struct { + const char *line; /* If you allocated this, you need to free it yourself */ + size_t line_len; + zend_long response_code; /* long due to zend_parse_parameters compatibility */ +} sapi_header_line; + +typedef enum { /* Parameter: */ + SAPI_HEADER_REPLACE, /* sapi_header_line* */ + SAPI_HEADER_ADD, /* sapi_header_line* */ + SAPI_HEADER_DELETE, /* sapi_header_line* */ + SAPI_HEADER_DELETE_ALL, /* void */ + SAPI_HEADER_SET_STATUS /* int */ +} sapi_header_op_enum; + +BEGIN_EXTERN_C() +SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg); + +/* Deprecated functions. Use sapi_header_op instead. */ +SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, bool duplicate, bool replace); +#define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1) + + +SAPI_API int sapi_send_headers(void); +SAPI_API void sapi_free_header(sapi_header_struct *sapi_header); +SAPI_API void sapi_handle_post(void *arg); +SAPI_API size_t sapi_read_post_block(char *buffer, size_t buflen); +SAPI_API int sapi_register_post_entries(const sapi_post_entry *post_entry); +SAPI_API int sapi_register_post_entry(const sapi_post_entry *post_entry); +SAPI_API void sapi_unregister_post_entry(const sapi_post_entry *post_entry); +SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(void)); +SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray)); +SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len), unsigned int (*input_filter_init)(void)); + +SAPI_API int sapi_flush(void); +SAPI_API zend_stat_t *sapi_get_stat(void); +SAPI_API char *sapi_getenv(const char *name, size_t name_len); + +SAPI_API char *sapi_get_default_content_type(void); +SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header); +SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len); +SAPI_API void sapi_activate_headers_only(void); + +SAPI_API int sapi_get_fd(int *fd); +SAPI_API int sapi_force_http_10(void); + +SAPI_API int sapi_get_target_uid(uid_t *); +SAPI_API int sapi_get_target_gid(gid_t *); +SAPI_API double sapi_get_request_time(void); +SAPI_API void sapi_terminate_process(void); +END_EXTERN_C() + +struct _sapi_module_struct { + char *name; + char *pretty_name; + + int (*startup)(struct _sapi_module_struct *sapi_module); + int (*shutdown)(struct _sapi_module_struct *sapi_module); + + int (*activate)(void); + int (*deactivate)(void); + + size_t (*ub_write)(const char *str, size_t str_length); + void (*flush)(void *server_context); + zend_stat_t *(*get_stat)(void); + char *(*getenv)(const char *name, size_t name_len); + + void (*sapi_error)(int type, const char *error_msg, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); + + int (*header_handler)(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers); + int (*send_headers)(sapi_headers_struct *sapi_headers); + void (*send_header)(sapi_header_struct *sapi_header, void *server_context); + + size_t (*read_post)(char *buffer, size_t count_bytes); + char *(*read_cookies)(void); + + void (*register_server_variables)(zval *track_vars_array); + void (*log_message)(const char *message, int syslog_type_int); + zend_result (*get_request_time)(double *request_time); + void (*terminate_process)(void); + + char *php_ini_path_override; + + void (*default_post_reader)(void); + void (*treat_data)(int arg, char *str, zval *destArray); + char *executable_location; + + int php_ini_ignore; + int php_ini_ignore_cwd; /* don't look for php.ini in the current directory */ + + int (*get_fd)(int *fd); + + int (*force_http_10)(void); + + int (*get_target_uid)(uid_t *); + int (*get_target_gid)(gid_t *); + + unsigned int (*input_filter)(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len); + + void (*ini_defaults)(HashTable *configuration_hash); + int phpinfo_as_text; + + const char *ini_entries; + const zend_function_entry *additional_functions; + unsigned int (*input_filter_init)(void); +}; + +struct _sapi_post_entry { + char *content_type; + uint32_t content_type_len; + void (*post_reader)(void); + void (*post_handler)(char *content_type_dup, void *arg); +}; + +/* header_handler() constants */ +#define SAPI_HEADER_ADD (1<<0) + + +#define SAPI_HEADER_SENT_SUCCESSFULLY 1 +#define SAPI_HEADER_DO_SEND 2 +#define SAPI_HEADER_SEND_FAILED 3 + +#define SAPI_DEFAULT_MIMETYPE "text/html" +#define SAPI_DEFAULT_CHARSET PHP_DEFAULT_CHARSET +#define SAPI_PHP_VERSION_HEADER "X-Powered-By: PHP/" PHP_VERSION + +#define SAPI_POST_READER_FUNC(post_reader) void post_reader(void) +#define SAPI_POST_HANDLER_FUNC(post_handler) void post_handler(char *content_type_dup, void *arg) + +#define SAPI_TREAT_DATA_FUNC(treat_data) void treat_data(int arg, char *str, zval* destArray) +#define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len) + +BEGIN_EXTERN_C() +SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data); +SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader); +SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data); +SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter); +END_EXTERN_C() + +#define STANDARD_SAPI_MODULE_PROPERTIES \ + NULL, /* php_ini_path_override */ \ + NULL, /* default_post_reader */ \ + NULL, /* treat_data */ \ + NULL, /* executable_location */ \ + 0, /* php_ini_ignore */ \ + 0, /* php_ini_ignore_cwd */ \ + NULL, /* get_fd */ \ + NULL, /* force_http_10 */ \ + NULL, /* get_target_uid */ \ + NULL, /* get_target_gid */ \ + NULL, /* input_filter */ \ + NULL, /* ini_defaults */ \ + 0, /* phpinfo_as_text; */ \ + NULL, /* ini_entries; */ \ + NULL, /* additional_functions */ \ + NULL /* input_filter_init */ + +#endif /* SAPI_H */ diff --git a/include/php/main/build-defs.h b/include/php/main/build-defs.h new file mode 100644 index 0000000..2cf9139 --- /dev/null +++ b/include/php/main/build-defs.h @@ -0,0 +1,39 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Stig Sæther Bakken | + +----------------------------------------------------------------------+ +*/ + +#define CONFIGURE_COMMAND " './configure' '--prefix=/home/wreng/php-8.3.3-linux/'" +#define PHP_ODBC_CFLAGS "" +#define PHP_ODBC_LFLAGS "" +#define PHP_ODBC_LIBS "" +#define PHP_ODBC_TYPE "" +#define PHP_OCI8_DIR "" +#define PHP_OCI8_ORACLE_VERSION "" +#define PHP_PROG_SENDMAIL "/usr/sbin/sendmail" +#define PEAR_INSTALLDIR "" +#define PHP_INCLUDE_PATH ".:" +#define PHP_EXTENSION_DIR "/home/wreng/php-8.3.3-linux/lib/php/extensions/no-debug-non-zts-20230831" +#define PHP_PREFIX "/home/wreng/php-8.3.3-linux" +#define PHP_BINDIR "/home/wreng/php-8.3.3-linux/bin" +#define PHP_SBINDIR "/home/wreng/php-8.3.3-linux/sbin" +#define PHP_MANDIR "/home/wreng/php-8.3.3-linux/php/man" +#define PHP_LIBDIR "/home/wreng/php-8.3.3-linux/lib/php" +#define PHP_DATADIR "/home/wreng/php-8.3.3-linux/share/php" +#define PHP_SYSCONFDIR "/home/wreng/php-8.3.3-linux/etc" +#define PHP_LOCALSTATEDIR "/home/wreng/php-8.3.3-linux/var" +#define PHP_CONFIG_FILE_PATH "/home/wreng/php-8.3.3-linux/lib" +#define PHP_CONFIG_FILE_SCAN_DIR "" +#define PHP_SHLIB_SUFFIX "so" +#define PHP_SHLIB_EXT_PREFIX "" diff --git a/include/php/main/fastcgi.h b/include/php/main/fastcgi.h new file mode 100644 index 0000000..8a1c051 --- /dev/null +++ b/include/php/main/fastcgi.h @@ -0,0 +1,126 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +/* FastCGI protocol */ + +#define FCGI_VERSION_1 1 + +#define FCGI_MAX_LENGTH 0xffff + +#define FCGI_KEEP_CONN 1 + +/* this is near the perfect hash function for most useful FastCGI variables + * which combines efficiency and minimal hash collisions + */ + +#define FCGI_HASH_FUNC(var, var_len) \ + (UNEXPECTED(var_len < 3) ? (unsigned int)var_len : \ + (((unsigned int)var[3]) << 2) + \ + (((unsigned int)var[var_len-2]) << 4) + \ + (((unsigned int)var[var_len-1]) << 2) + \ + var_len) + +#define FCGI_GETENV(request, name) \ + fcgi_quick_getenv(request, name, sizeof(name)-1, FCGI_HASH_FUNC(name, sizeof(name)-1)) + +#define FCGI_PUTENV(request, name, value) \ + fcgi_quick_putenv(request, name, sizeof(name)-1, FCGI_HASH_FUNC(name, sizeof(name)-1), value) + +typedef enum _fcgi_role { + FCGI_RESPONDER = 1, + FCGI_AUTHORIZER = 2, + FCGI_FILTER = 3 +} fcgi_role; + +enum { + FCGI_DEBUG = 1, + FCGI_NOTICE = 2, + FCGI_WARNING = 3, + FCGI_ERROR = 4, + FCGI_ALERT = 5, +}; + +typedef enum _fcgi_request_type { + FCGI_BEGIN_REQUEST = 1, /* [in] */ + FCGI_ABORT_REQUEST = 2, /* [in] (not supported) */ + FCGI_END_REQUEST = 3, /* [out] */ + FCGI_PARAMS = 4, /* [in] environment variables */ + FCGI_STDIN = 5, /* [in] post data */ + FCGI_STDOUT = 6, /* [out] response */ + FCGI_STDERR = 7, /* [out] errors */ + FCGI_DATA = 8, /* [in] filter data (not supported) */ + FCGI_GET_VALUES = 9, /* [in] */ + FCGI_GET_VALUES_RESULT = 10 /* [out] */ +} fcgi_request_type; + +typedef enum _fcgi_protocol_status { + FCGI_REQUEST_COMPLETE = 0, + FCGI_CANT_MPX_CONN = 1, + FCGI_OVERLOADED = 2, + FCGI_UNKNOWN_ROLE = 3 +} dcgi_protocol_status; + +/* FastCGI client API */ + +typedef void (*fcgi_apply_func)(const char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg); + +#define FCGI_HASH_TABLE_SIZE 128 +#define FCGI_HASH_TABLE_MASK (FCGI_HASH_TABLE_SIZE - 1) +#define FCGI_HASH_SEG_SIZE 4096 + +typedef struct _fcgi_request fcgi_request; + +int fcgi_init(void); +void fcgi_shutdown(void); +int fcgi_is_fastcgi(void); +int fcgi_is_closed(fcgi_request *req); +void fcgi_close(fcgi_request *req, int force, int destroy); +int fcgi_in_shutdown(void); +void fcgi_terminate(void); +int fcgi_listen(const char *path, int backlog); +fcgi_request* fcgi_init_request(int listen_socket, void(*on_accept)(void), void(*on_read)(void), void(*on_close)(void)); +void fcgi_destroy_request(fcgi_request *req); +void fcgi_set_allowed_clients(char *ip); +int fcgi_accept_request(fcgi_request *req); +int fcgi_finish_request(fcgi_request *req, int force_close); +const char *fcgi_get_last_client_ip(void); +void fcgi_set_in_shutdown(int new_value); +void fcgi_request_set_keep(fcgi_request *req, int new_value); + +#ifndef HAVE_ATTRIBUTE_WEAK +typedef void (*fcgi_logger)(int type, const char *fmt, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); +void fcgi_set_logger(fcgi_logger lg); +#endif + +int fcgi_has_env(fcgi_request *req); +char* fcgi_getenv(fcgi_request *req, const char* var, int var_len); +char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val); +char* fcgi_quick_getenv(fcgi_request *req, const char* var, int var_len, unsigned int hash_value); +char* fcgi_quick_putenv(fcgi_request *req, char* var, int var_len, unsigned int hash_value, char* val); +void fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array); + +int fcgi_read(fcgi_request *req, char *str, int len); + +int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int len); +int fcgi_flush(fcgi_request *req, int end); +int fcgi_end(fcgi_request *req); + +#ifdef PHP_WIN32 +void fcgi_impersonate(void); +#endif + +void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, size_t value_len); +void fcgi_free_mgmt_var_cb(zval *zv); diff --git a/include/php/main/fopen_wrappers.h b/include/php/main/fopen_wrappers.h new file mode 100644 index 0000000..f4070b1 --- /dev/null +++ b/include/php/main/fopen_wrappers.h @@ -0,0 +1,47 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Jim Winstead | + +----------------------------------------------------------------------+ + */ + +#ifndef FOPEN_WRAPPERS_H +#define FOPEN_WRAPPERS_H + +BEGIN_EXTERN_C() +#include "php_globals.h" +#include "php_ini.h" + +PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle); +PHPAPI char *expand_filepath(const char *filepath, char *real_path); +PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len); +PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int use_realpath); + +PHPAPI int php_check_open_basedir(const char *path); +PHPAPI int php_check_open_basedir_ex(const char *path, int warn); +PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path); + +/* OPENBASEDIR_CHECKPATH(filename) to ease merge between 6.x and 5.x */ +#define OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename) + +PHPAPI int php_check_safe_mode_include_dir(const char *path); + +PHPAPI zend_string *php_resolve_path(const char *filename, size_t filename_len, const char *path); + +PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, zend_string **opened_path); + +PHPAPI char *php_strip_url_passwd(char *path); + +PHPAPI ZEND_INI_MH(OnUpdateBaseDir); +END_EXTERN_C() + +#endif diff --git a/include/php/main/http_status_codes.h b/include/php/main/http_status_codes.h new file mode 100644 index 0000000..f299211 --- /dev/null +++ b/include/php/main/http_status_codes.h @@ -0,0 +1,80 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Andrea Faulds | + +----------------------------------------------------------------------+ +*/ + +#ifndef HTTP_STATUS_CODES_H +#define HTTP_STATUS_CODES_H + +typedef struct _http_response_status_code_pair { + const int code; + const char *str; +} http_response_status_code_pair; + +static const http_response_status_code_pair http_status_map[] = { + { 100, "Continue" }, + { 101, "Switching Protocols" }, + { 200, "OK" }, + { 201, "Created" }, + { 202, "Accepted" }, + { 203, "Non-Authoritative Information" }, + { 204, "No Content" }, + { 205, "Reset Content" }, + { 206, "Partial Content" }, + { 300, "Multiple Choices" }, + { 301, "Moved Permanently" }, + { 302, "Found" }, + { 303, "See Other" }, + { 304, "Not Modified" }, + { 305, "Use Proxy" }, + { 307, "Temporary Redirect" }, + { 308, "Permanent Redirect" }, + { 400, "Bad Request" }, + { 401, "Unauthorized" }, + { 402, "Payment Required" }, + { 403, "Forbidden" }, + { 404, "Not Found" }, + { 405, "Method Not Allowed" }, + { 406, "Not Acceptable" }, + { 407, "Proxy Authentication Required" }, + { 408, "Request Timeout" }, + { 409, "Conflict" }, + { 410, "Gone" }, + { 411, "Length Required" }, + { 412, "Precondition Failed" }, + { 413, "Request Entity Too Large" }, + { 414, "Request-URI Too Long" }, + { 415, "Unsupported Media Type" }, + { 416, "Requested Range Not Satisfiable" }, + { 417, "Expectation Failed" }, + { 426, "Upgrade Required" }, + { 428, "Precondition Required" }, + { 429, "Too Many Requests" }, + { 431, "Request Header Fields Too Large" }, + { 451, "Unavailable For Legal Reasons"}, + { 500, "Internal Server Error" }, + { 501, "Not Implemented" }, + { 502, "Bad Gateway" }, + { 503, "Service Unavailable" }, + { 504, "Gateway Timeout" }, + { 505, "HTTP Version Not Supported" }, + { 506, "Variant Also Negotiates" }, + { 511, "Network Authentication Required" }, + /* to allow search with while() loop */ + { 0, NULL } +}; + +static const size_t http_status_map_len = (sizeof(http_status_map) / sizeof(http_response_status_code_pair)) - 1; + +#endif /* HTTP_STATUS_CODES_H */ diff --git a/include/php/main/main_arginfo.h b/include/php/main/main_arginfo.h new file mode 100644 index 0000000..1ca5e3a --- /dev/null +++ b/include/php/main/main_arginfo.h @@ -0,0 +1,98 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 58c8b6ec69650d241919ebba4f957b4b141fb9f2 */ + + + +static void register_main_symbols(int module_number) +{ + REGISTER_STRING_CONSTANT("PHP_VERSION", PHP_VERSION, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_MAJOR_VERSION", PHP_MAJOR_VERSION, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_MINOR_VERSION", PHP_MINOR_VERSION, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_RELEASE_VERSION", PHP_RELEASE_VERSION, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_EXTRA_VERSION", PHP_EXTRA_VERSION, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_VERSION_ID", PHP_VERSION_ID, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_ZTS", PHP_ZTS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_DEBUG", PHP_DEBUG, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_OS", PHP_OS_STR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_OS_FAMILY", PHP_OS_FAMILY, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DEFAULT_INCLUDE_PATH", PHP_INCLUDE_PATH, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PEAR_INSTALL_DIR", PEAR_INSTALLDIR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PEAR_EXTENSION_DIR", PHP_EXTENSION_DIR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_EXTENSION_DIR", PHP_EXTENSION_DIR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_PREFIX", PHP_PREFIX, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_BINDIR", PHP_BINDIR, CONST_PERSISTENT); +#if !defined(PHP_WIN32) + REGISTER_STRING_CONSTANT("PHP_MANDIR", PHP_MANDIR, CONST_PERSISTENT); +#endif + REGISTER_STRING_CONSTANT("PHP_LIBDIR", PHP_LIBDIR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_DATADIR", PHP_DATADIR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_SYSCONFDIR", PHP_SYSCONFDIR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_LOCALSTATEDIR", PHP_LOCALSTATEDIR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_CONFIG_FILE_PATH", PHP_CONFIG_FILE_PATH, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX, CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PHP_EOL", PHP_EOL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_MAXPATHLEN", MAXPATHLEN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_INT_MAX", ZEND_LONG_MAX, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_INT_MIN", ZEND_LONG_MIN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_INT_SIZE", SIZEOF_ZEND_LONG, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_FD_SETSIZE", FD_SETSIZE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_FLOAT_DIG", DBL_DIG, CONST_PERSISTENT); + REGISTER_DOUBLE_CONSTANT("PHP_FLOAT_EPSILON", DBL_EPSILON, CONST_PERSISTENT); + REGISTER_DOUBLE_CONSTANT("PHP_FLOAT_MAX", DBL_MAX, CONST_PERSISTENT); + REGISTER_DOUBLE_CONSTANT("PHP_FLOAT_MIN", DBL_MIN, CONST_PERSISTENT); +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_VERSION_MAJOR", EG(windows_version_info).dwMajorVersion, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_VERSION_MINOR", EG(windows_version_info).dwMinorVersion, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_VERSION_BUILD", EG(windows_version_info).dwBuildNumber, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_VERSION_PLATFORM", EG(windows_version_info).dwPlatformId, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_VERSION_SP_MAJOR", EG(windows_version_info).wServicePackMajor, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_VERSION_SP_MINOR", EG(windows_version_info).wServicePackMinor, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_VERSION_SUITEMASK", EG(windows_version_info).wSuiteMask, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_VERSION_PRODUCTTYPE", EG(windows_version_info).wProductType, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_NT_DOMAIN_CONTROLLER", VER_NT_DOMAIN_CONTROLLER, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_NT_SERVER", VER_NT_SERVER, CONST_PERSISTENT); +#endif +#if defined(PHP_WIN32) + REGISTER_LONG_CONSTANT("PHP_WINDOWS_NT_WORKSTATION", VER_NT_WORKSTATION, CONST_PERSISTENT); +#endif + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_WRITE", PHP_OUTPUT_HANDLER_WRITE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_FLUSH", PHP_OUTPUT_HANDLER_FLUSH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CLEAN", PHP_OUTPUT_HANDLER_CLEAN, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_FINAL", PHP_OUTPUT_HANDLER_FINAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_WRITE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_FINAL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CLEANABLE", PHP_OUTPUT_HANDLER_CLEANABLE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_FLUSHABLE", PHP_OUTPUT_HANDLER_FLUSHABLE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_REMOVABLE", PHP_OUTPUT_HANDLER_REMOVABLE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_STDFLAGS", PHP_OUTPUT_HANDLER_STDFLAGS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_STARTED", PHP_OUTPUT_HANDLER_STARTED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_OUTPUT_HANDLER_DISABLED", PHP_OUTPUT_HANDLER_DISABLED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UPLOAD_ERR_OK", PHP_UPLOAD_ERROR_OK, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UPLOAD_ERR_INI_SIZE", PHP_UPLOAD_ERROR_A, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UPLOAD_ERR_FORM_SIZE", PHP_UPLOAD_ERROR_B, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UPLOAD_ERR_PARTIAL", PHP_UPLOAD_ERROR_C, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UPLOAD_ERR_NO_FILE", PHP_UPLOAD_ERROR_D, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UPLOAD_ERR_NO_TMP_DIR", PHP_UPLOAD_ERROR_E, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UPLOAD_ERR_CANT_WRITE", PHP_UPLOAD_ERROR_F, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UPLOAD_ERR_EXTENSION", PHP_UPLOAD_ERROR_X, CONST_PERSISTENT); +} diff --git a/include/php/main/php.h b/include/php/main/php.h new file mode 100644 index 0000000..7237f55 --- /dev/null +++ b/include/php/main/php.h @@ -0,0 +1,443 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_H +#define PHP_H + +#ifdef HAVE_DMALLOC +#include +#endif + +#define PHP_API_VERSION 20230831 +#define PHP_HAVE_STREAMS +#define YYDEBUG 0 +#define PHP_DEFAULT_CHARSET "UTF-8" + +#include "php_version.h" +#include "zend.h" +#include "zend_sort.h" +#include "php_compat.h" + +#include "zend_API.h" + +#define php_sprintf sprintf + +/* Operating system family definition */ +#ifdef PHP_WIN32 +# define PHP_OS_FAMILY "Windows" +#elif defined(BSD) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +# define PHP_OS_FAMILY "BSD" +#elif defined(__APPLE__) || defined(__MACH__) +# define PHP_OS_FAMILY "Darwin" +#elif defined(__sun__) +# define PHP_OS_FAMILY "Solaris" +#elif defined(__linux__) +# define PHP_OS_FAMILY "Linux" +#else +# define PHP_OS_FAMILY "Unknown" +#endif + +/* PHP's DEBUG value must match Zend's ZEND_DEBUG value */ +#undef PHP_DEBUG +#define PHP_DEBUG ZEND_DEBUG + +#ifdef PHP_WIN32 +# include "tsrm_win32.h" +# ifdef PHP_EXPORTS +# define PHPAPI __declspec(dllexport) +# else +# define PHPAPI __declspec(dllimport) +# endif +# define PHP_DIR_SEPARATOR '\\' +# define PHP_EOL "\r\n" +#else +# if defined(__GNUC__) && __GNUC__ >= 4 +# define PHPAPI __attribute__ ((visibility("default"))) +# else +# define PHPAPI +# endif +# define PHP_DIR_SEPARATOR '/' +# define PHP_EOL "\n" +#endif + +/* Windows specific defines */ +#ifdef PHP_WIN32 +# define PHP_PROG_SENDMAIL "Built in mailer" +# define WIN32_LEAN_AND_MEAN +# define NOOPENFILE + +# include +# include +# include +# include +# include +# include +# include +# include + +typedef int uid_t; +typedef int gid_t; +typedef char * caddr_t; +typedef int pid_t; + +# define M_TWOPI (M_PI * 2.0) +# define off_t _off_t + +# define lstat(x, y) php_sys_lstat(x, y) +# define chdir(path) _chdir(path) +# define mkdir(a, b) _mkdir(a) +# define rmdir(a) _rmdir(a) +# define getpid _getpid +# define php_sleep(t) SleepEx(t*1000, TRUE) + +# ifndef getcwd +# define getcwd(a, b) _getcwd(a, b) +# endif +#endif + +#if PHP_DEBUG +#undef NDEBUG +#else +#ifndef NDEBUG +#define NDEBUG +#endif +#endif +#include + +#ifdef HAVE_UNIX_H +#include +#endif + +#if HAVE_ALLOCA_H +#include +#endif + +#if HAVE_BUILD_DEFS_H +#include +#endif + +/* + * This is a fast version of strlcpy which should be used, if you + * know the size of the destination buffer and if you know + * the length of the source string. + * + * size is the allocated number of bytes of dst + * src_size is the number of bytes excluding the NUL of src + */ + +#define PHP_STRLCPY(dst, src, size, src_size) \ + { \ + size_t php_str_len; \ + \ + if (src_size >= size) \ + php_str_len = size - 1; \ + else \ + php_str_len = src_size; \ + memcpy(dst, src, php_str_len); \ + dst[php_str_len] = '\0'; \ + } + +#ifndef HAVE_STRLCPY +BEGIN_EXTERN_C() +PHPAPI size_t php_strlcpy(char *dst, const char *src, size_t siz); +END_EXTERN_C() +#undef strlcpy +#define strlcpy php_strlcpy +#define HAVE_STRLCPY 1 +#define USE_STRLCPY_PHP_IMPL 1 +#endif + +#ifndef HAVE_STRLCAT +BEGIN_EXTERN_C() +PHPAPI size_t php_strlcat(char *dst, const char *src, size_t siz); +END_EXTERN_C() +#undef strlcat +#define strlcat php_strlcat +#define HAVE_STRLCAT 1 +#define USE_STRLCAT_PHP_IMPL 1 +#endif + +#ifndef HAVE_EXPLICIT_BZERO +BEGIN_EXTERN_C() +PHPAPI void php_explicit_bzero(void *dst, size_t siz); +END_EXTERN_C() +#undef explicit_bzero +#define explicit_bzero php_explicit_bzero +#endif + +BEGIN_EXTERN_C() +PHPAPI int php_safe_bcmp(const zend_string *a, const zend_string *b); +END_EXTERN_C() + +#ifndef HAVE_STRTOK_R +BEGIN_EXTERN_C() +char *strtok_r(char *s, const char *delim, char **last); +END_EXTERN_C() +#endif + +#ifndef HAVE_SOCKLEN_T +# ifdef PHP_WIN32 +typedef int socklen_t; +# else +typedef unsigned int socklen_t; +# endif +#endif + +#define CREATE_MUTEX(a, b) +#define SET_MUTEX(a) +#define FREE_MUTEX(a) + +/* + * Then the ODBC support can use both iodbc and Solid, + * uncomment this. + * #define HAVE_ODBC (HAVE_IODBC|HAVE_SOLID) + */ + +#include +#include +#if HAVE_UNISTD_H +#include +#endif + +#include + +#include "zend_hash.h" +#include "zend_alloc.h" +#include "zend_stack.h" +#include + +#if HAVE_PWD_H +# ifdef PHP_WIN32 +#include "win32/param.h" +# else +#include +#include +# endif +#endif + +#include + +#ifndef LONG_MAX +#define LONG_MAX 2147483647L +#endif + +#ifndef LONG_MIN +#define LONG_MIN (- LONG_MAX - 1) +#endif + +#ifndef INT_MAX +#define INT_MAX 2147483647 +#endif + +#ifndef INT_MIN +#define INT_MIN (- INT_MAX - 1) +#endif + +#define PHP_DOUBLE_MAX_LENGTH ZEND_DOUBLE_MAX_LENGTH + +#define PHP_GCC_VERSION ZEND_GCC_VERSION +#define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC +#define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT + +BEGIN_EXTERN_C() +#include "snprintf.h" +END_EXTERN_C() +#include "spprintf.h" + +#define EXEC_INPUT_BUF 4096 + +#define PHP_MIME_TYPE "application/x-httpd-php" + +/* macros */ +#define STR_PRINT(str) ((str)?(str):"") + +#ifndef MAXPATHLEN +# ifdef PHP_WIN32 +# include "win32/ioutil.h" +# define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN +# elif PATH_MAX +# define MAXPATHLEN PATH_MAX +# elif defined(MAX_PATH) +# define MAXPATHLEN MAX_PATH +# else +# define MAXPATHLEN 256 /* Should be safe for any weird systems that do not define it */ +# endif +#endif + +#define php_ignore_value(x) ZEND_IGNORE_VALUE(x) + +/* global variables */ +#ifndef PHP_WIN32 +#define php_sleep sleep +extern char **environ; +#endif /* ifndef PHP_WIN32 */ + +#ifdef PHP_PWRITE_64 +ssize_t pwrite(int, void *, size_t, off64_t); +#endif + +#ifdef PHP_PREAD_64 +ssize_t pread(int, void *, size_t, off64_t); +#endif + +BEGIN_EXTERN_C() +void phperror(char *error); +PHPAPI size_t php_write(void *buf, size_t size); +PHPAPI size_t php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2); +PHPAPI size_t php_printf_unchecked(const char *format, ...); +PHPAPI bool php_during_module_startup(void); +PHPAPI bool php_during_module_shutdown(void); +PHPAPI bool php_get_module_initialized(void); +#ifdef HAVE_SYSLOG_H +#include "php_syslog.h" +#define php_log_err(msg) php_log_err_with_severity(msg, LOG_NOTICE) +#else +#define php_log_err(msg) php_log_err_with_severity(msg, 5) +#endif +PHPAPI ZEND_COLD void php_log_err_with_severity(const char *log_message, int syslog_type_int); +int Debug(char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2); +int cfgparse(void); +END_EXTERN_C() + +#define php_error zend_error +#define error_handling_t zend_error_handling_t + +BEGIN_EXTERN_C() +static inline ZEND_ATTRIBUTE_DEPRECATED void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class) +{ + zend_replace_error_handling(error_handling, exception_class, NULL); +} +static inline ZEND_ATTRIBUTE_DEPRECATED void php_std_error_handling(void) {} + +PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int type, const char *format, va_list args) PHP_ATTRIBUTE_FORMAT(printf, 4, 0); + +/* PHPAPI void php_error(int type, const char *format, ...); */ +PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...) + PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPAPI ZEND_COLD void php_error_docref1(const char *docref, const char *param1, int type, const char *format, ...) + PHP_ATTRIBUTE_FORMAT(printf, 4, 5); +PHPAPI ZEND_COLD void php_error_docref2(const char *docref, const char *param1, const char *param2, int type, const char *format, ...) + PHP_ATTRIBUTE_FORMAT(printf, 5, 6); +#ifdef PHP_WIN32 +PHPAPI ZEND_COLD void php_win32_docref1_from_error(DWORD error, const char *param1); +PHPAPI ZEND_COLD void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2); +#endif +END_EXTERN_C() + +#define zenderror phperror +#define zendlex phplex + +#define phpparse zendparse +#define phprestart zendrestart +#define phpin zendin + +#define php_memnstr zend_memnstr +#define php_memnistr zend_memnistr + +/* functions */ +BEGIN_EXTERN_C() +PHPAPI extern int (*php_register_internal_extensions_func)(void); +PHPAPI int php_register_internal_extensions(void); +PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata); +PHPAPI void php_com_initialize(void); +PHPAPI char *php_get_current_user(void); + +PHPAPI const char *php_get_internal_encoding(void); +PHPAPI const char *php_get_input_encoding(void); +PHPAPI const char *php_get_output_encoding(void); +PHPAPI extern void (*php_internal_encoding_changed)(void); +END_EXTERN_C() + +/* PHP-named Zend macro wrappers */ +#define PHP_FN ZEND_FN +#define PHP_MN ZEND_MN +#define PHP_NAMED_FUNCTION ZEND_NAMED_FUNCTION +#define PHP_FUNCTION ZEND_FUNCTION +#define PHP_METHOD ZEND_METHOD + +#define PHP_RAW_NAMED_FE ZEND_RAW_NAMED_FE +#define PHP_NAMED_FE ZEND_NAMED_FE +#define PHP_FE ZEND_FE +#define PHP_DEP_FE ZEND_DEP_FE +#define PHP_FALIAS ZEND_FALIAS +#define PHP_DEP_FALIAS ZEND_DEP_FALIAS +#define PHP_ME ZEND_ME +#define PHP_MALIAS ZEND_MALIAS +#define PHP_ABSTRACT_ME ZEND_ABSTRACT_ME +#define PHP_ME_MAPPING ZEND_ME_MAPPING +#define PHP_FE_END ZEND_FE_END + +#define PHP_MODULE_STARTUP_N ZEND_MODULE_STARTUP_N +#define PHP_MODULE_SHUTDOWN_N ZEND_MODULE_SHUTDOWN_N +#define PHP_MODULE_ACTIVATE_N ZEND_MODULE_ACTIVATE_N +#define PHP_MODULE_DEACTIVATE_N ZEND_MODULE_DEACTIVATE_N +#define PHP_MODULE_INFO_N ZEND_MODULE_INFO_N + +#define PHP_MODULE_STARTUP_D ZEND_MODULE_STARTUP_D +#define PHP_MODULE_SHUTDOWN_D ZEND_MODULE_SHUTDOWN_D +#define PHP_MODULE_ACTIVATE_D ZEND_MODULE_ACTIVATE_D +#define PHP_MODULE_DEACTIVATE_D ZEND_MODULE_DEACTIVATE_D +#define PHP_MODULE_INFO_D ZEND_MODULE_INFO_D + +/* Compatibility macros */ +#define PHP_MINIT ZEND_MODULE_STARTUP_N +#define PHP_MSHUTDOWN ZEND_MODULE_SHUTDOWN_N +#define PHP_RINIT ZEND_MODULE_ACTIVATE_N +#define PHP_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N +#define PHP_MINFO ZEND_MODULE_INFO_N +#define PHP_GINIT ZEND_GINIT +#define PHP_GSHUTDOWN ZEND_GSHUTDOWN + +#define PHP_MINIT_FUNCTION ZEND_MODULE_STARTUP_D +#define PHP_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D +#define PHP_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D +#define PHP_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D +#define PHP_MINFO_FUNCTION ZEND_MODULE_INFO_D +#define PHP_GINIT_FUNCTION ZEND_GINIT_FUNCTION +#define PHP_GSHUTDOWN_FUNCTION ZEND_GSHUTDOWN_FUNCTION + +#define PHP_MODULE_GLOBALS ZEND_MODULE_GLOBALS + + +/* Output support */ +#include "main/php_output.h" + + +#include "php_streams.h" +#include "php_memory_streams.h" +#include "fopen_wrappers.h" + + +/* Virtual current working directory support */ +#include "zend_virtual_cwd.h" + +#include "zend_constants.h" + +/* connection status states */ +#define PHP_CONNECTION_NORMAL 0 +#define PHP_CONNECTION_ABORTED 1 +#define PHP_CONNECTION_TIMEOUT 2 + +#include "php_reentrancy.h" + +/* the following typedefs are deprecated and will be removed in PHP + * 9.0; use the standard C99 types instead */ +typedef bool zend_bool; +typedef intptr_t zend_intptr_t; +typedef uintptr_t zend_uintptr_t; + +#endif diff --git a/include/php/main/php_compat.h b/include/php/main/php_compat.h new file mode 100644 index 0000000..438ada4 --- /dev/null +++ b/include/php/main/php_compat.h @@ -0,0 +1,400 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_COMPAT_H +#define PHP_COMPAT_H + +#ifdef PHP_WIN32 +#include "config.w32.h" +#else +#include +#endif + +#if defined(HAVE_BUNDLED_PCRE) || !defined(PHP_VERSION) +#define pcre2_jit_callback_8 php_pcre2_jit_callback +#define pcre2_callout_enumerate_8 php_pcre2_callout_enumerate +#define pcre2_code_copy_8 php_pcre2_code_copy +#define pcre2_code_copy_with_tables_8 php_pcre2_code_copy_with_tables +#define pcre2_code_free_8 php_pcre2_code_free +#define pcre2_compile_8 php_pcre2_compile +#define pcre2_compile_context_copy_8 php_pcre2_compile_context_copy +#define pcre2_compile_context_create_8 php_pcre2_compile_context_create +#define pcre2_compile_context_free_8 php_pcre2_compile_context_free +#define pcre2_config_8 php_pcre2_config +#define pcre2_convert_context_copy_8 php_pcre2_convert_context_copy +#define pcre2_convert_context_create_8 php_pcre2_convert_context_create +#define pcre2_convert_context_free_8 php_pcre2_convert_context_free +#define pcre2_dfa_match_8 php_pcre2_dfa_match +#define pcre2_general_context_copy_8 php_pcre2_general_context_copy +#define pcre2_general_context_create_8 php_pcre2_general_context_create +#define pcre2_general_context_free_8 php_pcre2_general_context_free +#define pcre2_get_error_message_8 php_pcre2_get_error_message +#define pcre2_get_mark_8 php_pcre2_get_mark +#define pcre2_get_ovector_pointer_8 php_pcre2_get_ovector_pointer +#define pcre2_get_ovector_count_8 php_pcre2_get_ovector_count +#define pcre2_get_startchar_8 php_pcre2_get_startchar +#define pcre2_jit_compile_8 php_pcre2_jit_compile +#define pcre2_jit_match_8 php_pcre2_jit_match +#define pcre2_jit_free_unused_memory_8 php_pcre2_jit_free_unused_memory +#define pcre2_jit_stack_assign_8 php_pcre2_jit_stack_assign +#define pcre2_jit_stack_create_8 php_pcre2_jit_stack_create +#define pcre2_jit_stack_free_8 php_pcre2_jit_stack_free +#define pcre2_maketables_8 php_pcre2_maketables +#define pcre2_match_8 php_pcre2_match +#define pcre2_match_context_copy_8 php_pcre2_match_context_copy +#define pcre2_match_context_create_8 php_pcre2_match_context_create +#define pcre2_match_context_free_8 php_pcre2_match_context_free +#define pcre2_match_data_create_8 php_pcre2_match_data_create +#define pcre2_match_data_create_from_pattern_8 php_pcre2_match_data_create_from_pattern +#define pcre2_match_data_free_8 php_pcre2_match_data_free +#define pcre2_pattern_info_8 php_pcre2_pattern_info +#define pcre2_serialize_decode_8 php_pcre2_serialize_decode +#define pcre2_serialize_encode_8 php_pcre2_serialize_encode +#define pcre2_serialize_free_8 php_pcre2_serialize_free +#define pcre2_serialize_get_number_of_codes_8 php_pcre2_serialize_get_number_of_codes +#define pcre2_set_bsr_8 php_pcre2_set_bsr +#define pcre2_set_callout_8 php_pcre2_set_callout +#define pcre2_set_character_tables_8 php_pcre2_set_character_tables +#define pcre2_set_compile_extra_options_8 php_pcre2_set_compile_extra_options +#define pcre2_set_compile_recursion_guard_8 php_pcre2_set_compile_recursion_guard +#define pcre2_set_depth_limit_8 php_pcre2_set_depth_limit +#define pcre2_set_glob_escape_8 php_pcre2_set_glob_escape +#define pcre2_set_glob_separator_8 php_pcre2_set_glob_separator +#define pcre2_set_heap_limit_8 php_pcre2_set_heap_limit +#define pcre2_set_match_limit_8 php_pcre2_set_match_limit +#define pcre2_set_max_pattern_length_8 php_pcre2_set_max_pattern_length +#define pcre2_set_newline_8 php_pcre2_set_newline +#define pcre2_set_parens_nest_limit_8 php_pcre2_set_parens_nest_limit +#define pcre2_set_offset_limit_8 php_pcre2_set_offset_limit +#define pcre2_substitute_8 php_pcre2_substitute +#define pcre2_substring_copy_byname_8 php_pcre2_substring_copy_byname +#define pcre2_substring_copy_bynumber_8 php_pcre2_substring_copy_bynumber +#define pcre2_substring_free_8 php_pcre2_substring_free +#define pcre2_substring_get_byname_8 php_pcre2_substring_get_byname +#define pcre2_substring_get_bynumber_8 php_pcre2_substring_get_bynumber +#define pcre2_substring_length_byname_8 php_pcre2_substring_length_byname +#define pcre2_substring_length_bynumber_8 php_pcre2_substring_length_bynumber +#define pcre2_substring_list_get_8 php_pcre2_substring_list_get +#define pcre2_substring_list_free_8 php_pcre2_substring_list_free +#define pcre2_substring_nametable_scan_8 php_pcre2_substring_nametable_scan +#define pcre2_substring_number_from_name_8 php_pcre2_substring_number_from_name +#define pcre2_set_recursion_limit_8 php_pcre2_set_recursion_limit +#define pcre2_set_recursion_memory_management_8 php_pcre2_set_recursion_memory_management +#endif + +#define lookup php_lookup +#define hashTableInit php_hashTableInit +#define hashTableDestroy php_hashTableDestroy +#define hashTableIterInit php_hashTableIterInit +#define hashTableIterNext php_hashTableIterNext + +#if defined(HAVE_LIBXML) && (defined(HAVE_XML) || defined(HAVE_XMLRPC)) && !defined(HAVE_LIBEXPAT) +#define XML_DefaultCurrent php_XML_DefaultCurrent +#define XML_ErrorString php_XML_ErrorString +#define XML_ExpatVersion php_XML_ExpatVersion +#define XML_ExpatVersionInfo php_XML_ExpatVersionInfo +#define XML_ExternalEntityParserCreate php_XML_ExternalEntityParserCreate +#define XML_GetBase php_XML_GetBase +#define XML_GetBuffer php_XML_GetBuffer +#define XML_GetCurrentByteCount php_XML_GetCurrentByteCount +#define XML_GetCurrentByteIndex php_XML_GetCurrentByteIndex +#define XML_GetCurrentColumnNumber php_XML_GetCurrentColumnNumber +#define XML_GetCurrentLineNumber php_XML_GetCurrentLineNumber +#define XML_GetErrorCode php_XML_GetErrorCode +#define XML_GetIdAttributeIndex php_XML_GetIdAttributeIndex +#define XML_GetInputContext php_XML_GetInputContext +#define XML_GetSpecifiedAttributeCount php_XML_GetSpecifiedAttributeCount +#define XmlGetUtf16InternalEncodingNS php_XmlGetUtf16InternalEncodingNS +#define XmlGetUtf16InternalEncoding php_XmlGetUtf16InternalEncoding +#define XmlGetUtf8InternalEncodingNS php_XmlGetUtf8InternalEncodingNS +#define XmlGetUtf8InternalEncoding php_XmlGetUtf8InternalEncoding +#define XmlInitEncoding php_XmlInitEncoding +#define XmlInitEncodingNS php_XmlInitEncodingNS +#define XmlInitUnknownEncoding php_XmlInitUnknownEncoding +#define XmlInitUnknownEncodingNS php_XmlInitUnknownEncodingNS +#define XML_ParseBuffer php_XML_ParseBuffer +#define XML_Parse php_XML_Parse +#define XML_ParserCreate_MM php_XML_ParserCreate_MM +#define XML_ParserCreateNS php_XML_ParserCreateNS +#define XML_ParserCreate php_XML_ParserCreate +#define XML_ParserFree php_XML_ParserFree +#define XmlParseXmlDecl php_XmlParseXmlDecl +#define XmlParseXmlDeclNS php_XmlParseXmlDeclNS +#define XmlPrologStateInitExternalEntity php_XmlPrologStateInitExternalEntity +#define XmlPrologStateInit php_XmlPrologStateInit +#define XML_SetAttlistDeclHandler php_XML_SetAttlistDeclHandler +#define XML_SetBase php_XML_SetBase +#define XML_SetCdataSectionHandler php_XML_SetCdataSectionHandler +#define XML_SetCharacterDataHandler php_XML_SetCharacterDataHandler +#define XML_SetCommentHandler php_XML_SetCommentHandler +#define XML_SetDefaultHandlerExpand php_XML_SetDefaultHandlerExpand +#define XML_SetDefaultHandler php_XML_SetDefaultHandler +#define XML_SetDoctypeDeclHandler php_XML_SetDoctypeDeclHandler +#define XML_SetElementDeclHandler php_XML_SetElementDeclHandler +#define XML_SetElementHandler php_XML_SetElementHandler +#define XML_SetEncoding php_XML_SetEncoding +#define XML_SetEndCdataSectionHandler php_XML_SetEndCdataSectionHandler +#define XML_SetEndDoctypeDeclHandler php_XML_SetEndDoctypeDeclHandler +#define XML_SetEndElementHandler php_XML_SetEndElementHandler +#define XML_SetEndNamespaceDeclHandler php_XML_SetEndNamespaceDeclHandler +#define XML_SetEntityDeclHandler php_XML_SetEntityDeclHandler +#define XML_SetExternalEntityRefHandlerArg php_XML_SetExternalEntityRefHandlerArg +#define XML_SetExternalEntityRefHandler php_XML_SetExternalEntityRefHandler +#define XML_SetNamespaceDeclHandler php_XML_SetNamespaceDeclHandler +#define XML_SetNotationDeclHandler php_XML_SetNotationDeclHandler +#define XML_SetNotStandaloneHandler php_XML_SetNotStandaloneHandler +#define XML_SetParamEntityParsing php_XML_SetParamEntityParsing +#define XML_SetProcessingInstructionHandler php_XML_SetProcessingInstructionHandler +#define XML_SetReturnNSTriplet php_XML_SetReturnNSTriplet +#define XML_SetStartCdataSectionHandler php_XML_SetStartCdataSectionHandler +#define XML_SetStartDoctypeDeclHandler php_XML_SetStartDoctypeDeclHandler +#define XML_SetStartElementHandler php_XML_SetStartElementHandler +#define XML_SetStartNamespaceDeclHandler php_XML_SetStartNamespaceDeclHandler +#define XML_SetUnknownEncodingHandler php_XML_SetUnknownEncodingHandler +#define XML_SetUnparsedEntityDeclHandler php_XML_SetUnparsedEntityDeclHandler +#define XML_SetUserData php_XML_SetUserData +#define XML_SetXmlDeclHandler php_XML_SetXmlDeclHandler +#define XmlSizeOfUnknownEncoding php_XmlSizeOfUnknownEncoding +#define XML_UseParserAsHandlerArg php_XML_UseParserAsHandlerArg +#define XmlUtf16Encode php_XmlUtf16Encode +#define XmlUtf8Encode php_XmlUtf8Encode +#define XML_FreeContentModel php_XML_FreeContentModel +#define XML_MemMalloc php_XML_MemMalloc +#define XML_MemRealloc php_XML_MemRealloc +#define XML_MemFree php_XML_MemFree +#define XML_UseForeignDTD php_XML_UseForeignDTD +#define XML_GetFeatureList php_XML_GetFeatureList +#define XML_ParserReset php_XML_ParserReset + +#ifdef HAVE_GD_BUNDLED +#define any2eucjp php_gd_any2eucjp +#define createwbmp php_gd_createwbmp +#define empty_output_buffer php_gd_empty_output_buffer +#define fill_input_buffer php_gd_fill_input_buffer +#define freewbmp php_gd_freewbmp +#define gdAlphaBlend php_gd_gdAlphaBlend +#define gdCompareInt php_gd_gdCompareInt +#define gdCosT php_gd_gdCosT +#define gdCtxPrintf php_gd_gdCtxPrintf +#define gdDPExtractData php_gd_gdDPExtractData +#define gdFontGetGiant php_gd_gdFontGetGiant +#define gdFontGetLarge php_gd_gdFontGetLarge +#define gdFontGetMediumBold php_gd_gdFontGetMediumBold +#define gdFontGetSmall php_gd_gdFontGetSmall +#define gdFontGetTiny php_gd_gdFontGetTiny +#define gdFontGiant php_gd_gdFontGiant +#define gdFontGiantData php_gd_gdFontGiantData +#define gdFontGiantRep php_gd_gdFontGiantRep +#define gdFontLarge php_gd_gdFontLarge +#define gdFontLargeData php_gd_gdFontLargeData +#define gdFontLargeRep php_gd_gdFontLargeRep +#define gdFontMediumBold php_gd_gdFontMediumBold +#define gdFontMediumBoldData php_gd_gdFontMediumBoldData +#define gdFontMediumBoldRep php_gd_gdFontMediumBoldRep +#define gdFontSmall php_gd_gdFontSmall +#define gdFontSmallData php_gd_gdFontSmallData +#define gdFontSmallRep php_gd_gdFontSmallRep +#define gdFontTiny php_gd_gdFontTiny +#define gdFontTinyData php_gd_gdFontTinyData +#define gdFontTinyRep php_gd_gdFontTinyRep +#define gdGetBuf php_gd_gdGetBuf +#define gdGetByte php_gd_gdGetByte +#define gdGetC php_gd_gdGetC +#define _gdGetColors php_gd__gdGetColors +#define gd_getin php_gd_gd_getin +#define gdGetInt php_gd_gdGetInt +#define gdGetWord php_gd_gdGetWord +#define gdImageAABlend php_gd_gdImageAABlend +#define gdImageAALine php_gd_gdImageAALine +#define gdImageAlphaBlending php_gd_gdImageAlphaBlending +#define gdImageAntialias php_gd_gdImageAntialias +#define gdImageArc php_gd_gdImageArc +#define gdImageBrightness php_gd_gdImageBrightness +#define gdImageChar php_gd_gdImageChar +#define gdImageCharUp php_gd_gdImageCharUp +#define gdImageColor php_gd_gdImageColor +#define gdImageColorAllocate php_gd_gdImageColorAllocate +#define gdImageColorAllocateAlpha php_gd_gdImageColorAllocateAlpha +#define gdImageColorClosest php_gd_gdImageColorClosest +#define gdImageColorClosestAlpha php_gd_gdImageColorClosestAlpha +#define gdImageColorClosestHWB php_gd_gdImageColorClosestHWB +#define gdImageColorDeallocate php_gd_gdImageColorDeallocate +#define gdImageColorExact php_gd_gdImageColorExact +#define gdImageColorExactAlpha php_gd_gdImageColorExactAlpha +#define gdImageColorMatch php_gd_gdImageColorMatch +#define gdImageColorResolve php_gd_gdImageColorResolve +#define gdImageColorResolveAlpha php_gd_gdImageColorResolveAlpha +#define gdImageColorTransparent php_gd_gdImageColorTransparent +#define gdImageCompare php_gd_gdImageCompare +#define gdImageContrast php_gd_gdImageContrast +#define gdImageConvolution php_gd_gdImageConvolution +#define gdImageCopy php_gd_gdImageCopy +#define gdImageCopyMerge php_gd_gdImageCopyMerge +#define gdImageCopyMergeGray php_gd_gdImageCopyMergeGray +#define gdImageCopyResampled php_gd_gdImageCopyResampled +#define gdImageCopyResized php_gd_gdImageCopyResized +#define gdImageCreate php_gd_gdImageCreate +#define gdImageCreateFromGd php_gd_gdImageCreateFromGd +#define gdImageCreateFromGd2 php_gd_gdImageCreateFromGd2 +#define gdImageCreateFromGd2Ctx php_gd_gdImageCreateFromGd2Ctx +#define gdImageCreateFromGd2Part php_gd_gdImageCreateFromGd2Part +#define gdImageCreateFromGd2PartCtx php_gd_gdImageCreateFromGd2PartCtx +#define gdImageCreateFromGd2PartPtr php_gd_gdImageCreateFromGd2PartPtr +#define gdImageCreateFromGd2Ptr php_gd_gdImageCreateFromGd2Ptr +#define gdImageCreateFromGdCtx php_gd_gdImageCreateFromGdCtx +#define gdImageCreateFromGdPtr php_gd_gdImageCreateFromGdPtr +#define gdImageCreateFromGif php_gd_gdImageCreateFromGif +#define gdImageCreateFromGifCtx php_gd_gdImageCreateFromGifCtx +#define gdImageCreateFromGifSource php_gd_gdImageCreateFromGifSource +#define gdImageCreateFromJpeg php_gd_gdImageCreateFromJpeg +#define gdImageCreateFromJpegCtx php_gd_gdImageCreateFromJpegCtx +#define gdImageCreateFromJpegPtr php_gd_gdImageCreateFromJpegPtr +#define gdImageCreateFromPng php_gd_gdImageCreateFromPng +#define gdImageCreateFromPngCtx php_gd_gdImageCreateFromPngCtx +#define gdImageCreateFromPngPtr php_gd_gdImageCreateFromPngPtr +#define gdImageCreateFromPngSource php_gd_gdImageCreateFromPngSource +#define gdImageCreateFromWBMP php_gd_gdImageCreateFromWBMP +#define gdImageCreateFromWBMPCtx php_gd_gdImageCreateFromWBMPCtx +#define gdImageCreateFromWBMPPtr php_gd_gdImageCreateFromWBMPPtr +#define gdImageCreateFromXbm php_gd_gdImageCreateFromXbm +#define gdImageCreatePaletteFromTrueColor php_gd_gdImageCreatePaletteFromTrueColor +#define gdImageCreateTrueColor php_gd_gdImageCreateTrueColor +#define gdImageDashedLine php_gd_gdImageDashedLine +#define gdImageDestroy php_gd_gdImageDestroy +#define gdImageEdgeDetectQuick php_gd_gdImageEdgeDetectQuick +#define gdImageEllipse php_gd_gdImageEllipse +#define gdImageEmboss php_gd_gdImageEmboss +#define gdImageFill php_gd_gdImageFill +#define gdImageFilledArc php_gd_gdImageFilledArc +#define gdImageFilledEllipse php_gd_gdImageFilledEllipse +#define gdImageFilledPolygon php_gd_gdImageFilledPolygon +#define gdImageFilledRectangle php_gd_gdImageFilledRectangle +#define _gdImageFillTiled php_gd__gdImageFillTiled +#define gdImageFillToBorder php_gd_gdImageFillToBorder +#define gdImageGaussianBlur php_gd_gdImageGaussianBlur +#define gdImageGd php_gd_gdImageGd +#define gdImageGd2 php_gd_gdImageGd2 +#define gdImageGd2Ptr php_gd_gdImageGd2Ptr +#define gdImageGdPtr php_gd_gdImageGdPtr +#define gdImageGetClip php_gd_gdImageGetClip +#define gdImageGetPixel php_gd_gdImageGetPixel +#define gdImageGetTrueColorPixel php_gd_gdImageGetTrueColorPixel +#define gdImageGif php_gd_gdImageGif +#define gdImageGifCtx php_gd_gdImageGifCtx +#define gdImageGifPtr php_gd_gdImageGifPtr +#define gdImageGrayScale php_gd_gdImageGrayScale +#define gdImageInterlace php_gd_gdImageInterlace +#define gdImageJpeg php_gd_gdImageJpeg +#define gdImageJpegCtx php_gd_gdImageJpegCtx +#define gdImageJpegPtr php_gd_gdImageJpegPtr +#define gdImageLine php_gd_gdImageLine +#define gdImageMeanRemoval php_gd_gdImageMeanRemoval +#define gdImageNegate php_gd_gdImageNegate +#define gdImagePaletteCopy php_gd_gdImagePaletteCopy +#define gdImagePng php_gd_gdImagePng +#define gdImagePngCtx php_gd_gdImagePngCtx +#define gdImagePngCtxEx php_gd_gdImagePngCtxEx +#define gdImagePngEx php_gd_gdImagePngEx +#define gdImagePngPtr php_gd_gdImagePngPtr +#define gdImagePngPtrEx php_gd_gdImagePngPtrEx +#define gdImagePngToSink php_gd_gdImagePngToSink +#define gdImagePolygon php_gd_gdImagePolygon +#define gdImageRectangle php_gd_gdImageRectangle +#define gdImageRotate php_gd_gdImageRotate +#define gdImageRotate180 php_gd_gdImageRotate180 +#define gdImageRotate270 php_gd_gdImageRotate270 +#define gdImageRotate45 php_gd_gdImageRotate45 +#define gdImageRotate90 php_gd_gdImageRotate90 +#define gdImageSaveAlpha php_gd_gdImageSaveAlpha +#define gdImageSelectiveBlur php_gd_gdImageSelectiveBlur +#define gdImageSetAntiAliased php_gd_gdImageSetAntiAliased +#define gdImageSetAntiAliasedDontBlend php_gd_gdImageSetAntiAliasedDontBlend +#define gdImageSetBrush php_gd_gdImageSetBrush +#define gdImageSetClip php_gd_gdImageSetClip +#define gdImageSetPixel php_gd_gdImageSetPixel +#define gdImageSetStyle php_gd_gdImageSetStyle +#define gdImageSetThickness php_gd_gdImageSetThickness +#define gdImageSetTile php_gd_gdImageSetTile +#define gdImageSkewX php_gd_gdImageSkewX +#define gdImageSkewY php_gd_gdImageSkewY +#define gdImageSmooth php_gd_gdImageSmooth +#define gdImageString php_gd_gdImageString +#define gdImageString16 php_gd_gdImageString16 +#define gdImageStringFT php_gd_gdImageStringFT +#define gdImageStringFTEx php_gd_gdImageStringFTEx +#define gdImageStringTTF php_gd_gdImageStringTTF +#define gdImageStringUp php_gd_gdImageStringUp +#define gdImageStringUp16 php_gd_gdImageStringUp16 +#define gdImageTrueColorToPalette php_gd_gdImageTrueColorToPalette +#define gdImageWBMP php_gd_gdImageWBMP +#define gdImageWBMPCtx php_gd_gdImageWBMPCtx +#define gdImageWBMPPtr php_gd_gdImageWBMPPtr +#define gdImageXbmCtx php_gd_gdImageXbmCtx +#define gdNewDynamicCtx php_gd_gdNewDynamicCtx +#define gdNewDynamicCtxEx php_gd_gdNewDynamicCtxEx +#define gdNewFileCtx php_gd_gdNewFileCtx +#define gdNewSSCtx php_gd_gdNewSSCtx +#define gdPutBuf php_gd_gdPutBuf +#define gdPutC php_gd_gdPutC +#define _gdPutColors php_gd__gdPutColors +#define gdPutInt php_gd_gdPutInt +#define gd_putout php_gd_gd_putout +#define gdPutWord php_gd_gdPutWord +#define gdSeek php_gd_gdSeek +#define gdSinT php_gd_gdSinT +#define gd_strtok_r php_gd_gd_strtok_r +#define gdTell php_gd_gdTell +#define getmbi php_gd_getmbi +#define init_destination php_gd_init_destination +#define init_source php_gd_init_source +#define jpeg_gdIOCtx_dest php_gd_jpeg_gdIOCtx_dest +#define jpeg_gdIOCtx_src php_gd_jpeg_gdIOCtx_src +#define lsqrt php_gd_lsqrt +#define printwbmp php_gd_printwbmp +#define Putchar php_gd_Putchar +#define putmbi php_gd_putmbi +#define Putword php_gd_Putword +#define readwbmp php_gd_readwbmp +#define skipheader php_gd_skipheader +#define skip_input_data php_gd_skip_input_data +#define term_destination php_gd_term_destination +#define term_source php_gd_term_source +#define writewbmp php_gd_writewbmp +#define ZeroDataBlock php_gd_ZeroDataBlock +#define gdCacheCreate php_gd_gdCacheCreate +#define gdCacheDelete php_gd_gdCacheDelete +#define gdCacheGet php_gd_gdCacheGet +#define gdFontCacheSetup php_gd_gdFontCacheSetup +#define gdFontCacheShutdown php_gd_gdFontCacheShutdown +#define gdFreeFontCache php_gd_gdFreeFontCache +#endif /* HAVE_GD_BUNDLED */ + +/* Define to specify how much context to retain around the current parse + point. */ +#define XML_CONTEXT_BYTES 1024 + +/* Define to make parameter entity parsing functionality available. */ +#define XML_DTD 1 + +/* Define to make XML Namespaces functionality available. */ +#define XML_NS 1 +#endif + +#ifdef PHP_EXPORTS +#define PCRE_STATIC +#endif + +#endif diff --git a/include/php/main/php_config.h b/include/php/main/php_config.h new file mode 100644 index 0000000..0be99f9 --- /dev/null +++ b/include/php/main/php_config.h @@ -0,0 +1,2323 @@ +/* main/php_config.h. Generated from php_config.h.in by configure. */ +/* main/php_config.h.in. Generated from configure.ac by autoheader. */ + + +#ifndef PHP_CONFIG_H +#define PHP_CONFIG_H + +#if defined(__GNUC__) && __GNUC__ >= 4 +# define ZEND_API __attribute__ ((visibility("default"))) +# define ZEND_DLEXPORT __attribute__ ((visibility("default"))) +#else +# define ZEND_API +# define ZEND_DLEXPORT +#endif + +#define ZEND_DLIMPORT + + +/* Uses cmsgcred struct */ +/* #undef ANC_CREDS_CMSGCRED */ + +/* Uses ucred struct */ +/* #undef ANC_CREDS_UCRED */ + +/* */ +/* #undef CDB_INCLUDE_FILE */ + +/* Whether to build bcmath as dynamic module */ +/* #undef COMPILE_DL_BCMATH */ + +/* Whether to build bz2 as dynamic module */ +/* #undef COMPILE_DL_BZ2 */ + +/* Whether to build calendar as dynamic module */ +/* #undef COMPILE_DL_CALENDAR */ + +/* Whether to build ctype as dynamic module */ +/* #undef COMPILE_DL_CTYPE */ + +/* Whether to build curl as dynamic module */ +/* #undef COMPILE_DL_CURL */ + +/* Whether to build date as dynamic module */ +/* #undef COMPILE_DL_DATE */ + +/* Whether to build dba as dynamic module */ +/* #undef COMPILE_DL_DBA */ + +/* Whether to build dl_test as dynamic module */ +/* #undef COMPILE_DL_DL_TEST */ + +/* Whether to build dom as dynamic module */ +/* #undef COMPILE_DL_DOM */ + +/* Whether to build enchant as dynamic module */ +/* #undef COMPILE_DL_ENCHANT */ + +/* Whether to build exif as dynamic module */ +/* #undef COMPILE_DL_EXIF */ + +/* Whether to build ffi as dynamic module */ +/* #undef COMPILE_DL_FFI */ + +/* Whether to build fileinfo as dynamic module */ +/* #undef COMPILE_DL_FILEINFO */ + +/* Whether to build filter as dynamic module */ +/* #undef COMPILE_DL_FILTER */ + +/* Whether to build ftp as dynamic module */ +/* #undef COMPILE_DL_FTP */ + +/* Whether to build gd as dynamic module */ +/* #undef COMPILE_DL_GD */ + +/* Whether to build gettext as dynamic module */ +/* #undef COMPILE_DL_GETTEXT */ + +/* Whether to build gmp as dynamic module */ +/* #undef COMPILE_DL_GMP */ + +/* Whether to build hash as dynamic module */ +/* #undef COMPILE_DL_HASH */ + +/* Whether to build iconv as dynamic module */ +/* #undef COMPILE_DL_ICONV */ + +/* Whether to build imap as dynamic module */ +/* #undef COMPILE_DL_IMAP */ + +/* Whether to build intl as dynamic module */ +/* #undef COMPILE_DL_INTL */ + +/* Whether to build json as dynamic module */ +/* #undef COMPILE_DL_JSON */ + +/* Whether to build ldap as dynamic module */ +/* #undef COMPILE_DL_LDAP */ + +/* Whether to build libxml as dynamic module */ +/* #undef COMPILE_DL_LIBXML */ + +/* Whether to build mbstring as dynamic module */ +/* #undef COMPILE_DL_MBSTRING */ + +/* Whether to build mysqli as dynamic module */ +/* #undef COMPILE_DL_MYSQLI */ + +/* Whether to build mysqlnd as dynamic module */ +/* #undef COMPILE_DL_MYSQLND */ + +/* Whether to build oci8 as dynamic module */ +/* #undef COMPILE_DL_OCI8 */ + +/* Whether to build odbc as dynamic module */ +/* #undef COMPILE_DL_ODBC */ + +/* Whether to build opcache as dynamic module */ +#define COMPILE_DL_OPCACHE 1 + +/* Whether to build openssl as dynamic module */ +/* #undef COMPILE_DL_OPENSSL */ + +/* Whether to build pcntl as dynamic module */ +/* #undef COMPILE_DL_PCNTL */ + +/* Whether to build pcre as dynamic module */ +/* #undef COMPILE_DL_PCRE */ + +/* Whether to build pdo as dynamic module */ +/* #undef COMPILE_DL_PDO */ + +/* Whether to build pdo_dblib as dynamic module */ +/* #undef COMPILE_DL_PDO_DBLIB */ + +/* Whether to build pdo_firebird as dynamic module */ +/* #undef COMPILE_DL_PDO_FIREBIRD */ + +/* Whether to build pdo_mysql as dynamic module */ +/* #undef COMPILE_DL_PDO_MYSQL */ + +/* Whether to build pdo_oci as dynamic module */ +/* #undef COMPILE_DL_PDO_OCI */ + +/* Whether to build pdo_odbc as dynamic module */ +/* #undef COMPILE_DL_PDO_ODBC */ + +/* Whether to build pdo_pgsql as dynamic module */ +/* #undef COMPILE_DL_PDO_PGSQL */ + +/* Whether to build pdo_sqlite as dynamic module */ +/* #undef COMPILE_DL_PDO_SQLITE */ + +/* Whether to build pgsql as dynamic module */ +/* #undef COMPILE_DL_PGSQL */ + +/* Whether to build phar as dynamic module */ +/* #undef COMPILE_DL_PHAR */ + +/* Whether to build posix as dynamic module */ +/* #undef COMPILE_DL_POSIX */ + +/* Whether to build pspell as dynamic module */ +/* #undef COMPILE_DL_PSPELL */ + +/* Whether to build random as dynamic module */ +/* #undef COMPILE_DL_RANDOM */ + +/* Whether to build readline as dynamic module */ +/* #undef COMPILE_DL_READLINE */ + +/* Whether to build reflection as dynamic module */ +/* #undef COMPILE_DL_REFLECTION */ + +/* Whether to build session as dynamic module */ +/* #undef COMPILE_DL_SESSION */ + +/* Whether to build shmop as dynamic module */ +/* #undef COMPILE_DL_SHMOP */ + +/* Whether to build simplexml as dynamic module */ +/* #undef COMPILE_DL_SIMPLEXML */ + +/* Whether to build snmp as dynamic module */ +/* #undef COMPILE_DL_SNMP */ + +/* Whether to build soap as dynamic module */ +/* #undef COMPILE_DL_SOAP */ + +/* Whether to build sockets as dynamic module */ +/* #undef COMPILE_DL_SOCKETS */ + +/* Whether to build sodium as dynamic module */ +/* #undef COMPILE_DL_SODIUM */ + +/* Whether to build spl as dynamic module */ +/* #undef COMPILE_DL_SPL */ + +/* Whether to build sqlite3 as dynamic module */ +/* #undef COMPILE_DL_SQLITE3 */ + +/* Whether to build standard as dynamic module */ +/* #undef COMPILE_DL_STANDARD */ + +/* Whether to build sysvmsg as dynamic module */ +/* #undef COMPILE_DL_SYSVMSG */ + +/* Whether to build sysvsem as dynamic module */ +/* #undef COMPILE_DL_SYSVSEM */ + +/* Whether to build sysvshm as dynamic module */ +/* #undef COMPILE_DL_SYSVSHM */ + +/* Whether to build tidy as dynamic module */ +/* #undef COMPILE_DL_TIDY */ + +/* Whether to build tokenizer as dynamic module */ +/* #undef COMPILE_DL_TOKENIZER */ + +/* Whether to build xml as dynamic module */ +/* #undef COMPILE_DL_XML */ + +/* Whether to build xmlreader as dynamic module */ +/* #undef COMPILE_DL_XMLREADER */ + +/* Whether to build xmlwriter as dynamic module */ +/* #undef COMPILE_DL_XMLWRITER */ + +/* Whether to build xsl as dynamic module */ +/* #undef COMPILE_DL_XSL */ + +/* Whether to build zend_test as dynamic module */ +/* #undef COMPILE_DL_ZEND_TEST */ + +/* Whether to build zip as dynamic module */ +/* #undef COMPILE_DL_ZIP */ + +/* Whether to build zlib as dynamic module */ +/* #undef COMPILE_DL_ZLIB */ + +/* */ +#define COOKIE_IO_FUNCTIONS_T cookie_io_functions_t + +/* */ +#define COOKIE_SEEKER_USES_OFF64_T 1 + +/* Define if crypt_r has uses CRYPTD */ +/* #undef CRYPT_R_CRYPTD */ + +/* Define if struct crypt_data requires _GNU_SOURCE */ +/* #undef CRYPT_R_GNU_SOURCE */ + +/* Define if crypt_r uses struct crypt_data */ +/* #undef CRYPT_R_STRUCT_CRYPT_DATA */ + +/* Define to 1 if using 'alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define if the target system is darwin */ +/* #undef DARWIN */ + +/* */ +/* #undef DB1_INCLUDE_FILE */ + +/* */ +/* #undef DB1_VERSION */ + +/* */ +/* #undef DB2_INCLUDE_FILE */ + +/* */ +/* #undef DB3_INCLUDE_FILE */ + +/* */ +/* #undef DB4_INCLUDE_FILE */ + +/* */ +/* #undef DBA_CDB */ + +/* */ +/* #undef DBA_CDB_BUILTIN */ + +/* */ +/* #undef DBA_CDB_MAKE */ + +/* */ +/* #undef DBA_DB1 */ + +/* */ +/* #undef DBA_DB2 */ + +/* */ +/* #undef DBA_DB3 */ + +/* */ +/* #undef DBA_DB4 */ + +/* */ +/* #undef DBA_DBM */ + +/* */ +/* #undef DBA_FLATFILE */ + +/* */ +/* #undef DBA_GDBM */ + +/* */ +/* #undef DBA_INIFILE */ + +/* */ +/* #undef DBA_LMDB */ + +/* */ +/* #undef DBA_NDBM */ + +/* */ +/* #undef DBA_QDBM */ + +/* */ +/* #undef DBA_TCADB */ + +/* */ +/* #undef DBM_INCLUDE_FILE */ + +/* */ +/* #undef DBM_VERSION */ + +/* */ +#define DEFAULT_SHORT_OPEN_TAG "1" + +/* Define if dlsym() requires a leading underscore in symbol names. */ +/* #undef DLSYM_NEEDS_UNDERSCORE */ + +/* Whether to enable chroot() function */ +#define ENABLE_CHROOT_FUNC 1 + +/* */ +/* #undef GDBM_INCLUDE_FILE */ + +/* Define to 1 if `TIOCGWINSZ' requires . */ +#define GWINSZ_IN_SYS_IOCTL 1 + +/* Whether 3 arg set_rebind_proc() */ +/* #undef HAVE_3ARG_SETREBINDPROC */ + +/* Define when aarch64 CRC32 API is available. */ +/* #undef HAVE_AARCH64_CRC32 */ + +/* */ +/* #undef HAVE_ADABAS */ + +/* Whether you have AI_ALL */ +/* #undef HAVE_AI_ALL */ + +/* Whether you have AI_IDN */ +/* #undef HAVE_AI_IDN */ + +/* Whether you have AI_V4MAPPED */ +/* #undef HAVE_AI_V4MAPPED */ + +/* whether the compiler supports __alignof__ */ +#define HAVE_ALIGNOF 1 + +/* Define to 1 if you have 'alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if works. */ +#define HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the `alphasort' function. */ +#define HAVE_ALPHASORT 1 + +/* AppArmor confinement available */ +/* #undef HAVE_APPARMOR */ + +/* */ +/* #undef HAVE_ARGON2LIB */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_NAMESER_H 1 + +/* Define to 1 if you have the `asctime_r' function. */ +#define HAVE_ASCTIME_R 1 + +/* Define if asm goto support */ +#define HAVE_ASM_GOTO 1 + +/* Define to 1 if you have the `asprintf' function. */ +#define HAVE_ASPRINTF 1 + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* whether the compiler supports __attribute__ ((__aligned__)) */ +#define HAVE_ATTRIBUTE_ALIGNED 1 + +/* Whether you have bcmath */ +/* #undef HAVE_BCMATH */ + +/* */ +/* #undef HAVE_BIND_TEXTDOMAIN_CODESET */ + +/* Define if system has broken getcwd */ +/* #undef HAVE_BROKEN_GETCWD */ + +/* Konstantin Chuguev's iconv implementation */ +/* #undef HAVE_BSD_ICONV */ + +/* */ +#define HAVE_BUILD_DEFS_H 1 + +/* Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o. */ +/* #undef HAVE_BUILTIN_ATOMIC */ + +/* */ +#define HAVE_BUNDLED_PCRE 1 + +/* */ +/* #undef HAVE_BZ2 */ + +/* */ +/* #undef HAVE_CALENDAR */ + +/* Libzip >= 1.6.0 with zip_register_cancel_callback_with_state function */ +/* #undef HAVE_CANCEL_CALLBACK */ + +/* Capstone is available */ +/* #undef HAVE_CAPSTONE */ + +/* Define to 1 if you have the `chroot' function. */ +#define HAVE_CHROOT 1 + +/* Define to 1 if you have the `clearenv' function. */ +/* #undef HAVE_CLEARENV */ + +/* */ +/* #undef HAVE_CLI0CLI_H */ + +/* */ +/* #undef HAVE_CLI0CORE_H */ + +/* */ +/* #undef HAVE_CLI0DEFS_H */ + +/* */ +/* #undef HAVE_CLI0ENV_H */ + +/* */ +/* #undef HAVE_CLI0EXT_H */ + +/* do we have clock_gettime? */ +/* #undef HAVE_CLOCK_GETTIME */ + +/* do we have clock_get_time? */ +/* #undef HAVE_CLOCK_GET_TIME */ + +/* */ +/* #undef HAVE_CODBC */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_COMMONCRYPTO_COMMONRANDOM_H */ + +/* Define if copy_file_range support */ +#define HAVE_COPY_FILE_RANGE 1 + +/* whether __cpuid_count is available */ +#define HAVE_CPUID_COUNT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CPUID_H 1 + +/* Define to 1 if you have the `CreateProcess' function. */ +/* #undef HAVE_CREATEPROCESS */ + +/* */ +/* #undef HAVE_CRYPT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CRYPT_H 1 + +/* */ +/* #undef HAVE_CRYPT_R */ + +/* Define to 1 if you have the `ctermid' function. */ +#define HAVE_CTERMID 1 + +/* Define to 1 if you have the `ctime_r' function. */ +#define HAVE_CTIME_R 1 + +/* */ +#define HAVE_CTYPE 1 + +/* */ +/* #undef HAVE_CURL */ + +/* Have cURL with old OpenSSL */ +/* #undef HAVE_CURL_OLD_OPENSSL */ + +/* */ +/* #undef HAVE_DBA */ + +/* Whether you want DBMaker */ +/* #undef HAVE_DBMAKER */ + +/* */ +/* #undef HAVE_DCNGETTEXT */ + +/* Define to 1 if you have the declaration of `arc4random_buf', and to 0 if + you don't. */ +#define HAVE_DECL_ARC4RANDOM_BUF 1 + +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#define HAVE_DECL_STRERROR_R 1 + +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +/* #undef HAVE_DECL_TZNAME */ + +/* do we have /dev/poll? */ +/* #undef HAVE_DEVPOLL */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* */ +#define HAVE_DLOPEN 1 + +/* */ +#define HAVE_DLSYM 1 + +/* Whether you have dmalloc */ +/* #undef HAVE_DMALLOC */ + +/* */ +/* #undef HAVE_DNGETTEXT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DNS_H */ + +/* */ +/* #undef HAVE_DNS_SEARCH */ + +/* */ +#define HAVE_DN_EXPAND 1 + +/* */ +#define HAVE_DN_SKIPNAME 1 + +/* */ +#define HAVE_DOM 1 + +/* Whether to enable DTrace support */ +/* #undef HAVE_DTRACE */ + +/* Define to 1 if you have the `eaccess' function. */ +#define HAVE_EACCESS 1 + +/* */ +/* #undef HAVE_EMPRESS */ + +/* */ +/* #undef HAVE_ENCHANT */ + +/* enchant_broker_set_param since 1.5.0 and removed in 2.x */ +/* #undef HAVE_ENCHANT_BROKER_SET_PARAM */ + +/* enchant_get_version since 1.6.0 */ +/* #undef HAVE_ENCHANT_GET_VERSION */ + +/* Libzip >= 1.2.0 with encryption support */ +/* #undef HAVE_ENCRYPTION */ + +/* do we have epoll? */ +/* #undef HAVE_EPOLL */ + +/* */ +/* #undef HAVE_ESOOB */ + +/* Whether you want EXIF (metadata from images) support */ +/* #undef HAVE_EXIF */ + +/* Define to 1 if you have the `explicit_bzero' function. */ +#define HAVE_EXPLICIT_BZERO 1 + +/* Define to 1 if you have the `explicit_memset' function. */ +/* #undef HAVE_EXPLICIT_MEMSET */ + +/* Define to 1 if you have the `fabsf' function. */ +/* #undef HAVE_FABSF */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fdatasync' function. */ +#define HAVE_FDATASYNC 1 + +/* Have ffi support */ +/* #undef HAVE_FFI */ + +/* Whether libffi supports fastcall calling convention */ +/* #undef HAVE_FFI_FASTCALL */ + +/* Whether libffi supports ms_cdecl calling convention */ +/* #undef HAVE_FFI_MS_CDECL */ + +/* Whether libffi supports pascal calling convention */ +/* #undef HAVE_FFI_PASCAL */ + +/* Whether libffi supports register calling convention */ +/* #undef HAVE_FFI_REGISTER */ + +/* Whether libffi supports stdcall calling convention */ +/* #undef HAVE_FFI_STDCALL */ + +/* Whether libffi supports sysv calling convention */ +/* #undef HAVE_FFI_SYSV */ + +/* Whether libffi supports thiscall calling convention */ +/* #undef HAVE_FFI_THISCALL */ + +/* Define to 1 if you have the `flock' function. */ +#define HAVE_FLOCK 1 + +/* Define to 1 if you have the `floorf' function. */ +/* #undef HAVE_FLOORF */ + +/* Define if flush should be called explicitly after a buffered io. */ +/* #undef HAVE_FLUSHIO */ + +/* Define to 1 if your system has a working POSIX `fnmatch' function. */ +#define HAVE_FNMATCH 1 + +/* */ +#define HAVE_FOPENCOOKIE 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define to 1 if you have the `forkx' function. */ +/* #undef HAVE_FORKX */ + +/* Define to 1 if you have the `fpathconf' function. */ +#define HAVE_FPATHCONF 1 + +/* do we have acl support? */ +/* #undef HAVE_FPM_ACL */ + +/* whether fpsetprec is present and usable */ +/* #undef HAVE_FPSETPREC */ + +/* whether FPU control word can be manipulated by inline assembler */ +#define HAVE_FPU_INLINE_ASM_X86 1 + +/* Define to 1 if you have the `ftok' function. */ +#define HAVE_FTOK 1 + +/* Whether you want FTP support */ +/* #undef HAVE_FTP */ + +/* Whether FTP over SSL is supported */ +/* #undef HAVE_FTP_SSL */ + +/* Define to 1 if the system has the `ifunc' function attribute */ +#define HAVE_FUNC_ATTRIBUTE_IFUNC 1 + +/* Define to 1 if the system has the `target' function attribute */ +#define HAVE_FUNC_ATTRIBUTE_TARGET 1 + +/* Define to 1 if you have the three-argument form of gethostbyname_r(). */ +/* #undef HAVE_FUNC_GETHOSTBYNAME_R_3 */ + +/* Define to 1 if you have the five-argument form of gethostbyname_r(). */ +/* #undef HAVE_FUNC_GETHOSTBYNAME_R_5 */ + +/* Define to 1 if you have the six-argument form of gethostbyname_r(). */ +#define HAVE_FUNC_GETHOSTBYNAME_R_6 1 + +/* Define to 1 if you have the `funopen' function. */ +/* #undef HAVE_FUNOPEN */ + +/* Define to 1 if you have the `gai_strerror' function. */ +#define HAVE_GAI_STRERROR 1 + +/* Define if the target system has support for global register variables */ +#define HAVE_GCC_GLOBAL_REGS 1 + +/* Whether you have gcov */ +/* #undef HAVE_GCOV */ + +/* */ +/* #undef HAVE_GD_AVIF */ + +/* */ +/* #undef HAVE_GD_BMP */ + +/* */ +/* #undef HAVE_GD_BUNDLED */ + +/* */ +/* #undef HAVE_GD_FREETYPE */ + +/* */ +/* #undef HAVE_GD_GET_INTERPOLATION */ + +/* */ +/* #undef HAVE_GD_JPG */ + +/* */ +/* #undef HAVE_GD_LIBVERSION */ + +/* */ +/* #undef HAVE_GD_PNG */ + +/* */ +/* #undef HAVE_GD_TGA */ + +/* */ +/* #undef HAVE_GD_WEBP */ + +/* */ +/* #undef HAVE_GD_XPM */ + +/* Define if you have the getaddrinfo function */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getgrgid_r' function. */ +#define HAVE_GETGRGID_R 1 + +/* Define to 1 if you have the `getgrnam_r' function. */ +#define HAVE_GETGRNAM_R 1 + +/* Define to 1 if you have the `getgroups' function. */ +#define HAVE_GETGROUPS 1 + +/* */ +#define HAVE_GETHOSTBYADDR 1 + +/* Define to 1 if you have some form of gethostbyname_r(). */ +#define HAVE_GETHOSTBYNAME_R 1 + +/* */ +#define HAVE_GETHOSTNAME 1 + +/* whether getifaddrs is present and usable */ +#define HAVE_GETIFADDRS 1 + +/* Define to 1 if you have the `getloadavg' function. */ +#define HAVE_GETLOADAVG 1 + +/* Define to 1 if you have the `getlogin' function. */ +#define HAVE_GETLOGIN 1 + +/* Define to 1 if you have the `getopt' function. */ +#define HAVE_GETOPT 1 + +/* Define to 1 if you have the `getpgid' function. */ +#define HAVE_GETPGID 1 + +/* Define to 1 if you have the `getpid' function. */ +#define HAVE_GETPID 1 + +/* Define to 1 if you have the `getpriority' function. */ +/* #undef HAVE_GETPRIORITY */ + +/* Define to 1 if you have the `getprotobyname' function. */ +#define HAVE_GETPROTOBYNAME 1 + +/* Define to 1 if you have the `getprotobynumber' function. */ +#define HAVE_GETPROTOBYNUMBER 1 + +/* Define to 1 if you have the `getpwnam_r' function. */ +#define HAVE_GETPWNAM_R 1 + +/* Define to 1 if you have the `getpwuid_r' function. */ +#define HAVE_GETPWUID_R 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* Define to 1 if you have the `getservbyname' function. */ +#define HAVE_GETSERVBYNAME 1 + +/* Define to 1 if you have the `getservbyport' function. */ +#define HAVE_GETSERVBYPORT 1 + +/* Define to 1 if you have the `getsid' function. */ +#define HAVE_GETSID 1 + +/* Define to 1 if you have the `gettid' function. */ +#define HAVE_GETTID 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `getwd' function. */ +#define HAVE_GETWD 1 + +/* glibc's iconv implementation */ +#define HAVE_GLIBC_ICONV 1 + +/* Define to 1 if you have the `glob' function. */ +#define HAVE_GLOB 1 + +/* */ +/* #undef HAVE_GMP */ + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GRP_H 1 + +/* */ +/* #undef HAVE_HISTORY_LIST */ + +/* Define to 1 if you have the `hstrerror' function. */ +/* #undef HAVE_HSTRERROR */ + +/* */ +#define HAVE_HTONL 1 + +/* Define to enable copying PHP CODE pages into HUGE PAGES (experimental) */ +#define HAVE_HUGE_CODE_PAGES 1 + +/* */ +/* #undef HAVE_IBMDB2 */ + +/* IBM iconv implementation */ +/* #undef HAVE_IBM_ICONV */ + +/* */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IEEEFP_H */ + +/* Define to 1 if you have the `if_indextoname' function. */ +/* #undef HAVE_IF_INDEXTONAME */ + +/* Define to 1 if you have the `if_nametoindex' function. */ +/* #undef HAVE_IF_NAMETOINDEX */ + +/* */ +/* #undef HAVE_IMAP */ + +/* */ +/* #undef HAVE_IMAP2000 */ + +/* */ +/* #undef HAVE_IMAP2001 */ + +/* */ +/* #undef HAVE_IMAP2004 */ + +/* */ +/* #undef HAVE_IMAP_AUTH_GSS */ + +/* Whether IMAP extension has Kerberos support */ +/* #undef HAVE_IMAP_KRB */ + +/* */ +/* #undef HAVE_IMAP_MUTF7 */ + +/* */ +/* #undef HAVE_IMAP_SSL */ + +/* Define to 1 if you have the header file. */ +#define HAVE_IMMINTRIN_H 1 + +/* */ +#define HAVE_INET_ATON 1 + +/* Define to 1 if you have the `inet_ntoa' function. */ +#define HAVE_INET_NTOA 1 + +/* Define to 1 if you have the `inet_ntop' function. */ +#define HAVE_INET_NTOP 1 + +/* Define to 1 if you have the `inet_pton' function. */ +#define HAVE_INET_PTON 1 + +/* Define to 1 if you have the `initgroups' function. */ +#define HAVE_INITGROUPS 1 + +/* Whether intmax_t is available */ +#define HAVE_INTMAX_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* */ +/* #undef HAVE_IODBC */ + +/* */ +/* #undef HAVE_IODBC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IO_H */ + +/* Whether to enable IPv6 support */ +#define HAVE_IPV6 1 + +/* */ +/* #undef HAVE_ISQLEXT_H */ + +/* */ +/* #undef HAVE_ISQL_H */ + +/* Define to enable JIT */ +#define HAVE_JIT 1 + +/* whether to enable JavaScript Object Serialization support */ +#define HAVE_JSON 1 + +/* Define to 1 if you have the `kill' function. */ +#define HAVE_KILL 1 + +/* do we have kqueue? */ +/* #undef HAVE_KQUEUE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `lchown' function. */ +#define HAVE_LCHOWN 1 + +/* */ +/* #undef HAVE_LDAP */ + +/* Define to 1 if you have the `ldap_control_find' function. */ +/* #undef HAVE_LDAP_CONTROL_FIND */ + +/* Define to 1 if you have the `ldap_extended_operation' function. */ +/* #undef HAVE_LDAP_EXTENDED_OPERATION */ + +/* Define to 1 if you have the `ldap_extended_operation_s' function. */ +/* #undef HAVE_LDAP_EXTENDED_OPERATION_S */ + +/* Define to 1 if you have the `ldap_parse_extended_result' function. */ +/* #undef HAVE_LDAP_PARSE_EXTENDED_RESULT */ + +/* Define to 1 if you have the `ldap_parse_reference' function. */ +/* #undef HAVE_LDAP_PARSE_REFERENCE */ + +/* Define to 1 if you have the `ldap_parse_result' function. */ +/* #undef HAVE_LDAP_PARSE_RESULT */ + +/* Define to 1 if you have the `ldap_passwd' function. */ +/* #undef HAVE_LDAP_PASSWD */ + +/* Define to 1 if you have the `ldap_refresh_s' function. */ +/* #undef HAVE_LDAP_REFRESH_S */ + +/* LDAP SASL support */ +/* #undef HAVE_LDAP_SASL */ + +/* Define to 1 if you have the `ldap_start_tls_s' function. */ +/* #undef HAVE_LDAP_START_TLS_S */ + +/* Define to 1 if you have the `ldap_whoami_s' function. */ +/* #undef HAVE_LDAP_WHOAMI_S */ + +/* */ +/* #undef HAVE_LIBATOMIC */ + +/* */ +/* #undef HAVE_LIBAVIF */ + +/* */ +/* #undef HAVE_LIBBIND */ + +/* */ +/* #undef HAVE_LIBBSD */ + +/* */ +/* #undef HAVE_LIBCRYPT */ + +/* */ +#define HAVE_LIBDL 1 + +/* */ +/* #undef HAVE_LIBEDIT */ + +/* */ +/* #undef HAVE_LIBEXPAT */ + +/* */ +/* #undef HAVE_LIBFREETYPE */ + +/* */ +/* #undef HAVE_LIBGD */ + +/* Whether libiconv is used */ +/* #undef HAVE_LIBICONV */ + +/* */ +/* #undef HAVE_LIBINTL */ + +/* */ +/* #undef HAVE_LIBJPEG */ + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Whether you have libmm */ +/* #undef HAVE_LIBMM */ + +/* */ +/* #undef HAVE_LIBNETWORK */ + +/* */ +/* #undef HAVE_LIBNSL */ + +/* */ +/* #undef HAVE_LIBPAM */ + +/* */ +/* #undef HAVE_LIBPNG */ + +/* Define to 1 if you have the `pq' library (-lpq). */ +/* #undef HAVE_LIBPQ */ + +/* */ +/* #undef HAVE_LIBRARYMANAGER_H */ + +/* */ +/* #undef HAVE_LIBREADLINE */ + +/* */ +/* #undef HAVE_LIBRESOLV */ + +/* */ +/* #undef HAVE_LIBROOT */ + +/* */ +#define HAVE_LIBRT 1 + +/* */ +/* #undef HAVE_LIBSOCKET */ + +/* */ +/* #undef HAVE_LIBSODIUMLIB */ + +/* */ +/* #undef HAVE_LIBUTIL */ + +/* */ +/* #undef HAVE_LIBWEBP */ + +/* */ +#define HAVE_LIBXML 1 + +/* Libzip >= 1.3.1 with zip_libzip_version function */ +/* #undef HAVE_LIBZIP_VERSION */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_FILTER_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_SOCK_DIAG_H 1 + +/* Define to 1 if you have the `localtime_r' function. */ +#define HAVE_LOCALTIME_R 1 + +/* Define to 1 if the system has the type `long double'. */ +/* #undef HAVE_LONG_DOUBLE */ + +/* do we have SO_LISTENQxxx? */ +/* #undef HAVE_LQ_SO_LISTENQ */ + +/* do we have TCP_CONNECTION_INFO? */ +/* #undef HAVE_LQ_TCP_CONNECTION_INFO */ + +/* do we have TCP_INFO? */ +/* #undef HAVE_LQ_TCP_INFO */ + +/* do we have mach_vm_read? */ +/* #undef HAVE_MACH_VM_READ */ + +/* Define to 1 if you have the `makedev' function. */ +/* #undef HAVE_MAKEDEV */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* whether to have multibyte regex support */ +/* #undef HAVE_MBREGEX */ + +/* whether to have multibyte string support */ +/* #undef HAVE_MBSTRING */ + +/* Define to 1 if you have the `memcntl' function. */ +/* #undef HAVE_MEMCNTL */ + +/* Define to 1 if you have the `memfd_create' function. */ +#define HAVE_MEMFD_CREATE 1 + +/* Define to 1 if you have the `memmem' function. */ +#define HAVE_MEMMEM 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the `memrchr' function. */ +#define HAVE_MEMRCHR 1 + +/* Libzip >= 1.7.0 with zip_*_method_supported functions */ +/* #undef HAVE_METHOD_SUPPORTED */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MINIX_CONFIG_H */ + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have the `mknod' function. */ +#define HAVE_MKNOD 1 + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `mprotect' function. */ +#define HAVE_MPROTECT 1 + +/* Define to 1 if you have the `mremap' function. */ +#define HAVE_MREMAP 1 + +/* Whether you have MySQL */ +/* #undef HAVE_MYSQL */ + +/* */ +#define HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NET_IF_H 1 + +/* Whether utf8_mime2text() has new signature */ +/* #undef HAVE_NEW_MIME2TEXT */ + +/* */ +/* #undef HAVE_NGETTEXT */ + +/* Define to 1 if you have the `nice' function. */ +#define HAVE_NICE 1 + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NMMINTRIN_H 1 + +/* Defined to 1 if the PHP OCI8 extension for Oracle Database is configured */ +/* #undef HAVE_OCI8 */ + +/* Defined to 1 if PHP OCI8 DTrace support was enabled during configuration */ +/* #undef HAVE_OCI8_DTRACE */ + +/* */ +/* #undef HAVE_OCIENVCREATE */ + +/* */ +/* #undef HAVE_OCIENVNLSCREATE */ + +/* */ +/* #undef HAVE_OCILOBREAD2 */ + +/* */ +/* #undef HAVE_OCISTMTFETCH2 */ + +/* Defined to 1 if OCI8 configuration located Oracle's Instant Client + libraries */ +/* #undef HAVE_OCI_INSTANT_CLIENT */ + +/* */ +/* #undef HAVE_ODBC2 */ + +/* */ +/* #undef HAVE_ODBCSDK_H */ + +/* */ +/* #undef HAVE_ODBC_H */ + +/* */ +#define HAVE_OPENPTY 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENSSL_CRYPTO_H */ + +/* */ +/* #undef HAVE_OPENSSL_EXT */ + +/* */ +/* #undef HAVE_ORALDAP */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OS_SIGNPOST_H */ + +/* Define to 1 if you have the `pathconf' function. */ +#define HAVE_PATHCONF 1 + +/* */ +#define HAVE_PCRE_JIT_SUPPORT 1 + +/* */ +/* #undef HAVE_PCRE_VALGRIND_SUPPORT */ + +/* */ +/* #undef HAVE_PDO_DBLIB */ + +/* */ +/* #undef HAVE_PDO_FIREBIRD */ + +/* Whether to build PostgreSQL for PDO support or not */ +/* #undef HAVE_PDO_PGSQL */ + +/* Define to 1 if you have the pdo_sqlite extension enabled. */ +#define HAVE_PDO_SQLITELIB 1 + +/* Whether to build PostgreSQL support or not */ +/* #undef HAVE_PGSQL */ + +/* Whether libpq is compiled with --enable-multibyte */ +/* #undef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT */ + +/* PostgreSQL 9.6 or later */ +/* #undef HAVE_PG_CONTEXT_VISIBILITY */ + +/* PostgreSQL 9.3 or later */ +/* #undef HAVE_PG_LO64 */ + +/* */ +#define HAVE_PHPDBG 1 + +/* */ +/* #undef HAVE_PHPDBG_READLINE */ + +/* */ +#define HAVE_PHP_SESSION 1 + +/* Define to 1 if you have the `poll' function. */ +#define HAVE_POLL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_POLL_H 1 + +/* do we have port framework? */ +/* #undef HAVE_PORT */ + +/* whether to include POSIX-like functions */ +#define HAVE_POSIX 1 + +/* */ +#define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP 1 + +/* do we have prctl? */ +#define HAVE_PRCTL 1 + +/* */ +#define HAVE_PREAD 1 + +/* do we have procctl? */ +/* #undef HAVE_PROCCTL */ + +/* Libzip >= 1.3.0 with zip_register_progress_callback_with_state function */ +/* #undef HAVE_PROGRESS_CALLBACK */ + +/* */ +/* #undef HAVE_PSPELL */ + +/* Define to 1 if the PS_STRINGS thing exists. */ +/* #undef HAVE_PS_STRINGS */ + +/* Define to 1 if you have the `pthread_attr_getstack' function. */ +#define HAVE_PTHREAD_ATTR_GETSTACK 1 + +/* Define to 1 if you have the `pthread_attr_get_np' function. */ +/* #undef HAVE_PTHREAD_ATTR_GET_NP */ + +/* Define to 1 if you have the `pthread_getattr_np' function. */ +#define HAVE_PTHREAD_GETATTR_NP 1 + +/* Define to 1 if you have the `pthread_get_stackaddr_np' function. */ +/* #undef HAVE_PTHREAD_GET_STACKADDR_NP */ + +/* Define to 1 if you have the `pthread_jit_write_protect_np' function. */ +/* #undef HAVE_PTHREAD_JIT_WRITE_PROTECT_NP */ + +/* Define to 1 if you have the `pthread_stackseg_np' function. */ +/* #undef HAVE_PTHREAD_STACKSEG_NP */ + +/* do we have ptrace? */ +/* #undef HAVE_PTRACE */ + +/* Whether ptrdiff_t is available */ +#define HAVE_PTRDIFF_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTY_H 1 + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PWD_H 1 + +/* */ +#define HAVE_PWRITE 1 + +/* Define to 1 if you have the `RAND_egd' function. */ +/* #undef HAVE_RAND_EGD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_RESOLV_H 1 + +/* */ +/* #undef HAVE_RES_NDESTROY */ + +/* */ +#define HAVE_RES_NSEARCH 1 + +/* */ +#define HAVE_RES_SEARCH 1 + +/* */ +/* #undef HAVE_RFC822_OUTPUT_ADDRESS_LIST */ + +/* Define to 1 if you have the `rfork' function. */ +/* #undef HAVE_RFORK */ + +/* */ +/* #undef HAVE_RL_CALLBACK_READ_CHAR */ + +/* */ +/* #undef HAVE_RL_COMPLETION_MATCHES */ + +/* */ +/* #undef HAVE_RL_ON_NEW_LINE */ + +/* */ +/* #undef HAVE_SAPDB */ + +/* Whether you have sockaddr_storage.ss_family */ +/* #undef HAVE_SA_SS_FAMILY */ + +/* Define to 1 if you have the `scandir' function. */ +#define HAVE_SCANDIR 1 + +/* do we have select? */ +/* #undef HAVE_SELECT */ + +/* SElinux available */ +/* #undef HAVE_SELINUX */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SELINUX_SELINUX_H */ + +/* */ +/* #undef HAVE_SEMUN */ + +/* Define to 1 if you have the `setegid' function. */ +#define HAVE_SETEGID 1 + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if you have the `seteuid' function. */ +#define HAVE_SETEUID 1 + +/* Define to 1 if you have the `setitimer' function. */ +#define HAVE_SETITIMER 1 + +/* do we have setpflags? */ +/* #undef HAVE_SETPFLAGS */ + +/* Define to 1 if you have the `setpriority' function. */ +/* #undef HAVE_SETPRIORITY */ + +/* Define to 1 if you have the `setproctitle' function. */ +/* #undef HAVE_SETPROCTITLE */ + +/* Define to 1 if you have the `setproctitle_fast' function. */ +/* #undef HAVE_SETPROCTITLE_FAST */ + +/* Define to 1 if you have the `setrlimit' function. */ +#define HAVE_SETRLIMIT 1 + +/* Define to 1 if you have the `setsid' function. */ +#define HAVE_SETSID 1 + +/* */ +/* #undef HAVE_SETSOCKOPT */ + +/* Libzip >= 1.0.0 with zip_file_set_mtime */ +/* #undef HAVE_SET_MTIME */ + +/* */ +/* #undef HAVE_SHMOP */ + +/* Define if you have SysV IPC SHM support */ +#define HAVE_SHM_IPC 1 + +/* Define if you have mmap(MAP_ANON) SHM support */ +#define HAVE_SHM_MMAP_ANON 1 + +/* Define if you have POSIX mmap() SHM support */ +#define HAVE_SHM_MMAP_POSIX 1 + +/* */ +#define HAVE_SHM_OPEN 1 + +/* Define to 1 if you have the `shutdown' function. */ +#define HAVE_SHUTDOWN 1 + +/* */ +/* #undef HAVE_SHUTDOWN_SNMP_LOGGING */ + +/* Define to 1 if you have the `sigaction' function. */ +#define HAVE_SIGACTION 1 + +/* Define to 1 if you have the `sigprocmask' function. */ +#define HAVE_SIGPROCMASK 1 + +/* Define to 1 if you have the `sigsetjmp' function. */ +/* #undef HAVE_SIGSETJMP */ + +/* Define to 1 if you have the `sigtimedwait' function. */ +/* #undef HAVE_SIGTIMEDWAIT */ + +/* Define to 1 if you have the `sigwaitinfo' function. */ +/* #undef HAVE_SIGWAITINFO */ + +/* */ +#define HAVE_SIMPLEXML 1 + +/* Define if hash3 algo is available */ +/* #undef HAVE_SLOW_HASH3 */ + +/* */ +/* #undef HAVE_SNMP */ + +/* */ +/* #undef HAVE_SNMP_SHA256 */ + +/* */ +/* #undef HAVE_SNMP_SHA512 */ + +/* */ +/* #undef HAVE_SOAP */ + +/* Whether struct sockaddr has field sa_len */ +/* #undef HAVE_SOCKADDR_SA_LEN */ + +/* Whether you have struct sockaddr_storage */ +#define HAVE_SOCKADDR_STORAGE 1 + +/* Define if sockaddr_un in sys/un.h contains a sun_len component */ +/* #undef HAVE_SOCKADDR_UN_SUN_LEN */ + +/* Define to 1 if you have the `sockatmark' function. */ +/* #undef HAVE_SOCKATMARK */ + +/* */ +#define HAVE_SOCKET 1 + +/* */ +#define HAVE_SOCKETPAIR 1 + +/* */ +/* #undef HAVE_SOCKETS */ + +/* Define to 1 if the system has the type `socklen_t'. */ +#define HAVE_SOCKLEN_T 1 + +/* */ +/* #undef HAVE_SOLID */ + +/* */ +/* #undef HAVE_SOLID_30 */ + +/* */ +/* #undef HAVE_SOLID_35 */ + +/* */ +/* #undef HAVE_SQLCLI1_H */ + +/* */ +/* #undef HAVE_SQLDATASOURCES */ + +/* */ +/* #undef HAVE_SQLEXT_H */ + +/* Define to 1 if you have the sqlite3 extension enabled. */ +#define HAVE_SQLITE3 1 + +/* have sqlite3_close_v2 */ +#define HAVE_SQLITE3_CLOSE_V2 1 + +/* have sqlite3_column_table_name */ +#define HAVE_SQLITE3_COLUMN_TABLE_NAME 1 + +/* have sqlite3_errstr function */ +#define HAVE_SQLITE3_ERRSTR 1 + +/* have sqlite3_expanded_sql function */ +#define HAVE_SQLITE3_EXPANDED_SQL 1 + +/* */ +/* #undef HAVE_SQLTYPES_H */ + +/* */ +/* #undef HAVE_SQLUCODE_H */ + +/* */ +/* #undef HAVE_SQLUNIX_H */ + +/* */ +/* #undef HAVE_SQL_H */ + +/* Whether ssize_t is available */ +#define HAVE_SSIZE_T 1 + +/* Define to 1 if you have the `statfs' function. */ +#define HAVE_STATFS 1 + +/* Define to 1 if you have the `statvfs' function. */ +#define HAVE_STATVFS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `std_syslog' function. */ +/* #undef HAVE_STD_SYSLOG */ + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define if you have `strerror_r'. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* Define to 1 if you have the `strndup' function. */ +#define HAVE_STRNDUP 1 + +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if you have the `strptime' function. */ +#define HAVE_STRPTIME 1 + +/* whether strptime() declaration fails */ +#define HAVE_STRPTIME_DECL_FAILS 1 + +/* Define to 1 if you have the `strtok_r' function. */ +#define HAVE_STRTOK_R 1 + +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + +/* whether you have struct flock */ +#define HAVE_STRUCT_FLOCK 1 + +/* Define to 1 if `st_blksize' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 + +/* Define to 1 if `st_blocks' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 + +/* Define to 1 if `st_rdev' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_RDEV 1 + +/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */ +#define HAVE_STRUCT_TM_TM_GMTOFF 1 + +/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +#define HAVE_STRUCT_TM_TM_ZONE 1 + +/* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use + `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ +#define HAVE_ST_BLOCKS 1 + +/* Define to 1 if you have the `symlink' function. */ +#define HAVE_SYMLINK 1 + +/* do we have sysconf? */ +/* #undef HAVE_SYSCONF */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSEXITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSLOG_H 1 + +/* FPM use systemd integration */ +/* #undef HAVE_SYSTEMD */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYSTEMD_SD_DAEMON_H */ + +/* */ +/* #undef HAVE_SYSVMSG */ + +/* */ +/* #undef HAVE_SYSVSEM */ + +/* */ +/* #undef HAVE_SYSVSHM */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_ACL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_APPARMOR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IPC_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LOADAVG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MKDEV_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MOUNT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_POLL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PROCCTL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PSTAT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SDT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATVFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSEXITS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSMACROS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_UN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UTSNAME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_VFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* */ +/* #undef HAVE_TIDY */ + +/* defined if tidybuffio.h exists */ +/* #undef HAVE_TIDYBUFFIO_H */ + +/* */ +/* #undef HAVE_TIDYOPTGETDOC */ + +/* defined if tidyp.h exists */ +/* #undef HAVE_TIDYP_H */ + +/* */ +/* #undef HAVE_TIDYRELEASEDATE */ + +/* defined if tidy.h exists */ +/* #undef HAVE_TIDY_H */ + +/* Have timelib_config.h */ +#define HAVE_TIMELIB_CONFIG_H 1 + +/* */ +#define HAVE_TIMER_CREATE 1 + +/* do we have times? */ +/* #undef HAVE_TIMES */ + +/* Define to 1 if you have the header file. */ +#define HAVE_TMMINTRIN_H 1 + +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +#define HAVE_TM_ZONE 1 + +/* Whether you have a working ttyname_r */ +#define HAVE_TTYNAME_R 1 + +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +/* #undef HAVE_TZNAME */ + +/* Define to 1 if you have the `tzset' function. */ +#define HAVE_TZSET 1 + +/* */ +/* #undef HAVE_UDBCEXT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* */ +/* #undef HAVE_UNIXODBC */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNIX_H */ + +/* Define to 1 if you have the `unsetenv' function. */ +#define HAVE_UNSETENV 1 + +/* Define to 1 if you have the `unshare' function. */ +/* #undef HAVE_UNSHARE */ + +/* */ +/* #undef HAVE_UODBC */ + +/* Whether faulting on write-protected memory support can be compiled for + userfaultfd */ +#define HAVE_USERFAULTFD_WRITEFAULT 1 + +/* Define to 1 if you have the `usleep' function. */ +#define HAVE_USLEEP 1 + +/* Define to 1 if you have the `utime' function. */ +#define HAVE_UTIME 1 + +/* Define to 1 if you have the `utimes' function. */ +#define HAVE_UTIMES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UTIME_H 1 + +/* Whether struct utsname has domainname */ +#define HAVE_UTSNAME_DOMAINNAME 1 + +/* */ +/* #undef HAVE_VALGRIND */ + +/* Define to 1 if you have the `vasprintf' function. */ +#define HAVE_VASPRINTF 1 + +/* Define to 1 if you have the `wait3' function. */ +/* #undef HAVE_WAIT3 */ + +/* Define to 1 if you have the `wait4' function. */ +/* #undef HAVE_WAIT4 */ + +/* Define to 1 if you have the `waitpid' function. */ +/* #undef HAVE_WAITPID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WMMINTRIN_H 1 + +/* */ +#define HAVE_XML 1 + +/* */ +#define HAVE_XMLREADER 1 + +/* */ +#define HAVE_XMLWRITER 1 + +/* */ +/* #undef HAVE_XPM */ + +/* */ +/* #undef HAVE_XSL */ + +/* */ +/* #undef HAVE_XSL_EXSLT */ + +/* */ +/* #undef HAVE_ZIP */ + +/* */ +/* #undef HAVE_ZLIB */ + +/* whether _controlfp is present usable */ +/* #undef HAVE__CONTROLFP */ + +/* whether _controlfp_s is present and usable */ +/* #undef HAVE__CONTROLFP_S */ + +/* whether _FPU_SETCW is present and usable */ +#define HAVE__FPU_SETCW 1 + +/* */ +/* #undef HAVE___ATOMIC_EXCHANGE_1 */ + +/* iconv() is aliased to libiconv() in -liconv */ +/* #undef ICONV_ALIASED_LIBICONV */ + +/* Whether iconv supports IGNORE */ +#define ICONV_BROKEN_IGNORE 1 + +/* */ +/* #undef JISX0208 */ + +/* */ +/* #undef LMDB_INCLUDE_FILE */ + +/* Whether asctime_r is declared */ +/* #undef MISSING_ASCTIME_R_DECL */ + +/* Whether ctime_r is declared */ +/* #undef MISSING_CTIME_R_DECL */ + +/* */ +#define MISSING_FCLOSE_DECL 0 + +/* Whether gmtime_r is declared */ +/* #undef MISSING_GMTIME_R_DECL */ + +/* Whether localtime_r is declared */ +/* #undef MISSING_LOCALTIME_R_DECL */ + +/* Whether strtok_r is declared */ +/* #undef MISSING_STRTOK_R_DECL */ + +/* Enable compressed protocol support */ +/* #undef MYSQLND_COMPRESSION_ENABLED */ + +/* Enable mysqlnd code that uses OpenSSL directly */ +/* #undef MYSQLND_HAVE_SSL */ + +/* Enable core mysqlnd SSL code */ +/* #undef MYSQLND_SSL_SUPPORTED */ + +/* */ +/* #undef NDBM_INCLUDE_FILE */ + +/* The highest supported ODBC version */ +#define ODBCVER 0x0350 + +/* Define to the address where bug reports for this package should be sent. */ +/* #undef PACKAGE_BUGREPORT */ + +/* Define to the full name of this package. */ +/* #undef PACKAGE_NAME */ + +/* Define to the full name and version of this package. */ +/* #undef PACKAGE_STRING */ + +/* Define to the one symbol short name of this package. */ +/* #undef PACKAGE_TARNAME */ + +/* Define to the home page for this package. */ +/* #undef PACKAGE_URL */ + +/* Define to the version of this package. */ +/* #undef PACKAGE_VERSION */ + +/* */ +#define PCRE2_CODE_UNIT_WIDTH 8 + +/* */ +/* #undef PDO_MYSQL_UNIX_ADDR */ + +/* Whether pdo_mysql uses mysqlnd */ +/* #undef PDO_USE_MYSQLND */ + +/* */ +/* #undef PHAR_HAVE_OPENSSL */ + +/* */ +#define PHPDBG_DEBUG 0 + +/* build architecture */ +/* #undef PHP_BUILD_ARCH */ + +/* used compiler for build */ +/* #undef PHP_BUILD_COMPILER */ + +/* build provider */ +/* #undef PHP_BUILD_PROVIDER */ + +/* builder uname output */ +#define PHP_BUILD_SYSTEM "Linux DESKTOP-3FT75FL 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 GNU/Linux" + +/* Define if your system has fork/vfork/CreateProcess */ +#define PHP_CAN_SUPPORT_PROC_OPEN 1 + +/* fpm group name */ +/* #undef PHP_FPM_GROUP */ + +/* fpm systemd service type */ +/* #undef PHP_FPM_SYSTEMD */ + +/* fpm user name */ +/* #undef PHP_FPM_USER */ + +/* Whether the compiler supports AVX512 */ +#define PHP_HAVE_AVX512_SUPPORTS 1 + +/* Whether the compiler supports AVX512 VBMI */ +#define PHP_HAVE_AVX512_VBMI_SUPPORTS 1 + +/* Whether the compiler supports __builtin_clz */ +#define PHP_HAVE_BUILTIN_CLZ 1 + +/* Whether the compiler supports __builtin_clzl */ +#define PHP_HAVE_BUILTIN_CLZL 1 + +/* Whether the compiler supports __builtin_clzll */ +#define PHP_HAVE_BUILTIN_CLZLL 1 + +/* Whether the compiler supports __builtin_cpu_init */ +#define PHP_HAVE_BUILTIN_CPU_INIT 1 + +/* Whether the compiler supports __builtin_cpu_supports */ +#define PHP_HAVE_BUILTIN_CPU_SUPPORTS 1 + +/* Whether the compiler supports __builtin_ctzl */ +#define PHP_HAVE_BUILTIN_CTZL 1 + +/* Whether the compiler supports __builtin_ctzll */ +#define PHP_HAVE_BUILTIN_CTZLL 1 + +/* Whether the compiler supports __builtin_expect */ +#define PHP_HAVE_BUILTIN_EXPECT 1 + +/* Whether the compiler supports __builtin_frame_address */ +#define PHP_HAVE_BUILTIN_FRAME_ADDRESS 1 + +/* Whether the compiler supports __builtin_saddll_overflow */ +#define PHP_HAVE_BUILTIN_SADDLL_OVERFLOW 1 + +/* Whether the compiler supports __builtin_saddl_overflow */ +#define PHP_HAVE_BUILTIN_SADDL_OVERFLOW 1 + +/* Whether the compiler supports __builtin_smulll_overflow */ +#define PHP_HAVE_BUILTIN_SMULLL_OVERFLOW 1 + +/* Whether the compiler supports __builtin_smull_overflow */ +#define PHP_HAVE_BUILTIN_SMULL_OVERFLOW 1 + +/* Whether the compiler supports __builtin_ssubll_overflow */ +#define PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW 1 + +/* Whether the compiler supports __builtin_ssubl_overflow */ +#define PHP_HAVE_BUILTIN_SSUBL_OVERFLOW 1 + +/* Whether the compiler supports __builtin_usub_overflow */ +#define PHP_HAVE_BUILTIN_USUB_OVERFLOW 1 + +/* Whether you have HP-UX 10.x */ +/* #undef PHP_HPUX_TIME_R */ + +/* Which iconv implementation to use */ +#define PHP_ICONV_IMPL "glibc" + +/* Whether you have IRIX-style functions */ +/* #undef PHP_IRIX_TIME_R */ + +/* */ +/* #undef PHP_MHASH_BC */ + +/* */ +/* #undef PHP_MYSQL_UNIX_SOCK_ADDR */ + +/* */ +/* #undef PHP_OCI8_DEF_DIR */ + +/* */ +/* #undef PHP_OCI8_DEF_SHARED_LIBADD */ + +/* define to 1 if oniguruma has an invalid entry for KOI8 encoding */ +/* #undef PHP_ONIG_BAD_KOI8_ENTRY */ + +/* uname output */ +#define PHP_OS "Linux" + +/* */ +/* #undef PHP_PDO_OCI_CLIENT_VERSION */ + +/* whether pread64 is default */ +/* #undef PHP_PREAD_64 */ + +/* whether pwrite64 is default */ +/* #undef PHP_PWRITE_64 */ + +/* */ +#define PHP_SIGCHILD 0 + +/* uname -a output */ +#define PHP_UNAME "Linux DESKTOP-3FT75FL 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 GNU/Linux" + +/* Whether PHP has to use its own crypt_r */ +#define PHP_USE_PHP_CRYPT_R 1 + +/* Use dlopen with RTLD_NOW instead of RTLD_LAZY */ +/* #undef PHP_USE_RTLD_NOW */ + +/* whether write(2) works */ +#define PHP_WRITE_STDOUT 1 + +/* /proc/pid/mem interface */ +/* #undef PROC_MEM_FILE */ + +/* Whether to use Pthreads */ +/* #undef PTHREADS */ + +/* */ +/* #undef QDBM_INCLUDE_FILE */ + +/* */ +/* #undef SHADOW_STACK_SYSCALL */ + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* Size of intmax_t */ +#define SIZEOF_INTMAX_T 8 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* Size of ptrdiff_t */ +#define SIZEOF_PTRDIFF_T 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* Size of ssize_t */ +#define SIZEOF_SSIZE_T 8 + +/* have sqlite3 with extension support */ +/* #undef SQLITE_OMIT_LOAD_EXTENSION */ + +/* Needed in sqlunix.h for wchar defs */ +/* #undef SS_FBX */ + +/* Needed in sqlunix.h */ +/* #undef SS_LINUX */ + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define STDC_HEADERS 1 + +/* Define to 1 if strerror_r returns char *. */ +#define STRERROR_R_CHAR_P 1 + +/* */ +/* #undef TCADB_INCLUDE_FILE */ + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* */ +/* #undef USE_GD_JISX0208 */ + +/* Define if cross-process locking is required by accept() */ +/* #undef USE_LOCKING */ + +/* Use system default cipher list instead of hardcoded value */ +/* #undef USE_OPENSSL_SYSTEM_CIPHERS */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# define _DARWIN_C_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# define _HPUX_ALT_XOPEN_SOCKET_API 1 +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +/* # undef _MINIX */ +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ +#ifndef _NETBSD_SOURCE +# define _NETBSD_SOURCE 1 +#endif +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ +#ifndef _OPENBSD_SOURCE +# define _OPENBSD_SOURCE 1 +#endif +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +/* # undef _POSIX_SOURCE */ +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +/* # undef _POSIX_1_SOURCE */ +#endif +/* Enable POSIX-compatible threading on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# define __STDC_WANT_IEC_60559_BFP_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# define __STDC_WANT_IEC_60559_DFP_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# define __STDC_WANT_LIB_EXT2__ 1 +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# define __STDC_WANT_MATH_SPEC_FUNCS__ 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ +#ifndef _XOPEN_SOURCE +/* # undef _XOPEN_SOURCE */ +#endif + + +/* Define if processor uses big-endian word */ +/* #undef WORDS_BIGENDIAN */ + +/* Define if checking the stack limit is supported */ +#define ZEND_CHECK_STACK_LIMIT 1 + +/* */ +#define ZEND_DEBUG 0 + +/* */ +#define ZEND_FIBER_ASM 1 + +/* */ +/* #undef ZEND_FIBER_UCONTEXT */ + +/* Use zend max execution timers */ +/* #undef ZEND_MAX_EXECUTION_TIMERS */ + +/* */ +#define ZEND_MM_ALIGNMENT (size_t)8 + +/* */ +#define ZEND_MM_ALIGNMENT_LOG2 (size_t)3 + +/* */ +#define ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT 0 + +/* Use zend signal handling */ +#define ZEND_SIGNALS 1 + +/* */ +/* #undef ZTS */ + +/* */ +/* #undef _XOPEN_SOURCE */ + +/* Define when using musl libc */ +/* #undef __MUSL__ */ + +/* Define to `int' if doesn't define. */ +/* #undef gid_t */ + +/* */ +/* #undef in_addr_t */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if doesn't define. */ +/* #undef uid_t */ + + +#include + +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_SYS_SELECT_H +#include +#endif + +#include + +#endif /* PHP_CONFIG_H */ + diff --git a/include/php/main/php_content_types.h b/include/php/main/php_content_types.h new file mode 100644 index 0000000..6aab33e --- /dev/null +++ b/include/php/main/php_content_types.h @@ -0,0 +1,27 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_CONTENT_TYPES_H +#define PHP_CONTENT_TYPES_H + +#define DEFAULT_POST_CONTENT_TYPE "application/x-www-form-urlencoded" + +SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader); +SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler); +int php_startup_sapi_content_types(void); +int php_setup_sapi_content_types(void); + +#endif /* PHP_CONTENT_TYPES_H */ diff --git a/include/php/main/php_getopt.h b/include/php/main/php_getopt.h new file mode 100644 index 0000000..0238881 --- /dev/null +++ b/include/php/main/php_getopt.h @@ -0,0 +1,39 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Marcus Boerger | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_GETOPT_H +#define PHP_GETOPT_H + +#include "php.h" + +/* Define structure for one recognized option (both single char and long name). + * If short_open is '-' this is the last option. */ +typedef struct _opt_struct { + char opt_char; + int need_param; + char * opt_name; +} opt_struct; + +BEGIN_EXTERN_C() +/* holds the index of the latest fetched element from the opts array */ +extern PHPAPI int php_optidx; +PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err, int arg_start); +END_EXTERN_C() + +/* php_getopt will return this value if there is an error in arguments */ +#define PHP_GETOPT_INVALID_ARG (-2) + +#endif diff --git a/include/php/main/php_globals.h b/include/php/main/php_globals.h new file mode 100644 index 0000000..b2f2696 --- /dev/null +++ b/include/php/main/php_globals.h @@ -0,0 +1,178 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_GLOBALS_H +#define PHP_GLOBALS_H + +#include "zend_globals.h" + +#include + +typedef struct _php_core_globals php_core_globals; + +#ifdef ZTS +# define PG(v) ZEND_TSRMG_FAST(core_globals_offset, php_core_globals *, v) +extern PHPAPI int core_globals_id; +extern PHPAPI size_t core_globals_offset; +#else +# define PG(v) (core_globals.v) +extern ZEND_API struct _php_core_globals core_globals; +#endif + +/* Error display modes */ +#define PHP_DISPLAY_ERRORS_STDOUT 1 +#define PHP_DISPLAY_ERRORS_STDERR 2 + +/* Track vars */ +#define TRACK_VARS_POST 0 +#define TRACK_VARS_GET 1 +#define TRACK_VARS_COOKIE 2 +#define TRACK_VARS_SERVER 3 +#define TRACK_VARS_ENV 4 +#define TRACK_VARS_FILES 5 +#define TRACK_VARS_REQUEST 6 + +struct _php_tick_function_entry; + +typedef struct _arg_separators { + char *output; + char *input; +} arg_separators; + +struct _php_core_globals { + zend_long output_buffering; + + bool implicit_flush; + + bool enable_dl; + + uint8_t display_errors; + bool display_startup_errors; + bool log_errors; + bool ignore_repeated_errors; + bool ignore_repeated_source; + bool report_memleaks; + + char *output_handler; + + char *unserialize_callback_func; + zend_long serialize_precision; + + zend_long memory_limit; + zend_long max_input_time; + + char *error_log; + + char *doc_root; + char *user_dir; + char *include_path; + char *open_basedir; + bool open_basedir_modified; + char *extension_dir; + char *php_binary; + char *sys_temp_dir; + + char *upload_tmp_dir; + zend_long upload_max_filesize; + + char *error_append_string; + char *error_prepend_string; + + char *auto_prepend_file; + char *auto_append_file; + + char *input_encoding; + char *internal_encoding; + char *output_encoding; + + arg_separators arg_separator; + + char *variables_order; + + HashTable rfc1867_protected_variables; + + short connection_status; + bool ignore_user_abort; + + unsigned char header_is_being_sent; + + zend_llist tick_functions; + + zval http_globals[6]; + + bool expose_php; + + bool register_argc_argv; + bool auto_globals_jit; + + bool html_errors; + bool xmlrpc_errors; + + char *docref_root; + char *docref_ext; + + zend_long xmlrpc_error_number; + + bool activated_auto_globals[8]; + + bool modules_activated; + bool file_uploads; + bool during_request_startup; + bool allow_url_fopen; + bool enable_post_data_reading; + bool report_zend_debug; + + int last_error_type; + int last_error_lineno; + zend_string *last_error_message; + zend_string *last_error_file; + + char *php_sys_temp_dir; + + char *disable_classes; + zend_long max_input_nesting_level; + zend_long max_input_vars; + + char *user_ini_filename; + zend_long user_ini_cache_ttl; + + char *request_order; + + char *mail_log; + bool mail_x_header; + bool mail_mixed_lf_and_crlf; + + bool in_error_log; + + bool allow_url_include; +#ifdef PHP_WIN32 + bool com_initialized; +#endif + bool in_user_include; + +#ifdef PHP_WIN32 + bool windows_show_crt_warning; +#endif + + bool have_called_openlog; + zend_long syslog_facility; + char *syslog_ident; + zend_long syslog_filter; + zend_long error_log_mode; +}; + + +#endif /* PHP_GLOBALS_H */ diff --git a/include/php/main/php_ini.h b/include/php/main/php_ini.h new file mode 100644 index 0000000..a5538ef --- /dev/null +++ b/include/php/main/php_ini.h @@ -0,0 +1,87 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_INI_H +#define PHP_INI_H + +#include "zend_ini.h" + +BEGIN_EXTERN_C() +PHPAPI void config_zval_dtor(zval *zvalue); +int php_init_config(void); +int php_shutdown_config(void); +void php_ini_register_extensions(void); +PHPAPI zval *cfg_get_entry_ex(zend_string *name); +PHPAPI zval *cfg_get_entry(const char *name, size_t name_length); +PHPAPI int cfg_get_long(const char *varname, zend_long *result); +PHPAPI int cfg_get_double(const char *varname, double *result); +PHPAPI int cfg_get_string(const char *varname, char **result); +PHPAPI int php_parse_user_ini_file(const char *dirname, const char *ini_filename, HashTable *target_hash); +PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage); +PHPAPI int php_ini_has_per_dir_config(void); +PHPAPI int php_ini_has_per_host_config(void); +PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len); +PHPAPI void php_ini_activate_per_host_config(const char *host, size_t host_len); +PHPAPI HashTable* php_ini_get_configuration_hash(void); +END_EXTERN_C() + +#define PHP_INI_USER ZEND_INI_USER +#define PHP_INI_PERDIR ZEND_INI_PERDIR +#define PHP_INI_SYSTEM ZEND_INI_SYSTEM + +#define PHP_INI_ALL ZEND_INI_ALL + +#define php_ini_entry zend_ini_entry + +#define PHP_INI_MH ZEND_INI_MH +#define PHP_INI_DISP ZEND_INI_DISP + +#define PHP_INI_BEGIN ZEND_INI_BEGIN +#define PHP_INI_END ZEND_INI_END + +#define PHP_INI_ENTRY3_EX ZEND_INI_ENTRY3_EX +#define PHP_INI_ENTRY3 ZEND_INI_ENTRY3 +#define PHP_INI_ENTRY2_EX ZEND_INI_ENTRY2_EX +#define PHP_INI_ENTRY2 ZEND_INI_ENTRY2 +#define PHP_INI_ENTRY1_EX ZEND_INI_ENTRY1_EX +#define PHP_INI_ENTRY1 ZEND_INI_ENTRY1 +#define PHP_INI_ENTRY_EX ZEND_INI_ENTRY_EX +#define PHP_INI_ENTRY ZEND_INI_ENTRY + +#define STD_PHP_INI_ENTRY STD_ZEND_INI_ENTRY +#define STD_PHP_INI_ENTRY_EX STD_ZEND_INI_ENTRY_EX +#define STD_PHP_INI_BOOLEAN STD_ZEND_INI_BOOLEAN + +#define PHP_INI_DISPLAY_ORIG ZEND_INI_DISPLAY_ORIG +#define PHP_INI_DISPLAY_ACTIVE ZEND_INI_DISPLAY_ACTIVE + +#define PHP_INI_STAGE_STARTUP ZEND_INI_STAGE_STARTUP +#define PHP_INI_STAGE_SHUTDOWN ZEND_INI_STAGE_SHUTDOWN +#define PHP_INI_STAGE_ACTIVATE ZEND_INI_STAGE_ACTIVATE +#define PHP_INI_STAGE_DEACTIVATE ZEND_INI_STAGE_DEACTIVATE +#define PHP_INI_STAGE_RUNTIME ZEND_INI_STAGE_RUNTIME +#define PHP_INI_STAGE_HTACCESS ZEND_INI_STAGE_HTACCESS + +#define php_ini_boolean_displayer_cb zend_ini_boolean_displayer_cb +#define php_ini_color_displayer_cb zend_ini_color_displayer_cb + +#define php_alter_ini_entry zend_alter_ini_entry + +#define php_ini_long zend_ini_long +#define php_ini_double zend_ini_double +#define php_ini_string zend_ini_string + +#endif /* PHP_INI_H */ diff --git a/include/php/main/php_ini_builder.h b/include/php/main/php_ini_builder.h new file mode 100644 index 0000000..7f5be81 --- /dev/null +++ b/include/php/main/php_ini_builder.h @@ -0,0 +1,95 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Max Kellermann | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_INI_BUILDER_H +#define PHP_INI_BUILDER_H + +#include "php.h" + +/** + * A class which helps with constructing INI entries from the command + * line. + */ +struct php_ini_builder { + char *value; + size_t length; +}; + +BEGIN_EXTERN_C() + +static inline void php_ini_builder_init(struct php_ini_builder *b) +{ + b->value = NULL; + b->length = 0; +} + +static inline void php_ini_builder_deinit(struct php_ini_builder *b) +{ + free(b->value); +} + +/** + * Null-terminate the buffer and return it. + */ +static inline char *php_ini_builder_finish(struct php_ini_builder *b) +{ + if (b->value != NULL) { + /* null-terminate the string */ + b->value[b->length] = '\0'; + } + + return b->value; +} + +/** + * Make room for more data. + * + * @param delta the number of bytes to be appended + */ +static inline void php_ini_builder_realloc(struct php_ini_builder *b, size_t delta) +{ + /* reserve enough space for the null terminator */ + b->value = realloc(b->value, b->length + delta + 1); +} + +/** + * Prepend a string. + * + * @param src the source string + * @param length the size of the source string + */ +PHPAPI void php_ini_builder_prepend(struct php_ini_builder *b, const char *src, size_t length); + +#define php_ini_builder_prepend_literal(b, l) php_ini_builder_prepend(b, l, strlen(l)) + +/** + * Append an unquoted name/value pair. + */ +PHPAPI void php_ini_builder_unquoted(struct php_ini_builder *b, const char *name, size_t name_length, const char *value, size_t value_length); + +/** + * Append a quoted name/value pair. + */ +PHPAPI void php_ini_builder_quoted(struct php_ini_builder *b, const char *name, size_t name_length, const char *value, size_t value_length); + +/** + * Parse an INI entry from the command-line option "--define". + */ +PHPAPI void php_ini_builder_define(struct php_ini_builder *b, const char *arg); + +END_EXTERN_C() + +#endif diff --git a/include/php/main/php_main.h b/include/php/main/php_main.h new file mode 100644 index 0000000..213043b --- /dev/null +++ b/include/php/main/php_main.h @@ -0,0 +1,79 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans | + | Zeev Suraski | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_MAIN_H +#define PHP_MAIN_H + +#include "zend_globals.h" +#include "php_globals.h" +#include "SAPI.h" + +BEGIN_EXTERN_C() + +/* Returns the PHP version the engine was built with. This is useful for + * extensions which want to know the version of PHP at run-time, rather than + * the version they were built with at compile-time. + */ +PHPAPI const char *php_version(void); + +/* Returns the PHP version id the engine was built with. This is useful for + * extensions which want to know the version of PHP at run-time, rather than + * the version they were built with at compile-time. + */ +PHPAPI unsigned int php_version_id(void); + +PHPAPI zend_result php_request_startup(void); +PHPAPI void php_request_shutdown(void *dummy); +PHPAPI zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_module); +PHPAPI void php_module_shutdown(void); +PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals); + +PHPAPI zend_result php_register_extensions(zend_module_entry * const * ptr, int count); + +PHPAPI bool php_execute_script(zend_file_handle *primary_file); +PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret); +PHPAPI zend_result php_lint_script(zend_file_handle *file); + +PHPAPI void php_handle_aborted_connection(void); +PHPAPI int php_handle_auth_data(const char *auth); + +PHPAPI void php_html_puts(const char *str, size_t siz); +PHPAPI zend_result php_stream_open_for_zend_ex(zend_file_handle *handle, int mode); + +/* environment module */ +extern int php_init_environ(void); +extern int php_shutdown_environ(void); + +#ifdef ZTS +PHPAPI void php_reserve_tsrm_memory(void); +PHPAPI bool php_tsrm_startup_ex(int expected_threads); +PHPAPI bool php_tsrm_startup(void); + +#define PHP_ZTS 1 +#else +#define PHP_ZTS 0 +#endif + +#ifdef PHP_WIN32 +#define PHP_OS_STR "WINNT" +#else +#define PHP_OS_STR PHP_OS +#endif + +END_EXTERN_C() + +#endif diff --git a/include/php/main/php_memory_streams.h b/include/php/main/php_memory_streams.h new file mode 100644 index 0000000..0b7f51e --- /dev/null +++ b/include/php/main/php_memory_streams.h @@ -0,0 +1,63 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_MEMORY_STREAM_H +#define PHP_MEMORY_STREAM_H + +#include "php_streams.h" + +#define PHP_STREAM_MAX_MEM 2 * 1024 * 1024 + +#define TEMP_STREAM_DEFAULT 0x0 +#define TEMP_STREAM_READONLY 0x1 +#define TEMP_STREAM_TAKE_BUFFER 0x2 +#define TEMP_STREAM_APPEND 0x4 + +#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC) +#define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC) +#define php_stream_memory_open(mode, str) _php_stream_memory_open((mode), (str) STREAMS_CC) +#define php_stream_memory_get_buffer(stream) _php_stream_memory_get_buffer((stream) STREAMS_CC) + +#define php_stream_temp_new() php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM) +#define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC) +#define php_stream_temp_create_ex(mode, max_memory_usage, tmpdir) _php_stream_temp_create_ex((mode), (max_memory_usage), (tmpdir) STREAMS_CC) +#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC) +#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC) + +BEGIN_EXTERN_C() + +PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC); +PHPAPI php_stream *_php_stream_memory_open(int mode, zend_string *buf STREAMS_DC); +PHPAPI zend_string *_php_stream_memory_get_buffer(php_stream *stream STREAMS_DC); + +PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC); +PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir STREAMS_DC); +PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, const char *buf, size_t length STREAMS_DC); + +PHPAPI int php_stream_mode_from_str(const char *mode); +PHPAPI const char *_php_stream_mode_to_str(int mode); + +END_EXTERN_C() + +extern PHPAPI const php_stream_ops php_stream_memory_ops; +extern PHPAPI const php_stream_ops php_stream_temp_ops; +extern PHPAPI const php_stream_ops php_stream_rfc2397_ops; +extern PHPAPI const php_stream_wrapper php_stream_rfc2397_wrapper; + +#define PHP_STREAM_IS_MEMORY &php_stream_memory_ops +#define PHP_STREAM_IS_TEMP &php_stream_temp_ops + +#endif diff --git a/include/php/main/php_network.h b/include/php/main/php_network.h new file mode 100644 index 0000000..7cc3609 --- /dev/null +++ b/include/php/main/php_network.h @@ -0,0 +1,363 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Stig Venaas | + +----------------------------------------------------------------------+ + */ + +#ifndef _PHP_NETWORK_H +#define _PHP_NETWORK_H + +#include + +#ifdef PHP_WIN32 +# include "win32/inet.h" +#else +# undef closesocket +# define closesocket close +# include +#endif + +#ifndef HAVE_SHUTDOWN +#undef shutdown +#define shutdown(s,n) /* nothing */ +#endif + +#ifdef PHP_WIN32 +# ifdef EWOULDBLOCK +# undef EWOULDBLOCK +# endif +# ifdef EINPROGRESS +# undef EINPROGRESS +# endif +# define EWOULDBLOCK WSAEWOULDBLOCK +# define EINPROGRESS WSAEWOULDBLOCK +# define fsync _commit +# define ftruncate(a, b) chsize(a, b) +#endif /* defined(PHP_WIN32) */ + +#ifndef EWOULDBLOCK +# define EWOULDBLOCK EAGAIN +#endif + +/* This is a workaround for GCC bug 69602: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 */ +#if EAGAIN != EWOULDBLOCK +# define PHP_IS_TRANSIENT_ERROR(err) (err == EAGAIN || err == EWOULDBLOCK) +#else +# define PHP_IS_TRANSIENT_ERROR(err) (err == EAGAIN) +#endif + +#ifdef PHP_WIN32 +#define php_socket_errno() WSAGetLastError() +#else +#define php_socket_errno() errno +#endif + +/* like strerror, but caller must efree the returned string, + * unless buf is not NULL. + * Also works sensibly for win32 */ +BEGIN_EXTERN_C() +PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize); +PHPAPI zend_string *php_socket_error_str(long err); +END_EXTERN_C() + +#ifdef HAVE_NETINET_IN_H +# include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +#ifdef HAVE_GETHOSTBYNAME_R +#include +#endif + +/* These are here, rather than with the win32 counterparts above, + * since defines them. */ +#ifndef SHUT_RD +# define SHUT_RD 0 +# define SHUT_WR 1 +# define SHUT_RDWR 2 +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#include + +#ifdef PHP_WIN32 +typedef SOCKET php_socket_t; +#else +typedef int php_socket_t; +#endif + +#ifdef PHP_WIN32 +# define SOCK_ERR INVALID_SOCKET +# define SOCK_CONN_ERR SOCKET_ERROR +# define SOCK_RECV_ERR SOCKET_ERROR +#else +# define SOCK_ERR -1 +# define SOCK_CONN_ERR -1 +# define SOCK_RECV_ERR -1 +#endif + +#define STREAM_SOCKOP_NONE (1 << 0) +#define STREAM_SOCKOP_SO_REUSEPORT (1 << 1) +#define STREAM_SOCKOP_SO_BROADCAST (1 << 2) +#define STREAM_SOCKOP_IPV6_V6ONLY (1 << 3) +#define STREAM_SOCKOP_IPV6_V6ONLY_ENABLED (1 << 4) +#define STREAM_SOCKOP_TCP_NODELAY (1 << 5) + + +/* uncomment this to debug poll(2) emulation on systems that have poll(2) */ +/* #define PHP_USE_POLL_2_EMULATION 1 */ + +#if defined(HAVE_POLL) +# if defined(HAVE_POLL_H) +# include +# elif defined(HAVE_SYS_POLL_H) +# include +# endif +typedef struct pollfd php_pollfd; +#else +typedef struct _php_pollfd { + php_socket_t fd; + short events; + short revents; +} php_pollfd; + +PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout); + +#ifndef POLLIN +# define POLLIN 0x0001 /* There is data to read */ +# define POLLPRI 0x0002 /* There is urgent data to read */ +# define POLLOUT 0x0004 /* Writing now will not block */ +# define POLLERR 0x0008 /* Error condition */ +# define POLLHUP 0x0010 /* Hung up */ +# define POLLNVAL 0x0020 /* Invalid request: fd not open */ +#endif + +# ifndef PHP_USE_POLL_2_EMULATION +# define PHP_USE_POLL_2_EMULATION 1 +# endif +#endif + +#define PHP_POLLREADABLE (POLLIN|POLLERR|POLLHUP) + +#ifndef PHP_USE_POLL_2_EMULATION +# define php_poll2(ufds, nfds, timeout) poll(ufds, nfds, timeout) +#endif + +/* timeval-to-timeout (for poll(2)) */ +static inline int php_tvtoto(struct timeval *timeouttv) +{ + if (timeouttv) { + return (timeouttv->tv_sec * 1000) + (timeouttv->tv_usec / 1000); + } + return -1; +} + +/* hybrid select(2)/poll(2) for a single descriptor. + * timeouttv follows same rules as select(2), but is reduced to millisecond accuracy. + * Returns 0 on timeout, -1 on error, or the event mask (ala poll(2)). + */ +static inline int php_pollfd_for(php_socket_t fd, int events, struct timeval *timeouttv) +{ + php_pollfd p; + int n; + + p.fd = fd; + p.events = events; + p.revents = 0; + + n = php_poll2(&p, 1, php_tvtoto(timeouttv)); + + if (n > 0) { + return p.revents; + } + + return n; +} + +static inline int php_pollfd_for_ms(php_socket_t fd, int events, int timeout) +{ + php_pollfd p; + int n; + + p.fd = fd; + p.events = events; + p.revents = 0; + + n = php_poll2(&p, 1, timeout); + + if (n > 0) { + return p.revents; + } + + return n; +} + +/* emit warning and suggestion for unsafe select(2) usage */ +PHPAPI void _php_emit_fd_setsize_warning(int max_fd); + +static inline bool _php_check_fd_setsize(php_socket_t *max_fd, int setsize) +{ +#ifdef PHP_WIN32 + (void)(max_fd); // Unused + if (setsize + 1 >= FD_SETSIZE) { + _php_emit_fd_setsize_warning(setsize); + return false; + } +#else + (void)(setsize); // Unused + if (*max_fd >= FD_SETSIZE) { + _php_emit_fd_setsize_warning(*max_fd); + *max_fd = FD_SETSIZE - 1; + return false; + } +#endif + return true; +} + +#ifdef PHP_WIN32 +/* it is safe to FD_SET too many fd's under win32; the macro will simply ignore + * descriptors that go beyond the default FD_SETSIZE */ +# define PHP_SAFE_FD_SET(fd, set) FD_SET(fd, set) +# define PHP_SAFE_FD_CLR(fd, set) FD_CLR(fd, set) +# define PHP_SAFE_FD_ISSET(fd, set) FD_ISSET(fd, set) +# define PHP_SAFE_MAX_FD(m, n) _php_check_fd_setsize(&m, n) +#else +# define PHP_SAFE_FD_SET(fd, set) do { if (fd < FD_SETSIZE) FD_SET(fd, set); } while(0) +# define PHP_SAFE_FD_CLR(fd, set) do { if (fd < FD_SETSIZE) FD_CLR(fd, set); } while(0) +# define PHP_SAFE_FD_ISSET(fd, set) ((fd < FD_SETSIZE) && FD_ISSET(fd, set)) +# define PHP_SAFE_MAX_FD(m, n) _php_check_fd_setsize(&m, n) +#endif + + +#define PHP_SOCK_CHUNK_SIZE 8192 + +#ifdef HAVE_SOCKADDR_STORAGE +typedef struct sockaddr_storage php_sockaddr_storage; +#else +typedef struct { +#ifdef HAVE_SOCKADDR_SA_LEN + unsigned char ss_len; + unsigned char ss_family; +#else + unsigned short ss_family; +#endif + char info[126]; +} php_sockaddr_storage; +#endif + +BEGIN_EXTERN_C() +PHPAPI int php_network_getaddresses(const char *host, int socktype, struct sockaddr ***sal, zend_string **error_string); +PHPAPI void php_network_freeaddresses(struct sockaddr **sal); + +PHPAPI php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port, + int socktype, int asynchronous, struct timeval *timeout, zend_string **error_string, + int *error_code, const char *bindto, unsigned short bindport, long sockopts + ); + +PHPAPI int php_network_connect_socket(php_socket_t sockfd, + const struct sockaddr *addr, + socklen_t addrlen, + int asynchronous, + struct timeval *timeout, + zend_string **error_string, + int *error_code); + +#define php_connect_nonb(sock, addr, addrlen, timeout) \ + php_network_connect_socket((sock), (addr), (addrlen), 0, (timeout), NULL, NULL) + +PHPAPI php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned port, + int socktype, long sockopts, zend_string **error_string, int *error_code + ); + +PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock, + zend_string **textaddr, + struct sockaddr **addr, + socklen_t *addrlen, + struct timeval *timeout, + zend_string **error_string, + int *error_code, + int tcp_nodelay + ); + +PHPAPI int php_network_get_sock_name(php_socket_t sock, + zend_string **textaddr, + struct sockaddr **addr, + socklen_t *addrlen + ); + +PHPAPI int php_network_get_peer_name(php_socket_t sock, + zend_string **textaddr, + struct sockaddr **addr, + socklen_t *addrlen + ); + +PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short port); +PHPAPI int php_sockaddr_size(php_sockaddr_storage *addr); +END_EXTERN_C() + +struct _php_netstream_data_t { + php_socket_t socket; + char is_blocked; + struct timeval timeout; + char timeout_event; + size_t ownsize; +}; +typedef struct _php_netstream_data_t php_netstream_data_t; +PHPAPI extern const php_stream_ops php_stream_socket_ops; +extern const php_stream_ops php_stream_generic_socket_ops; +#define PHP_STREAM_IS_SOCKET (&php_stream_socket_ops) + +BEGIN_EXTERN_C() +PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC ); +/* open a connection to a host using php_hostconnect and return a stream */ +PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short port, + int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC); +PHPAPI void php_network_populate_name_from_sockaddr( + /* input address */ + struct sockaddr *sa, socklen_t sl, + /* output readable address */ + zend_string **textaddr, + /* output address */ + struct sockaddr **addr, + socklen_t *addrlen + ); + +PHPAPI int php_network_parse_network_address_with_port(const char *addr, + zend_long addrlen, struct sockaddr *sa, socklen_t *sl); + +PHPAPI struct hostent* php_network_gethostbyname(const char *name); + +PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block); +END_EXTERN_C() + +#define php_stream_sock_open_from_socket(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_CC) +#define php_stream_sock_open_host(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_CC) + +/* {{{ memory debug */ +#define php_stream_sock_open_from_socket_rel(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_REL_CC) +#define php_stream_sock_open_host_rel(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_REL_CC) +#define php_stream_sock_open_unix_rel(path, pathlen, persistent, timeval) _php_stream_sock_open_unix((path), (pathlen), (persistent), (timeval) STREAMS_REL_CC) + +/* }}} */ + +#ifndef MAXFQDNLEN +#define MAXFQDNLEN 255 +#endif + +#endif /* _PHP_NETWORK_H */ diff --git a/include/php/main/php_odbc_utils.h b/include/php/main/php_odbc_utils.h new file mode 100644 index 0000000..183957d --- /dev/null +++ b/include/php/main/php_odbc_utils.h @@ -0,0 +1,22 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Calvin Buckley | + +----------------------------------------------------------------------+ +*/ + +#include "php.h" + +PHPAPI bool php_odbc_connstr_is_quoted(const char *str); +PHPAPI bool php_odbc_connstr_should_quote(const char *str); +PHPAPI size_t php_odbc_connstr_estimate_quote_length(const char *in_str); +PHPAPI size_t php_odbc_connstr_quote(char *out_str, const char *in_str, size_t out_str_size); diff --git a/include/php/main/php_open_temporary_file.h b/include/php/main/php_open_temporary_file.h new file mode 100644 index 0000000..1d8764a --- /dev/null +++ b/include/php/main/php_open_temporary_file.h @@ -0,0 +1,38 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_OPEN_TEMPORARY_FILE_H +#define PHP_OPEN_TEMPORARY_FILE_H + +#define PHP_TMP_FILE_DEFAULT 0 +#define PHP_TMP_FILE_OPEN_BASEDIR_CHECK_ON_FALLBACK (1<<0) +#define PHP_TMP_FILE_SILENT (1<<1) +#define PHP_TMP_FILE_OPEN_BASEDIR_CHECK_ON_EXPLICIT_DIR (1<<2) +#define PHP_TMP_FILE_OPEN_BASEDIR_CHECK_ALWAYS \ + (PHP_TMP_FILE_OPEN_BASEDIR_CHECK_ON_FALLBACK | PHP_TMP_FILE_OPEN_BASEDIR_CHECK_ON_EXPLICIT_DIR) + +/* for compatibility purpose */ +#define PHP_TMP_FILE_OPEN_BASEDIR_CHECK PHP_TMP_FILE_OPEN_BASEDIR_CHECK_ON_FALLBACK + + +BEGIN_EXTERN_C() +PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, zend_string **opened_path_p); +PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, zend_string **opened_path_p, uint32_t flags); +PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, zend_string **opened_path_p); +PHPAPI const char *php_get_temporary_directory(void); +END_EXTERN_C() + +#endif /* PHP_OPEN_TEMPORARY_FILE_H */ diff --git a/include/php/main/php_output.h b/include/php/main/php_output.h new file mode 100644 index 0000000..852aab7 --- /dev/null +++ b/include/php/main/php_output.h @@ -0,0 +1,242 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Wallner | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_OUTPUT_H +#define PHP_OUTPUT_H + +#define PHP_OUTPUT_NEWAPI 1 + +/* handler ops */ +#define PHP_OUTPUT_HANDLER_WRITE 0x00 /* standard passthru */ +#define PHP_OUTPUT_HANDLER_START 0x01 /* start */ +#define PHP_OUTPUT_HANDLER_CLEAN 0x02 /* restart */ +#define PHP_OUTPUT_HANDLER_FLUSH 0x04 /* pass along as much as possible */ +#define PHP_OUTPUT_HANDLER_FINAL 0x08 /* finalize */ +#define PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_WRITE +#define PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_FINAL + +/* handler types */ +#define PHP_OUTPUT_HANDLER_INTERNAL 0x0000 +#define PHP_OUTPUT_HANDLER_USER 0x0001 + +/* handler ability flags */ +#define PHP_OUTPUT_HANDLER_CLEANABLE 0x0010 +#define PHP_OUTPUT_HANDLER_FLUSHABLE 0x0020 +#define PHP_OUTPUT_HANDLER_REMOVABLE 0x0040 +#define PHP_OUTPUT_HANDLER_STDFLAGS 0x0070 + +/* handler status flags */ +#define PHP_OUTPUT_HANDLER_STARTED 0x1000 +#define PHP_OUTPUT_HANDLER_DISABLED 0x2000 +#define PHP_OUTPUT_HANDLER_PROCESSED 0x4000 + +/* handler op return values */ +typedef enum _php_output_handler_status_t { + PHP_OUTPUT_HANDLER_FAILURE, + PHP_OUTPUT_HANDLER_SUCCESS, + PHP_OUTPUT_HANDLER_NO_DATA +} php_output_handler_status_t; + +/* php_output_stack_pop() flags */ +#define PHP_OUTPUT_POP_TRY 0x000 +#define PHP_OUTPUT_POP_FORCE 0x001 +#define PHP_OUTPUT_POP_DISCARD 0x010 +#define PHP_OUTPUT_POP_SILENT 0x100 + +/* real global flags */ +#define PHP_OUTPUT_IMPLICITFLUSH 0x01 +#define PHP_OUTPUT_DISABLED 0x02 +#define PHP_OUTPUT_WRITTEN 0x04 +#define PHP_OUTPUT_SENT 0x08 +/* supplementary flags for php_output_get_status() */ +#define PHP_OUTPUT_ACTIVE 0x10 +#define PHP_OUTPUT_LOCKED 0x20 +/* output layer is ready to use */ +#define PHP_OUTPUT_ACTIVATED 0x100000 + +/* handler hooks */ +typedef enum _php_output_handler_hook_t { + PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, + PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, + PHP_OUTPUT_HANDLER_HOOK_GET_LEVEL, + PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, + PHP_OUTPUT_HANDLER_HOOK_DISABLE, + /* unused */ + PHP_OUTPUT_HANDLER_HOOK_LAST +} php_output_handler_hook_t; + +#define PHP_OUTPUT_HANDLER_INITBUF_SIZE(s) \ +( ((s) > 1) ? \ + (s) + PHP_OUTPUT_HANDLER_ALIGNTO_SIZE - ((s) % (PHP_OUTPUT_HANDLER_ALIGNTO_SIZE)) : \ + PHP_OUTPUT_HANDLER_DEFAULT_SIZE \ +) +#define PHP_OUTPUT_HANDLER_ALIGNTO_SIZE 0x1000 +#define PHP_OUTPUT_HANDLER_DEFAULT_SIZE 0x4000 + +typedef struct _php_output_buffer { + char *data; + size_t size; + size_t used; + uint32_t free:1; + uint32_t _reserved:31; +} php_output_buffer; + +typedef struct _php_output_context { + int op; + php_output_buffer in; + php_output_buffer out; +} php_output_context; + +/* old-style, stateless callback */ +typedef void (*php_output_handler_func_t)(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode); +/* new-style, opaque context callback */ +typedef int (*php_output_handler_context_func_t)(void **handler_context, php_output_context *output_context); +/* output handler context dtor */ +typedef void (*php_output_handler_context_dtor_t)(void *opaq); +/* conflict check callback */ +typedef int (*php_output_handler_conflict_check_t)(const char *handler_name, size_t handler_name_len); +/* ctor for aliases */ +typedef struct _php_output_handler *(*php_output_handler_alias_ctor_t)(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags); + +typedef struct _php_output_handler_user_func_t { + zend_fcall_info fci; + zend_fcall_info_cache fcc; + zval zoh; +} php_output_handler_user_func_t; + +typedef struct _php_output_handler { + zend_string *name; + int flags; + int level; + size_t size; + php_output_buffer buffer; + + void *opaq; + void (*dtor)(void *opaq); + + union { + php_output_handler_user_func_t *user; + php_output_handler_context_func_t internal; + } func; +} php_output_handler; + +ZEND_BEGIN_MODULE_GLOBALS(output) + zend_stack handlers; + php_output_handler *active; + php_output_handler *running; + zend_string *output_start_filename; + int output_start_lineno; + int flags; +ZEND_END_MODULE_GLOBALS(output) + +PHPAPI ZEND_EXTERN_MODULE_GLOBALS(output) + +/* there should not be a need to use OG() from outside of output.c */ +#ifdef ZTS +# define OG(v) ZEND_TSRMG(output_globals_id, zend_output_globals *, v) +#else +# define OG(v) (output_globals.v) +#endif + +/* convenience macros */ +#define PHPWRITE(str, str_len) php_output_write((str), (str_len)) +#define PHPWRITE_H(str, str_len) php_output_write_unbuffered((str), (str_len)) + +#define PUTC(c) php_output_write((const char *) &(c), 1) +#define PUTC_H(c) php_output_write_unbuffered((const char *) &(c), 1) + +#define PUTS(str) do { \ + const char *__str = (str); \ + php_output_write(__str, strlen(__str)); \ +} while (0) +#define PUTS_H(str) do { \ + const char *__str = (str); \ + php_output_write_unbuffered(__str, strlen(__str)); \ +} while (0) + + +BEGIN_EXTERN_C() + +extern const char php_output_default_handler_name[sizeof("default output handler")]; +extern const char php_output_devnull_handler_name[sizeof("null output handler")]; + +#define php_output_tearup() \ + php_output_startup(); \ + php_output_activate() +#define php_output_teardown() \ + php_output_end_all(); \ + php_output_deactivate(); \ + php_output_shutdown() + +/* MINIT */ +PHPAPI void php_output_startup(void); +/* MSHUTDOWN */ +PHPAPI void php_output_shutdown(void); + +/* RINIT */ +PHPAPI int php_output_activate(void); +/* RSHUTDOWN */ +PHPAPI void php_output_deactivate(void); + +PHPAPI void php_output_set_status(int status); +PHPAPI int php_output_get_status(void); +PHPAPI void php_output_set_implicit_flush(int flush); +PHPAPI const char *php_output_get_start_filename(void); +PHPAPI int php_output_get_start_lineno(void); + +PHPAPI size_t php_output_write_unbuffered(const char *str, size_t len); +PHPAPI size_t php_output_write(const char *str, size_t len); + +PHPAPI int php_output_flush(void); +PHPAPI void php_output_flush_all(void); +PHPAPI int php_output_clean(void); +PHPAPI void php_output_clean_all(void); +PHPAPI int php_output_end(void); +PHPAPI void php_output_end_all(void); +PHPAPI int php_output_discard(void); +PHPAPI void php_output_discard_all(void); + +PHPAPI int php_output_get_contents(zval *p); +PHPAPI int php_output_get_length(zval *p); +PHPAPI int php_output_get_level(void); +PHPAPI php_output_handler* php_output_get_active_handler(void); + +PHPAPI int php_output_start_default(void); +PHPAPI int php_output_start_devnull(void); + +PHPAPI int php_output_start_user(zval *output_handler, size_t chunk_size, int flags); +PHPAPI int php_output_start_internal(const char *name, size_t name_len, php_output_handler_func_t output_handler, size_t chunk_size, int flags); + +PHPAPI php_output_handler *php_output_handler_create_user(zval *handler, size_t chunk_size, int flags); +PHPAPI php_output_handler *php_output_handler_create_internal(const char *name, size_t name_len, php_output_handler_context_func_t handler, size_t chunk_size, int flags); + +PHPAPI void php_output_handler_set_context(php_output_handler *handler, void *opaq, void (*dtor)(void*)); +PHPAPI int php_output_handler_start(php_output_handler *handler); +PHPAPI int php_output_handler_started(const char *name, size_t name_len); +PHPAPI int php_output_handler_hook(php_output_handler_hook_t type, void *arg); +PHPAPI void php_output_handler_dtor(php_output_handler *handler); +PHPAPI void php_output_handler_free(php_output_handler **handler); + +PHPAPI int php_output_handler_conflict(const char *handler_new, size_t handler_new_len, const char *handler_set, size_t handler_set_len); +PHPAPI int php_output_handler_conflict_register(const char *handler_name, size_t handler_name_len, php_output_handler_conflict_check_t check_func); +PHPAPI int php_output_handler_reverse_conflict_register(const char *handler_name, size_t handler_name_len, php_output_handler_conflict_check_t check_func); + +PHPAPI php_output_handler_alias_ctor_t php_output_handler_alias(const char *handler_name, size_t handler_name_len); +PHPAPI int php_output_handler_alias_register(const char *handler_name, size_t handler_name_len, php_output_handler_alias_ctor_t func); + +END_EXTERN_C() + +#endif diff --git a/include/php/main/php_reentrancy.h b/include/php/main/php_reentrancy.h new file mode 100644 index 0000000..5a78df0 --- /dev/null +++ b/include/php/main/php_reentrancy.h @@ -0,0 +1,116 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sascha Schumann | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_REENTRANCY_H +#define PHP_REENTRANCY_H + +#include "php.h" + +#include +#ifdef HAVE_DIRENT_H +#include +#endif +#include + +/* currently, PHP does not check for these functions, but assumes + that they are available on all systems. */ + +#define HAVE_LOCALTIME 1 +#define HAVE_GMTIME 1 +#define HAVE_ASCTIME 1 +#define HAVE_CTIME 1 + +#if defined(PHP_IRIX_TIME_R) +#undef HAVE_ASCTIME_R +#undef HAVE_CTIME_R +#endif + +#if defined(PHP_HPUX_TIME_R) +#undef HAVE_LOCALTIME_R +#undef HAVE_ASCTIME_R +#undef HAVE_CTIME_R +#undef HAVE_GMTIME_R +#endif + +BEGIN_EXTERN_C() + +#if !defined(HAVE_LOCALTIME_R) && defined(HAVE_LOCALTIME) +#define PHP_NEED_REENTRANCY 1 +PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm); +#else +#define php_localtime_r localtime_r +#ifdef MISSING_LOCALTIME_R_DECL +struct tm *localtime_r(const time_t *const timep, struct tm *p_tm); +#endif +#endif + + +#if !defined(HAVE_CTIME_R) && defined(HAVE_CTIME) +#define PHP_NEED_REENTRANCY 1 +PHPAPI char *php_ctime_r(const time_t *clock, char *buf); +#else +#define php_ctime_r ctime_r +#ifdef MISSING_CTIME_R_DECL +char *ctime_r(const time_t *clock, char *buf); +#endif +#endif + + +#if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME) +#define PHP_NEED_REENTRANCY 1 +PHPAPI char *php_asctime_r(const struct tm *tm, char *buf); +#else +#define php_asctime_r asctime_r +#ifdef MISSING_ASCTIME_R_DECL +char *asctime_r(const struct tm *tm, char *buf); +#endif +#endif + + +#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) +#define PHP_NEED_REENTRANCY 1 +PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm); +#else +#define php_gmtime_r gmtime_r +#ifdef MISSING_GMTIME_R_DECL +struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm); +#endif +#endif + +#if !defined(HAVE_STRTOK_R) +PHPAPI char *php_strtok_r(char *s, const char *delim, char **last); +#else +#define php_strtok_r strtok_r +#ifdef MISSING_STRTOK_R_DECL +char *strtok_r(char *s, const char *delim, char **last); +#endif +#endif + +END_EXTERN_C() + +#if !defined(ZTS) +#undef PHP_NEED_REENTRANCY +#endif + +#if defined(PHP_NEED_REENTRANCY) +void reentrancy_startup(void); +void reentrancy_shutdown(void); +#else +#define reentrancy_startup() +#define reentrancy_shutdown() +#endif + +#endif diff --git a/include/php/main/php_scandir.h b/include/php/main/php_scandir.h new file mode 100644 index 0000000..ec55659 --- /dev/null +++ b/include/php/main/php_scandir.h @@ -0,0 +1,46 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Shane Caraveo | + | Ilia Alshanetsky | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_SCANDIR_H +#define PHP_SCANDIR_H + +#include + +#ifdef PHP_WIN32 +#include "config.w32.h" +#include "win32/readdir.h" +#else +#include +#endif + +#ifdef HAVE_DIRENT_H +#include +#endif + +#ifdef HAVE_SCANDIR +#define php_scandir scandir +#else +PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*selector) (const struct dirent *entry), int (*compare) (const struct dirent **a, const struct dirent **b)); +#endif + +#ifdef HAVE_ALPHASORT +#define php_alphasort alphasort +#else +PHPAPI int php_alphasort(const struct dirent **a, const struct dirent **b); +#endif + +#endif /* PHP_SCANDIR_H */ diff --git a/include/php/main/php_streams.h b/include/php/main/php_streams.h new file mode 100644 index 0000000..31b80de --- /dev/null +++ b/include/php/main/php_streams.h @@ -0,0 +1,653 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong (wez@thebrainroom.com) | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_STREAMS_H +#define PHP_STREAMS_H + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +#include +#include "zend.h" +#include "zend_stream.h" + +BEGIN_EXTERN_C() +PHPAPI int php_file_le_stream(void); +PHPAPI int php_file_le_pstream(void); +PHPAPI int php_file_le_stream_filter(void); +END_EXTERN_C() + +/* {{{ Streams memory debugging stuff */ + +#if ZEND_DEBUG +/* these have more of a dependency on the definitions of the zend macros than + * I would prefer, but doing it this way saves loads of idefs :-/ */ +# define STREAMS_D int __php_stream_call_depth ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC +# define STREAMS_C 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC +# define STREAMS_REL_C __php_stream_call_depth + 1 ZEND_FILE_LINE_CC, \ + __php_stream_call_depth ? __zend_orig_filename : __zend_filename, \ + __php_stream_call_depth ? __zend_orig_lineno : __zend_lineno + +# define STREAMS_DC , STREAMS_D +# define STREAMS_CC , STREAMS_C +# define STREAMS_REL_CC , STREAMS_REL_C + +#else +# define STREAMS_D +# define STREAMS_C +# define STREAMS_REL_C +# define STREAMS_DC +# define STREAMS_CC +# define STREAMS_REL_CC +#endif + +/* these functions relay the file/line number information. They are depth aware, so they will pass + * the ultimate ancestor, which is useful, because there can be several layers of calls */ +#define php_stream_alloc_rel(ops, thisptr, persistent, mode) _php_stream_alloc((ops), (thisptr), (persistent), (mode) STREAMS_REL_CC) + +#define php_stream_copy_to_mem_rel(src, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_REL_CC) + +#define php_stream_fopen_rel(filename, mode, opened, options) _php_stream_fopen((filename), (mode), (opened), (options) STREAMS_REL_CC) + +#define php_stream_fopen_with_path_rel(filename, mode, path, opened, options) _php_stream_fopen_with_path((filename), (mode), (path), (opened), (options) STREAMS_REL_CC) + +#define php_stream_fopen_from_fd_rel(fd, mode, persistent_id, zero_position) _php_stream_fopen_from_fd((fd), (mode), (persistent_id), (zero_position) STREAMS_REL_CC) +#define php_stream_fopen_from_file_rel(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_REL_CC) + +#define php_stream_fopen_from_pipe_rel(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_REL_CC) + +#define php_stream_fopen_tmpfile_rel() _php_stream_fopen_tmpfile(0 STREAMS_REL_CC) + +#define php_stream_fopen_temporary_file_rel(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_REL_CC) + +#define php_stream_open_wrapper_rel(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_REL_CC) +#define php_stream_open_wrapper_ex_rel(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_REL_CC) + +#define php_stream_make_seekable_rel(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_REL_CC) + +/* }}} */ + +/* The contents of the php_stream_ops and php_stream should only be accessed + * using the functions/macros in this header. + * If you need to get at something that doesn't have an API, + * drop me a line and we can sort out a way to do + * it properly. + * + * The only exceptions to this rule are that stream implementations can use + * the php_stream->abstract pointer to hold their context, and streams + * opened via stream_open_wrappers can use the zval ptr in + * php_stream->wrapperdata to hold metadata for php scripts to + * retrieve using file_get_wrapper_data(). */ + +typedef struct _php_stream php_stream; +typedef struct _php_stream_wrapper php_stream_wrapper; +typedef struct _php_stream_context php_stream_context; +typedef struct _php_stream_filter php_stream_filter; + +#include "streams/php_stream_context.h" +#include "streams/php_stream_filter_api.h" + +typedef struct _php_stream_statbuf { + zend_stat_t sb; /* regular info */ + /* extended info to go here some day: content-type etc. etc. */ +} php_stream_statbuf; + +typedef struct _php_stream_dirent { +#ifdef NAME_MAX + char d_name[NAME_MAX + 1]; +#else + char d_name[MAXPATHLEN]; +#endif + unsigned char d_type; +} php_stream_dirent; + +/* operations on streams that are file-handles */ +typedef struct _php_stream_ops { + /* stdio like functions - these are mandatory! */ + ssize_t (*write)(php_stream *stream, const char *buf, size_t count); + ssize_t (*read)(php_stream *stream, char *buf, size_t count); + int (*close)(php_stream *stream, int close_handle); + int (*flush)(php_stream *stream); + + const char *label; /* label for this ops structure */ + + /* these are optional */ + int (*seek)(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset); + int (*cast)(php_stream *stream, int castas, void **ret); + int (*stat)(php_stream *stream, php_stream_statbuf *ssb); + int (*set_option)(php_stream *stream, int option, int value, void *ptrparam); +} php_stream_ops; + +typedef struct _php_stream_wrapper_ops { + /* open/create a wrapped stream */ + php_stream *(*stream_opener)(php_stream_wrapper *wrapper, const char *filename, const char *mode, + int options, zend_string **opened_path, php_stream_context *context STREAMS_DC); + /* close/destroy a wrapped stream */ + int (*stream_closer)(php_stream_wrapper *wrapper, php_stream *stream); + /* stat a wrapped stream */ + int (*stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb); + /* stat a URL */ + int (*url_stat)(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context); + /* open a "directory" stream */ + php_stream *(*dir_opener)(php_stream_wrapper *wrapper, const char *filename, const char *mode, + int options, zend_string **opened_path, php_stream_context *context STREAMS_DC); + + const char *label; + + /* delete a file */ + int (*unlink)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context); + + /* rename a file */ + int (*rename)(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context); + + /* Create/Remove directory */ + int (*stream_mkdir)(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context); + int (*stream_rmdir)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context); + /* Metadata handling */ + int (*stream_metadata)(php_stream_wrapper *wrapper, const char *url, int options, void *value, php_stream_context *context); +} php_stream_wrapper_ops; + +struct _php_stream_wrapper { + const php_stream_wrapper_ops *wops; /* operations the wrapper can perform */ + void *abstract; /* context for the wrapper */ + int is_url; /* so that PG(allow_url_fopen) can be respected */ +}; + +#define PHP_STREAM_FLAG_NO_SEEK 0x1 +#define PHP_STREAM_FLAG_NO_BUFFER 0x2 + +#define PHP_STREAM_FLAG_EOL_UNIX 0x0 /* also includes DOS */ +#define PHP_STREAM_FLAG_DETECT_EOL 0x4 +#define PHP_STREAM_FLAG_EOL_MAC 0x8 + +/* set this when the stream might represent "interactive" data. + * When set, the read buffer will avoid certain operations that + * might otherwise cause the read to block for much longer than + * is strictly required. */ +#define PHP_STREAM_FLAG_AVOID_BLOCKING 0x10 + +#define PHP_STREAM_FLAG_NO_CLOSE 0x20 + +#define PHP_STREAM_FLAG_IS_DIR 0x40 + +#define PHP_STREAM_FLAG_NO_FCLOSE 0x80 + +/* Suppress generation of PHP warnings on stream read/write errors. + * Currently, for internal use only. */ +#define PHP_STREAM_FLAG_SUPPRESS_ERRORS 0x100 + +/* Do not close handle except it is explicitly closed by user (e.g. fclose) */ +#define PHP_STREAM_FLAG_NO_RSCR_DTOR_CLOSE 0x200 + +#define PHP_STREAM_FLAG_NO_IO 0x400 + +#define PHP_STREAM_FLAG_WAS_WRITTEN 0x80000000 + +struct _php_stream { + const php_stream_ops *ops; + void *abstract; /* convenience pointer for abstraction */ + + php_stream_filter_chain readfilters, writefilters; + + php_stream_wrapper *wrapper; /* which wrapper was used to open the stream */ + void *wrapperthis; /* convenience pointer for an instance of a wrapper */ + zval wrapperdata; /* fgetwrapperdata retrieves this */ + + uint16_t is_persistent:1; + uint16_t in_free:2; /* to prevent recursion during free */ + uint16_t eof:1; + uint16_t __exposed:1; /* non-zero if exposed as a zval somewhere */ + + /* so we know how to clean it up correctly. This should be set to + * PHP_STREAM_FCLOSE_XXX as appropriate */ + uint16_t fclose_stdiocast:2; + + + /* flag to mark whether the stream has buffered data */ + uint16_t has_buffered_data:1; + + /* whether stdio cast flushing is in progress */ + uint16_t fclose_stdiocast_flush_in_progress:1; + + char mode[16]; /* "rwb" etc. ala stdio */ + + uint32_t flags; /* PHP_STREAM_FLAG_XXX */ + + zend_resource *res; /* used for auto-cleanup */ + FILE *stdiocast; /* cache this, otherwise we might leak! */ + char *orig_path; + + zend_resource *ctx; + + /* buffer */ + zend_off_t position; /* of underlying stream */ + unsigned char *readbuf; + size_t readbuflen; + zend_off_t readpos; + zend_off_t writepos; + + /* how much data to read when filling buffer */ + size_t chunk_size; + +#if ZEND_DEBUG + const char *open_filename; + uint32_t open_lineno; +#endif + + struct _php_stream *enclosing_stream; /* this is a private stream owned by enclosing_stream */ +}; /* php_stream */ + +#define PHP_STREAM_CONTEXT(stream) \ + ((php_stream_context*) ((stream)->ctx ? ((stream)->ctx->ptr) : NULL)) + +/* state definitions when closing down; these are private to streams.c */ +#define PHP_STREAM_FCLOSE_NONE 0 +#define PHP_STREAM_FCLOSE_FDOPEN 1 +#define PHP_STREAM_FCLOSE_FOPENCOOKIE 2 + +/* allocate a new stream for a particular ops */ +BEGIN_EXTERN_C() +PHPAPI php_stream *_php_stream_alloc(const php_stream_ops *ops, void *abstract, + const char *persistent_id, const char *mode STREAMS_DC); +END_EXTERN_C() +#define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC) + +#define php_stream_get_resource_id(stream) ((php_stream *)(stream))->res->handle +/* use this to tell the stream that it is OK if we don't explicitly close it */ +#define php_stream_auto_cleanup(stream) { (stream)->__exposed = 1; } +/* use this to assign the stream to a zval and tell the stream that is + * has been exported to the engine; it will expect to be closed automatically + * when the resources are auto-destructed */ +#define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); (stream)->__exposed = 1; } + +#define php_stream_from_zval(xstr, pzval) do { \ + if (((xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), \ + "stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { \ + return; \ + } \ +} while (0) +#define php_stream_from_res(xstr, res) do { \ + if (((xstr) = (php_stream*)zend_fetch_resource2((res), \ + "stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { \ + return; \ + } \ +} while (0) +#define php_stream_from_res_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource2((res), "stream", php_file_le_stream(), php_file_le_pstream()) +#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), "stream", php_file_le_stream(), php_file_le_pstream()) + +BEGIN_EXTERN_C() +PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed); +#define php_stream_free_enclosed(stream_enclosed, close_options) _php_stream_free_enclosed((stream_enclosed), (close_options)) +PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options); + +PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream); +#define PHP_STREAM_PERSISTENT_SUCCESS 0 /* id exists */ +#define PHP_STREAM_PERSISTENT_FAILURE 1 /* id exists but is not a stream! */ +#define PHP_STREAM_PERSISTENT_NOT_EXIST 2 /* id does not exist */ + +#define PHP_STREAM_FREE_CALL_DTOR 1 /* call ops->close */ +#define PHP_STREAM_FREE_RELEASE_STREAM 2 /* pefree(stream) */ +#define PHP_STREAM_FREE_PRESERVE_HANDLE 4 /* tell ops->close to not close its underlying handle */ +#define PHP_STREAM_FREE_RSRC_DTOR 8 /* called from the resource list dtor */ +#define PHP_STREAM_FREE_PERSISTENT 16 /* manually freeing a persistent connection */ +#define PHP_STREAM_FREE_IGNORE_ENCLOSING 32 /* don't close the enclosing stream instead */ +#define PHP_STREAM_FREE_KEEP_RSRC 64 /* keep associated zend_resource */ +#define PHP_STREAM_FREE_CLOSE (PHP_STREAM_FREE_CALL_DTOR | PHP_STREAM_FREE_RELEASE_STREAM) +#define PHP_STREAM_FREE_CLOSE_CASTED (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PRESERVE_HANDLE) +#define PHP_STREAM_FREE_CLOSE_PERSISTENT (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PERSISTENT) + +PHPAPI int _php_stream_free(php_stream *stream, int close_options); +#define php_stream_free(stream, close_options) _php_stream_free((stream), (close_options)) +#define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE) +#define php_stream_pclose(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE_PERSISTENT) + +PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence); +#define php_stream_rewind(stream) _php_stream_seek((stream), 0L, SEEK_SET) +#define php_stream_seek(stream, offset, whence) _php_stream_seek((stream), (offset), (whence)) + +PHPAPI zend_off_t _php_stream_tell(php_stream *stream); +#define php_stream_tell(stream) _php_stream_tell((stream)) + +PHPAPI ssize_t _php_stream_read(php_stream *stream, char *buf, size_t count); +#define php_stream_read(stream, buf, count) _php_stream_read((stream), (buf), (count)) + +PHPAPI zend_string *php_stream_read_to_str(php_stream *stream, size_t len); + +PHPAPI ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count); +#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str)) +#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count)) + +PHPAPI zend_result _php_stream_fill_read_buffer(php_stream *stream, size_t size); +#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size)) + +PHPAPI ssize_t _php_stream_printf(php_stream *stream, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); + +/* php_stream_printf macro & function require */ +#define php_stream_printf _php_stream_printf + +PHPAPI bool _php_stream_eof(php_stream *stream); +#define php_stream_eof(stream) _php_stream_eof((stream)) + +PHPAPI int _php_stream_getc(php_stream *stream); +#define php_stream_getc(stream) _php_stream_getc((stream)) + +PHPAPI int _php_stream_putc(php_stream *stream, int c); +#define php_stream_putc(stream, c) _php_stream_putc((stream), (c)) + +PHPAPI int _php_stream_flush(php_stream *stream, int closing); +#define php_stream_flush(stream) _php_stream_flush((stream), 0) + +PHPAPI int _php_stream_sync(php_stream *stream, bool data_only); +#define php_stream_sync(stream, d) _php_stream_sync((stream), (d)) + +PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len); +#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL) + +#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen)) +PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len); + +/* Returns true if buffer has been appended, false on error */ +PHPAPI bool _php_stream_puts(php_stream *stream, const char *buf); +#define php_stream_puts(stream, buf) _php_stream_puts((stream), (buf)) + +PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb); +#define php_stream_stat(stream, ssb) _php_stream_stat((stream), (ssb)) + +PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context); +#define php_stream_stat_path(path, ssb) _php_stream_stat_path((path), 0, (ssb), NULL) +#define php_stream_stat_path_ex(path, flags, ssb, context) _php_stream_stat_path((path), (flags), (ssb), (context)) + +PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context); +#define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, options, context) + +PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context); +#define php_stream_rmdir(path, options, context) _php_stream_rmdir(path, options, context) + +PHPAPI php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context STREAMS_DC); +#define php_stream_opendir(path, options, context) _php_stream_opendir((path), (options), (context) STREAMS_CC) +PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent); +#define php_stream_readdir(dirstream, dirent) _php_stream_readdir((dirstream), (dirent)) +#define php_stream_closedir(dirstream) php_stream_close((dirstream)) +#define php_stream_rewinddir(dirstream) php_stream_rewind((dirstream)) + +PHPAPI int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b); +PHPAPI int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b); + +PHPAPI int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, + int (*compare) (const zend_string **a, const zend_string **b)); +#define php_stream_scandir(dirname, namelist, context, compare) _php_stream_scandir((dirname), (namelist), 0, (context), (compare)) + +PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam); +#define php_stream_set_option(stream, option, value, ptrvalue) _php_stream_set_option((stream), (option), (value), (ptrvalue)) + +#define php_stream_set_chunk_size(stream, size) _php_stream_set_option((stream), PHP_STREAM_OPTION_SET_CHUNK_SIZE, (size), NULL) + +END_EXTERN_C() + + +/* Flags for mkdir method in wrapper ops */ +#define PHP_STREAM_MKDIR_RECURSIVE 1 +/* define REPORT ERRORS 8 (below) */ + +/* Flags for rmdir method in wrapper ops */ +/* define REPORT_ERRORS 8 (below) */ + +/* Flags for url_stat method in wrapper ops */ +#define PHP_STREAM_URL_STAT_LINK 1 +#define PHP_STREAM_URL_STAT_QUIET 2 +#define PHP_STREAM_URL_STAT_IGNORE_OPEN_BASEDIR 4 + +/* change the blocking mode of stream: value == 1 => blocking, value == 0 => non-blocking. */ +#define PHP_STREAM_OPTION_BLOCKING 1 + +/* change the buffering mode of stream. value is a PHP_STREAM_BUFFER_XXXX value, ptrparam is a ptr to a size_t holding + * the required buffer size */ +#define PHP_STREAM_OPTION_READ_BUFFER 2 +#define PHP_STREAM_OPTION_WRITE_BUFFER 3 + +#define PHP_STREAM_BUFFER_NONE 0 /* unbuffered */ +#define PHP_STREAM_BUFFER_LINE 1 /* line buffered */ +#define PHP_STREAM_BUFFER_FULL 2 /* fully buffered */ + +/* set the timeout duration for reads on the stream. ptrparam is a pointer to a struct timeval * */ +#define PHP_STREAM_OPTION_READ_TIMEOUT 4 +#define PHP_STREAM_OPTION_SET_CHUNK_SIZE 5 + +/* set or release lock on a stream */ +#define PHP_STREAM_OPTION_LOCKING 6 + +/* whether or not locking is supported */ +#define PHP_STREAM_LOCK_SUPPORTED 1 + +#define php_stream_supports_lock(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, 0, (void *) PHP_STREAM_LOCK_SUPPORTED) == 0 ? 1 : 0) +#define php_stream_lock(stream, mode) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, (mode), (void *) NULL) + +/* option code used by the php_stream_xport_XXX api */ +#define PHP_STREAM_OPTION_XPORT_API 7 /* see php_stream_transport.h */ +#define PHP_STREAM_OPTION_CRYPTO_API 8 /* see php_stream_transport.h */ +#define PHP_STREAM_OPTION_MMAP_API 9 /* see php_stream_mmap.h */ +#define PHP_STREAM_OPTION_TRUNCATE_API 10 + +#define PHP_STREAM_TRUNCATE_SUPPORTED 0 +#define PHP_STREAM_TRUNCATE_SET_SIZE 1 /* ptrparam is a pointer to a size_t */ + +#define php_stream_truncate_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SUPPORTED, NULL) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) + +BEGIN_EXTERN_C() +PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize); +#define php_stream_truncate_set_size(stream, size) _php_stream_truncate_set_size((stream), (size)) +END_EXTERN_C() + +#define PHP_STREAM_OPTION_META_DATA_API 11 /* ptrparam is a zval* to which to add metadata information */ +#define php_stream_populate_meta_data(stream, zv) (_php_stream_set_option((stream), PHP_STREAM_OPTION_META_DATA_API, 0, zv) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) + +/* Check if the stream is still "live"; for sockets/pipes this means the socket + * is still connected; for files, this does not really have meaning */ +#define PHP_STREAM_OPTION_CHECK_LIVENESS 12 /* no parameters */ + +/* Enable/disable blocking reads on anonymous pipes on Windows. */ +#define PHP_STREAM_OPTION_PIPE_BLOCKING 13 + +/* Stream can support fsync operation */ +#define PHP_STREAM_OPTION_SYNC_API 14 +#define PHP_STREAM_SYNC_SUPPORTED 0 +#define PHP_STREAM_SYNC_FSYNC 1 +#define PHP_STREAM_SYNC_FDSYNC 2 + +#define php_stream_sync_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_SYNC_API, PHP_STREAM_SYNC_SUPPORTED, NULL) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) + + +#define PHP_STREAM_OPTION_RETURN_OK 0 /* option set OK */ +#define PHP_STREAM_OPTION_RETURN_ERR -1 /* problem setting option */ +#define PHP_STREAM_OPTION_RETURN_NOTIMPL -2 /* underlying stream does not implement; streams can handle it instead */ + +/* copy up to maxlen bytes from src to dest. If maxlen is PHP_STREAM_COPY_ALL, + * copy until eof(src). */ +#define PHP_STREAM_COPY_ALL ((size_t)-1) + +BEGIN_EXTERN_C() +ZEND_ATTRIBUTE_DEPRECATED +PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC); +#define php_stream_copy_to_stream(src, dest, maxlen) _php_stream_copy_to_stream((src), (dest), (maxlen) STREAMS_CC) +PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC); +#define php_stream_copy_to_stream_ex(src, dest, maxlen, len) _php_stream_copy_to_stream_ex((src), (dest), (maxlen), (len) STREAMS_CC) + + +/* read all data from stream and put into a buffer. Caller must free buffer + * when done. */ +PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC); +#define php_stream_copy_to_mem(src, maxlen, persistent) _php_stream_copy_to_mem((src), (maxlen), (persistent) STREAMS_CC) + +/* output all data from a stream */ +PHPAPI ssize_t _php_stream_passthru(php_stream * src STREAMS_DC); +#define php_stream_passthru(stream) _php_stream_passthru((stream) STREAMS_CC) +END_EXTERN_C() + +#include "streams/php_stream_transport.h" +#include "streams/php_stream_plain_wrapper.h" +#include "streams/php_stream_glob_wrapper.h" +#include "streams/php_stream_userspace.h" +#include "streams/php_stream_mmap.h" + +/* coerce the stream into some other form */ +/* cast as a stdio FILE * */ +#define PHP_STREAM_AS_STDIO 0 +/* cast as a POSIX fd or socketd */ +#define PHP_STREAM_AS_FD 1 +/* cast as a socketd */ +#define PHP_STREAM_AS_SOCKETD 2 +/* cast as fd/socket for select purposes */ +#define PHP_STREAM_AS_FD_FOR_SELECT 3 + +/* try really, really hard to make sure the cast happens (avoid using this flag if possible) */ +#define PHP_STREAM_CAST_TRY_HARD 0x80000000 +#define PHP_STREAM_CAST_RELEASE 0x40000000 /* stream becomes invalid on success */ +#define PHP_STREAM_CAST_INTERNAL 0x20000000 /* stream cast for internal use */ +#define PHP_STREAM_CAST_MASK (PHP_STREAM_CAST_TRY_HARD | PHP_STREAM_CAST_RELEASE | PHP_STREAM_CAST_INTERNAL) +BEGIN_EXTERN_C() +PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err); +END_EXTERN_C() +/* use this to check if a stream can be cast into another form */ +#define php_stream_can_cast(stream, as) _php_stream_cast((stream), (as), NULL, 0) +#define php_stream_cast(stream, as, ret, show_err) _php_stream_cast((stream), (as), (ret), (show_err)) + +/* use this to check if a stream is of a particular type: + * PHPAPI int php_stream_is(php_stream *stream, php_stream_ops *ops); */ +#define php_stream_is(stream, anops) ((stream)->ops == anops) +#define PHP_STREAM_IS_STDIO &php_stream_stdio_ops + +#define php_stream_is_persistent(stream) (stream)->is_persistent + +/* Wrappers support */ + +#define IGNORE_PATH 0x00000000 +#define USE_PATH 0x00000001 +#define IGNORE_URL 0x00000002 +#define REPORT_ERRORS 0x00000008 + +/* If you don't need to write to the stream, but really need to + * be able to seek, use this flag in your options. */ +#define STREAM_MUST_SEEK 0x00000010 +/* If you are going to end up casting the stream into a FILE* or + * a socket, pass this flag and the streams/wrappers will not use + * buffering mechanisms while reading the headers, so that HTTP + * wrapped streams will work consistently. + * If you omit this flag, streams will use buffering and should end + * up working more optimally. + * */ +#define STREAM_WILL_CAST 0x00000020 + +/* this flag applies to php_stream_locate_url_wrapper */ +#define STREAM_LOCATE_WRAPPERS_ONLY 0x00000040 + +/* this flag is only used by include/require functions */ +#define STREAM_OPEN_FOR_INCLUDE 0x00000080 + +/* this flag tells streams to ONLY open urls */ +#define STREAM_USE_URL 0x00000100 + +/* this flag is used when only the headers from HTTP request are to be fetched */ +#define STREAM_ONLY_GET_HEADERS 0x00000200 + +/* don't apply open_basedir checks */ +#define STREAM_DISABLE_OPEN_BASEDIR 0x00000400 + +/* get (or create) a persistent version of the stream */ +#define STREAM_OPEN_PERSISTENT 0x00000800 + +/* use glob stream for directory open in plain files stream */ +#define STREAM_USE_GLOB_DIR_OPEN 0x00001000 + +/* don't check allow_url_fopen and allow_url_include */ +#define STREAM_DISABLE_URL_PROTECTION 0x00002000 + +/* assume the path passed in exists and is fully expanded, avoiding syscalls */ +#define STREAM_ASSUME_REALPATH 0x00004000 + +/* Allow blocking reads on anonymous pipes on Windows. */ +#define STREAM_USE_BLOCKING_PIPE 0x00008000 + +/* this flag is only used by include/require functions */ +#define STREAM_OPEN_FOR_ZEND_STREAM 0x00010000 + +int php_init_stream_wrappers(int module_number); +void php_shutdown_stream_wrappers(int module_number); +void php_shutdown_stream_hashes(void); +PHP_RSHUTDOWN_FUNCTION(streams); + +BEGIN_EXTERN_C() +PHPAPI zend_result php_register_url_stream_wrapper(const char *protocol, const php_stream_wrapper *wrapper); +PHPAPI zend_result php_unregister_url_stream_wrapper(const char *protocol); +PHPAPI zend_result php_register_url_stream_wrapper_volatile(zend_string *protocol, php_stream_wrapper *wrapper); +PHPAPI zend_result php_unregister_url_stream_wrapper_volatile(zend_string *protocol); +PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC); +PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options); +PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf); + +#define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC) +#define php_stream_open_wrapper_ex(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC) + +/* pushes an error message onto the stack for a wrapper instance */ +PHPAPI void php_stream_wrapper_log_error(const php_stream_wrapper *wrapper, int options, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); + +#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */ +#define PHP_STREAM_RELEASED 1 /* newstream should be used; origstream is no longer valid */ +#define PHP_STREAM_FAILED 2 /* an error occurred while attempting conversion */ +#define PHP_STREAM_CRITICAL 3 /* an error occurred; origstream is in an unknown state; you should close origstream */ +#define PHP_STREAM_NO_PREFERENCE 0 +#define PHP_STREAM_PREFER_STDIO 1 +#define PHP_STREAM_FORCE_CONVERSION 2 +/* DO NOT call this on streams that are referenced by resources! */ +PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC); +#define php_stream_make_seekable(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_CC) + +/* Give other modules access to the url_stream_wrappers_hash and stream_filters_hash */ +PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(void); +#define php_stream_get_url_stream_wrappers_hash() _php_stream_get_url_stream_wrappers_hash() +PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void); +PHPAPI HashTable *_php_get_stream_filters_hash(void); +#define php_get_stream_filters_hash() _php_get_stream_filters_hash() +PHPAPI HashTable *php_get_stream_filters_hash_global(void); +extern const php_stream_wrapper_ops *php_stream_user_wrapper_ops; + +static inline bool php_is_stream_path(const char *filename) +{ + const char *p; + + for (p = filename; + (*p >= 'a' && *p <= 'z') || + (*p >= 'A' && *p <= 'Z') || + (*p >= '0' && *p <= '9') || + *p == '+' || *p == '-' || *p == '.'; + p++); + return ((p != filename) && (p[0] == ':') && (p[1] == '/') && (p[2] == '/')); +} + +END_EXTERN_C() +#endif + +/* Definitions for user streams */ +#define PHP_STREAM_IS_URL 1 + +/* Stream metadata definitions */ +/* Create if referred resource does not exist */ +#define PHP_STREAM_META_TOUCH 1 +#define PHP_STREAM_META_OWNER_NAME 2 +#define PHP_STREAM_META_OWNER 3 +#define PHP_STREAM_META_GROUP_NAME 4 +#define PHP_STREAM_META_GROUP 5 +#define PHP_STREAM_META_ACCESS 6 diff --git a/include/php/main/php_syslog.h b/include/php/main/php_syslog.h new file mode 100644 index 0000000..f2682d7 --- /dev/null +++ b/include/php/main/php_syslog.h @@ -0,0 +1,44 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_SYSLOG_H +#define PHP_SYSLOG_H + +#include "php.h" + +#ifdef PHP_WIN32 +#include "win32/syslog.h" +#else +#include +#ifdef HAVE_SYSLOG_H +#include +#endif +#endif + +/* Syslog filters */ +#define PHP_SYSLOG_FILTER_ALL 0 +#define PHP_SYSLOG_FILTER_NO_CTRL 1 +#define PHP_SYSLOG_FILTER_ASCII 2 +#define PHP_SYSLOG_FILTER_RAW 3 + +BEGIN_EXTERN_C() +PHPAPI void php_syslog_str(int priority, const zend_string* message); +PHPAPI void php_syslog(int, const char *format, ...); +PHPAPI void php_openlog(const char *, int, int); +PHPAPI void php_closelog(void); +END_EXTERN_C() + +#endif diff --git a/include/php/main/php_ticks.h b/include/php/main/php_ticks.h new file mode 100644 index 0000000..270ea53 --- /dev/null +++ b/include/php/main/php_ticks.h @@ -0,0 +1,30 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Stig Bakken | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_TICKS_H +#define PHP_TICKS_H + +int php_startup_ticks(void); +void php_deactivate_ticks(void); +void php_shutdown_ticks(php_core_globals *core_globals); +void php_run_ticks(int count); + +BEGIN_EXTERN_C() +PHPAPI void php_add_tick_function(void (*func)(int, void *), void *arg); +PHPAPI void php_remove_tick_function(void (*func)(int, void *), void * arg); +END_EXTERN_C() + +#endif diff --git a/include/php/main/php_variables.h b/include/php/main/php_variables.h new file mode 100644 index 0000000..52d26aa --- /dev/null +++ b/include/php/main/php_variables.h @@ -0,0 +1,47 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Rasmus Lerdorf | + | Zeev Suraski | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_VARIABLES_H +#define PHP_VARIABLES_H + +#include "php.h" +#include "SAPI.h" + +#define PARSE_POST 0 +#define PARSE_GET 1 +#define PARSE_COOKIE 2 +#define PARSE_STRING 3 +#define PARSE_ENV 4 +#define PARSE_SERVER 5 +#define PARSE_SESSION 6 + +BEGIN_EXTERN_C() +void php_startup_auto_globals(void); +extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr); +PHPAPI void php_register_variable(const char *var, const char *val, zval *track_vars_array); +/* binary-safe version */ +PHPAPI void php_register_variable_safe(const char *var, const char *val, size_t val_len, zval *track_vars_array); +PHPAPI void php_register_variable_ex(const char *var, zval *val, zval *track_vars_array); +PHPAPI void php_register_known_variable(const char *var, size_t var_len, zval *value, zval *track_vars_array); + +PHPAPI void php_build_argv(const char *s, zval *track_vars_array); +PHPAPI int php_hash_environment(void); +END_EXTERN_C() + +#define NUM_TRACK_VARS 6 + +#endif /* PHP_VARIABLES_H */ diff --git a/include/php/main/php_version.h b/include/php/main/php_version.h new file mode 100644 index 0000000..841fe15 --- /dev/null +++ b/include/php/main/php_version.h @@ -0,0 +1,8 @@ +/* automatically generated by configure */ +/* edit configure.ac to change version number */ +#define PHP_MAJOR_VERSION 8 +#define PHP_MINOR_VERSION 3 +#define PHP_RELEASE_VERSION 3 +#define PHP_EXTRA_VERSION "-dev" +#define PHP_VERSION "8.3.3-dev" +#define PHP_VERSION_ID 80303 diff --git a/include/php/main/rfc1867.h b/include/php/main/rfc1867.h new file mode 100644 index 0000000..bb690f1 --- /dev/null +++ b/include/php/main/rfc1867.h @@ -0,0 +1,96 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: | + +----------------------------------------------------------------------+ +*/ + +#ifndef RFC1867_H +#define RFC1867_H + +#include "SAPI.h" + +#define MULTIPART_CONTENT_TYPE "multipart/form-data" +#define MULTIPART_EVENT_START 0 +#define MULTIPART_EVENT_FORMDATA 1 +#define MULTIPART_EVENT_FILE_START 2 +#define MULTIPART_EVENT_FILE_DATA 3 +#define MULTIPART_EVENT_FILE_END 4 +#define MULTIPART_EVENT_END 5 + +/* Errors */ +#define PHP_UPLOAD_ERROR_OK 0 /* File upload successful */ +#define PHP_UPLOAD_ERROR_A 1 /* Uploaded file exceeded upload_max_filesize */ +#define PHP_UPLOAD_ERROR_B 2 /* Uploaded file exceeded MAX_FILE_SIZE */ +#define PHP_UPLOAD_ERROR_C 3 /* Partially uploaded */ +#define PHP_UPLOAD_ERROR_D 4 /* No file uploaded */ +#define PHP_UPLOAD_ERROR_E 6 /* Missing /tmp or similar directory */ +#define PHP_UPLOAD_ERROR_F 7 /* Failed to write file to disk */ +#define PHP_UPLOAD_ERROR_X 8 /* File upload stopped by extension */ + +typedef struct _multipart_event_start { + size_t content_length; +} multipart_event_start; + +typedef struct _multipart_event_formdata { + size_t post_bytes_processed; + char *name; + char **value; + size_t length; + size_t *newlength; +} multipart_event_formdata; + +typedef struct _multipart_event_file_start { + size_t post_bytes_processed; + char *name; + char **filename; +} multipart_event_file_start; + +typedef struct _multipart_event_file_data { + size_t post_bytes_processed; + zend_off_t offset; + char *data; + size_t length; + size_t *newlength; +} multipart_event_file_data; + +typedef struct _multipart_event_file_end { + size_t post_bytes_processed; + char *temp_filename; + int cancel_upload; +} multipart_event_file_end; + +typedef struct _multipart_event_end { + size_t post_bytes_processed; +} multipart_event_end; + +typedef int (*php_rfc1867_encoding_translation_t)(void); +typedef void (*php_rfc1867_get_detect_order_t)(const zend_encoding ***list, size_t *list_size); +typedef void (*php_rfc1867_set_input_encoding_t)(const zend_encoding *encoding); +typedef char* (*php_rfc1867_getword_t)(const zend_encoding *encoding, char **line, char stop); +typedef char* (*php_rfc1867_getword_conf_t)(const zend_encoding *encoding, char *str); +typedef char* (*php_rfc1867_basename_t)(const zend_encoding *encoding, char *str); + +SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler); + +PHPAPI void destroy_uploaded_files_hash(void); +extern PHPAPI zend_result (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra); + +SAPI_API void php_rfc1867_set_multibyte_callbacks( + php_rfc1867_encoding_translation_t encoding_translation, + php_rfc1867_get_detect_order_t get_detect_order, + php_rfc1867_set_input_encoding_t set_input_encoding, + php_rfc1867_getword_t getword, + php_rfc1867_getword_conf_t getword_conf, + php_rfc1867_basename_t basename); + +#endif /* RFC1867_H */ diff --git a/include/php/main/snprintf.h b/include/php/main/snprintf.h new file mode 100644 index 0000000..2ff7116 --- /dev/null +++ b/include/php/main/snprintf.h @@ -0,0 +1,136 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Stig Sæther Bakken | + | Marcus Boerger | + +----------------------------------------------------------------------+ +*/ + +/* + +Comparing: sprintf, snprintf, slprintf, spprintf + +sprintf offers the ability to make a lot of failures since it does not know + the size of the buffer it uses. Therefore usage of sprintf often + results in possible entries for buffer overrun attacks. So please + use this version only if you are sure the call is safe. sprintf + always terminates the buffer it writes to. + +snprintf knows the buffers size and will not write behind it. But you will + have to use either a static buffer or allocate a dynamic buffer + before being able to call the function. In other words you must + be sure that you really know the maximum size of the buffer required. + A bad thing is having a big maximum while in most cases you would + only need a small buffer. If the size of the resulting string is + longer or equal to the buffer size than the buffer is not terminated. + The function also returns the number of chars not including the + terminating \0 that were needed to fully comply to the print request. + +slprintf same as snprintf with the difference that it actually returns the + length printed not including the terminating \0. + +spprintf is the dynamical version of snprintf. It allocates the buffer in size + as needed and allows a maximum setting as snprintf (turn this feature + off by setting max_len to 0). spprintf is a little bit slower than + snprintf and offers possible memory leaks if you miss freeing the + buffer allocated by the function. Therefore this function should be + used where either no maximum is known or the maximum is much bigger + than normal size required. spprintf always terminates the buffer. + +Example: + + #define MAX 1024 | #define MAX 1024 | #define MAX 1024 + char buffer[MAX] | char buffer[MAX] | char *buffer; + | | + | | // No need to initialize buffer: + | | // spprintf ignores value of buffer + sprintf(buffer, "test"); | snprintf(buffer, MAX, "test"); | spprintf(&buffer, MAX, "text"); + | | if (!buffer) + | | return OUT_OF_MEMORY + // sprintf always terminates | // manual termination of | // spprintf allays terminates buffer + // buffer | // buffer *IS* required | + | buffer[MAX-1] = 0; | + action_with_buffer(buffer); | action_with_buffer(buffer); | action_with_buffer(buffer); + | | efree(buffer); +*/ + +#ifndef SNPRINTF_H +#define SNPRINTF_H + +#include + +BEGIN_EXTERN_C() +PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap); +PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap); +PHPAPI int ap_php_vasprintf(char **buf, const char *format, va_list ap); +PHPAPI int ap_php_asprintf(char **buf, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); +PHPAPI char * php_0cvt(double value, int ndigit, char dec_point, char exponent, char *buf); +PHPAPI char * php_conv_fp(char format, double num, + bool add_dp, int precision, char dec_point, bool * is_negative, char *buf, size_t *len); + +END_EXTERN_C() + +#define php_gcvt zend_gcvt + +#ifdef slprintf +#undef slprintf +#endif +#define slprintf ap_php_slprintf + +#ifdef vslprintf +#undef vslprintf +#endif +#define vslprintf ap_php_vslprintf + +#ifdef snprintf +#undef snprintf +#endif +#define snprintf ap_php_snprintf + +#ifdef vsnprintf +#undef vsnprintf +#endif +#define vsnprintf ap_php_vsnprintf + +#ifndef HAVE_VASPRINTF +#define vasprintf ap_php_vasprintf +#endif + +#ifndef HAVE_ASPRINTF +#define asprintf ap_php_asprintf +#endif + +typedef enum { + LM_STD = 0, +#if SIZEOF_INTMAX_T + LM_INTMAX_T, +#endif +#if SIZEOF_PTRDIFF_T + LM_PTRDIFF_T, +#endif +#if SIZEOF_LONG_LONG + LM_LONG_LONG, +#endif + LM_SIZE_T, + LM_LONG, + LM_LONG_DOUBLE, +} length_modifier_e; + +PHPAPI char * ap_php_conv_10(int64_t num, bool is_unsigned, + bool * is_negative, char *buf_end, size_t *len); + +PHPAPI char * ap_php_conv_p2(uint64_t num, int nbits, + char format, char *buf_end, size_t *len); + +#endif /* SNPRINTF_H */ diff --git a/include/php/main/spprintf.h b/include/php/main/spprintf.h new file mode 100644 index 0000000..4da2248 --- /dev/null +++ b/include/php/main/spprintf.h @@ -0,0 +1,34 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +#ifndef SPPRINTF_H +#define SPPRINTF_H + +#include "snprintf.h" +#include "zend_smart_str_public.h" +#include "zend_smart_string_public.h" + +BEGIN_EXTERN_C() +PHPAPI void php_printf_to_smart_string(smart_string *buf, const char *format, va_list ap); +PHPAPI void php_printf_to_smart_str(smart_str *buf, const char *format, va_list ap); +END_EXTERN_C() + +#define spprintf zend_spprintf +#define strpprintf zend_strpprintf +#define vspprintf zend_vspprintf +#define vstrpprintf zend_vstrpprintf + +#endif /* SPPRINTF_H */ diff --git a/include/php/main/streams/php_stream_context.h b/include/php/main/streams/php_stream_context.h new file mode 100644 index 0000000..d4ebe29 --- /dev/null +++ b/include/php/main/streams/php_stream_context.h @@ -0,0 +1,118 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ + */ + +/* Stream context and status notification related definitions */ + +/* callback for status notifications */ +typedef void (*php_stream_notification_func)(php_stream_context *context, + int notifycode, int severity, + char *xmsg, int xcode, + size_t bytes_sofar, size_t bytes_max, + void * ptr); + +#define PHP_STREAM_NOTIFIER_PROGRESS 1 + +/* Attempt to fetch context from the zval passed, + If no context was passed, use the default context + The default context has not yet been created, do it now. */ +#define php_stream_context_from_zval(zcontext, nocontext) ( \ + (zcontext) ? zend_fetch_resource_ex(zcontext, "Stream-Context", php_le_stream_context()) : \ + (nocontext) ? NULL : \ + FG(default_context) ? FG(default_context) : \ + (FG(default_context) = php_stream_context_alloc()) ) + +#define php_stream_context_to_zval(context, zval) { ZVAL_RES(zval, (context)->res); GC_ADDREF((context)->res); } + +typedef struct _php_stream_notifier php_stream_notifier; + +struct _php_stream_notifier { + php_stream_notification_func func; + void (*dtor)(php_stream_notifier *notifier); + zval ptr; + int mask; + size_t progress, progress_max; /* position for progress notification */ +}; + +struct _php_stream_context { + php_stream_notifier *notifier; + zval options; /* hash keyed by wrapper family or specific wrapper */ + zend_resource *res; /* used for auto-cleanup */ +}; + +BEGIN_EXTERN_C() +PHPAPI void php_stream_context_free(php_stream_context *context); +PHPAPI php_stream_context *php_stream_context_alloc(void); +PHPAPI zval *php_stream_context_get_option(php_stream_context *context, + const char *wrappername, const char *optionname); +PHPAPI void php_stream_context_set_option(php_stream_context *context, + const char *wrappername, const char *optionname, zval *optionvalue); + +PHPAPI php_stream_notifier *php_stream_notification_alloc(void); +PHPAPI void php_stream_notification_free(php_stream_notifier *notifier); +END_EXTERN_C() + +/* not all notification codes are implemented */ +#define PHP_STREAM_NOTIFY_RESOLVE 1 +#define PHP_STREAM_NOTIFY_CONNECT 2 +#define PHP_STREAM_NOTIFY_AUTH_REQUIRED 3 +#define PHP_STREAM_NOTIFY_MIME_TYPE_IS 4 +#define PHP_STREAM_NOTIFY_FILE_SIZE_IS 5 +#define PHP_STREAM_NOTIFY_REDIRECTED 6 +#define PHP_STREAM_NOTIFY_PROGRESS 7 +#define PHP_STREAM_NOTIFY_COMPLETED 8 +#define PHP_STREAM_NOTIFY_FAILURE 9 +#define PHP_STREAM_NOTIFY_AUTH_RESULT 10 + +#define PHP_STREAM_NOTIFY_SEVERITY_INFO 0 +#define PHP_STREAM_NOTIFY_SEVERITY_WARN 1 +#define PHP_STREAM_NOTIFY_SEVERITY_ERR 2 + +BEGIN_EXTERN_C() +PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, + char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr); +PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context); +END_EXTERN_C() + +#define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \ + php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_INFO, \ + (xmsg), (xcode), 0, 0, NULL); } } while (0) + +#define php_stream_notify_progress(context, bsofar, bmax) do { if ((context) && (context)->notifier) { \ + php_stream_notification_notify((context), PHP_STREAM_NOTIFY_PROGRESS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ + NULL, 0, (bsofar), (bmax), NULL); } } while(0) + +#define php_stream_notify_completed(context) do { if ((context) && (context)->notifier) { \ + php_stream_notification_notify((context), PHP_STREAM_NOTIFY_COMPLETED, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ + NULL, 0, (context)->notifier->progress, (context)->notifier->progress_max, NULL); } } while(0) + +#define php_stream_notify_progress_init(context, sofar, bmax) do { if ((context) && (context)->notifier) { \ + (context)->notifier->progress = (sofar); \ + (context)->notifier->progress_max = (bmax); \ + (context)->notifier->mask |= PHP_STREAM_NOTIFIER_PROGRESS; \ + php_stream_notify_progress((context), (sofar), (bmax)); } } while (0) + +#define php_stream_notify_progress_increment(context, dsofar, dmax) do { if ((context) && (context)->notifier && ((context)->notifier->mask & PHP_STREAM_NOTIFIER_PROGRESS)) { \ + (context)->notifier->progress += (dsofar); \ + (context)->notifier->progress_max += (dmax); \ + php_stream_notify_progress((context), (context)->notifier->progress, (context)->notifier->progress_max); } } while (0) + +#define php_stream_notify_file_size(context, file_size, xmsg, xcode) do { if ((context) && (context)->notifier) { \ + php_stream_notification_notify((context), PHP_STREAM_NOTIFY_FILE_SIZE_IS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ + (xmsg), (xcode), 0, (file_size), NULL); } } while(0) + +#define php_stream_notify_error(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) {\ + php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_ERR, \ + (xmsg), (xcode), 0, 0, NULL); } } while(0) diff --git a/include/php/main/streams/php_stream_filter_api.h b/include/php/main/streams/php_stream_filter_api.h new file mode 100644 index 0000000..ee6ab75 --- /dev/null +++ b/include/php/main/streams/php_stream_filter_api.h @@ -0,0 +1,149 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + | With suggestions from: | + | Moriyoshi Koizumi | + | Sara Golemon | + +----------------------------------------------------------------------+ + */ + +/* The filter API works on the principle of "Bucket-Brigades". This is + * partially inspired by the Apache 2 method of doing things, although + * it is intentionally a light-weight implementation. + * + * Each stream can have a chain of filters for reading and another for writing. + * + * When data is written to the stream, it is placed into a bucket and placed at + * the start of the input brigade. + * + * The first filter in the chain is invoked on the brigade and (depending on + * it's return value), the next filter is invoked and so on. + * */ + +#define PHP_STREAM_FILTER_READ 0x0001 +#define PHP_STREAM_FILTER_WRITE 0x0002 +#define PHP_STREAM_FILTER_ALL (PHP_STREAM_FILTER_READ | PHP_STREAM_FILTER_WRITE) + +typedef struct _php_stream_bucket php_stream_bucket; +typedef struct _php_stream_bucket_brigade php_stream_bucket_brigade; + +struct _php_stream_bucket { + php_stream_bucket *next, *prev; + php_stream_bucket_brigade *brigade; + + char *buf; + size_t buflen; + /* if non-zero, buf should be pefreed when the bucket is destroyed */ + uint8_t own_buf; + uint8_t is_persistent; + + /* destroy this struct when refcount falls to zero */ + int refcount; +}; + +struct _php_stream_bucket_brigade { + php_stream_bucket *head, *tail; +}; + +typedef enum { + PSFS_ERR_FATAL, /* error in data stream */ + PSFS_FEED_ME, /* filter needs more data; stop processing chain until more is available */ + PSFS_PASS_ON /* filter generated output buckets; pass them on to next in chain */ +} php_stream_filter_status_t; + +/* Buckets API. */ +BEGIN_EXTERN_C() +PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, uint8_t own_buf, uint8_t buf_persistent); +PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length); +PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket); +#define php_stream_bucket_addref(bucket) (bucket)->refcount++ +PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket); +PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket); +PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket); +PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket); +END_EXTERN_C() + +#define PSFS_FLAG_NORMAL 0 /* regular read/write */ +#define PSFS_FLAG_FLUSH_INC 1 /* an incremental flush */ +#define PSFS_FLAG_FLUSH_CLOSE 2 /* final flush prior to closing */ + +typedef struct _php_stream_filter_ops { + + php_stream_filter_status_t (*filter)( + php_stream *stream, + php_stream_filter *thisfilter, + php_stream_bucket_brigade *buckets_in, + php_stream_bucket_brigade *buckets_out, + size_t *bytes_consumed, + int flags + ); + + void (*dtor)(php_stream_filter *thisfilter); + + const char *label; + +} php_stream_filter_ops; + +typedef struct _php_stream_filter_chain { + php_stream_filter *head, *tail; + + /* Owning stream */ + php_stream *stream; +} php_stream_filter_chain; + +struct _php_stream_filter { + const php_stream_filter_ops *fops; + zval abstract; /* for use by filter implementation */ + php_stream_filter *next; + php_stream_filter *prev; + int is_persistent; + + /* link into stream and chain */ + php_stream_filter_chain *chain; + + /* buffered buckets */ + php_stream_bucket_brigade buffer; + + /* filters are auto_registered when they're applied */ + zend_resource *res; +}; + +/* stack filter onto a stream */ +BEGIN_EXTERN_C() +PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter); +PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter); +PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter); +PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter); +PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish); +PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor); +PHPAPI void php_stream_filter_free(php_stream_filter *filter); +PHPAPI php_stream_filter *_php_stream_filter_alloc(const php_stream_filter_ops *fops, void *abstract, uint8_t persistent STREAMS_DC); +END_EXTERN_C() +#define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC) +#define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC) +#define php_stream_filter_prepend(chain, filter) _php_stream_filter_prepend((chain), (filter)) +#define php_stream_filter_append(chain, filter) _php_stream_filter_append((chain), (filter)) +#define php_stream_filter_flush(filter, finish) _php_stream_filter_flush((filter), (finish)) + +#define php_stream_is_filtered(stream) ((stream)->readfilters.head || (stream)->writefilters.head) + +typedef struct _php_stream_filter_factory { + php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, uint8_t persistent); +} php_stream_filter_factory; + +BEGIN_EXTERN_C() +PHPAPI int php_stream_filter_register_factory(const char *filterpattern, const php_stream_filter_factory *factory); +PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern); +PHPAPI int php_stream_filter_register_factory_volatile(zend_string *filterpattern, const php_stream_filter_factory *factory); +PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, uint8_t persistent); +END_EXTERN_C() diff --git a/include/php/main/streams/php_stream_glob_wrapper.h b/include/php/main/streams/php_stream_glob_wrapper.h new file mode 100644 index 0000000..04de00a --- /dev/null +++ b/include/php/main/streams/php_stream_glob_wrapper.h @@ -0,0 +1,31 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Marcus Boerger | + +----------------------------------------------------------------------+ + */ + +PHPAPI extern const php_stream_wrapper php_glob_stream_wrapper; +PHPAPI extern const php_stream_ops php_glob_stream_ops; + +BEGIN_EXTERN_C() + +PHPAPI char* _php_glob_stream_get_path(php_stream *stream, size_t *plen STREAMS_DC); +#define php_glob_stream_get_path(stream, plen) _php_glob_stream_get_path((stream), (plen) STREAMS_CC) + +PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, size_t *plen STREAMS_DC); +#define php_glob_stream_get_pattern(stream, plen) _php_glob_stream_get_pattern((stream), (plen) STREAMS_CC) + +PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC); +#define php_glob_stream_get_count(stream, pflags) _php_glob_stream_get_count((stream), (pflags) STREAMS_CC) + +END_EXTERN_C() diff --git a/include/php/main/streams/php_stream_mmap.h b/include/php/main/streams/php_stream_mmap.h new file mode 100644 index 0000000..d477aa7 --- /dev/null +++ b/include/php/main/streams/php_stream_mmap.h @@ -0,0 +1,77 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +/* Memory Mapping interface for streams. + * The intention is to provide a uniform interface over the most common + * operations that are used within PHP itself, rather than a complete + * API for all memory mapping needs. + * + * ATM, we support only mmap(), but win32 memory mapping support will + * follow soon. + * */ + +typedef enum { + /* Does the stream support mmap ? */ + PHP_STREAM_MMAP_SUPPORTED, + /* Request a range and offset to be mapped; + * while mapped, you MUST NOT use any read/write functions + * on the stream (win9x compatibility) */ + PHP_STREAM_MMAP_MAP_RANGE, + /* Unmap the last range that was mapped for the stream */ + PHP_STREAM_MMAP_UNMAP +} php_stream_mmap_operation_t; + +typedef enum { + PHP_STREAM_MAP_MODE_READONLY, + PHP_STREAM_MAP_MODE_READWRITE, + PHP_STREAM_MAP_MODE_SHARED_READONLY, + PHP_STREAM_MAP_MODE_SHARED_READWRITE +} php_stream_mmap_access_t; + +typedef struct { + /* requested offset and length. + * If length is 0, the whole file is mapped */ + size_t offset; + size_t length; + + php_stream_mmap_access_t mode; + + /* returned mapped address */ + char *mapped; + +} php_stream_mmap_range; + +#define PHP_STREAM_MMAP_ALL 0 + +#define PHP_STREAM_MMAP_MAX (512 * 1024 * 1024) + +#define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL) == 0 ? 1 : 0) + +/* Returns 1 if the stream in its current state can be memory mapped, + * 0 otherwise */ +#define php_stream_mmap_possible(stream) (!php_stream_is_filtered((stream)) && php_stream_mmap_supported((stream))) + +BEGIN_EXTERN_C() +PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_access_t mode, size_t *mapped_len); +#define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len)) + +/* un-maps the last mapped range */ +PHPAPI int _php_stream_mmap_unmap(php_stream *stream); +#define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream)) + +PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden); +#define php_stream_mmap_unmap_ex(stream, readden) _php_stream_mmap_unmap_ex((stream), (readden)) +END_EXTERN_C() diff --git a/include/php/main/streams/php_stream_plain_wrapper.h b/include/php/main/streams/php_stream_plain_wrapper.h new file mode 100644 index 0000000..ce1a6e3 --- /dev/null +++ b/include/php/main/streams/php_stream_plain_wrapper.h @@ -0,0 +1,56 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ + */ + +/* definitions for the plain files wrapper */ + +/* operations for a plain file; use the php_stream_fopen_XXX funcs below */ +PHPAPI extern php_stream_ops php_stream_stdio_ops; +PHPAPI extern /*const*/ php_stream_wrapper php_plain_files_wrapper; + +BEGIN_EXTERN_C() + +/* like fopen, but returns a stream */ +PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, zend_string **opened_path, int options STREAMS_DC); +#define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC) + +PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, zend_string **opened_path, int options STREAMS_DC); +#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened), 0 STREAMS_CC) + +PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC); +#define php_stream_fopen_from_file(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_CC) + +PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id, bool zero_position STREAMS_DC); +#define php_stream_fopen_from_fd(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id), false STREAMS_CC) + +PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC); +#define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_CC) + +PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC); +#define php_stream_fopen_tmpfile() _php_stream_fopen_tmpfile(0 STREAMS_CC) + +PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, zend_string **opened_path STREAMS_DC); +#define php_stream_fopen_temporary_file(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC) + +/* This is a utility API for extensions that are opening a stream, converting it + * to a FILE* and then closing it again. Be warned that fileno() on the result + * will most likely fail on systems with fopencookie. */ +PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int options, zend_string **opened_path STREAMS_DC); +#define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC) + +/* parse standard "fopen" modes into open() flags */ +PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags); + +END_EXTERN_C() diff --git a/include/php/main/streams/php_stream_transport.h b/include/php/main/streams/php_stream_transport.h new file mode 100644 index 0000000..5d36af9 --- /dev/null +++ b/include/php/main/streams/php_stream_transport.h @@ -0,0 +1,216 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +#ifdef PHP_WIN32 +#include "config.w32.h" +#include +#endif + +#if HAVE_SYS_SOCKET_H +# include +#endif + +typedef php_stream *(php_stream_transport_factory_func)(const char *proto, size_t protolen, + const char *resourcename, size_t resourcenamelen, + const char *persistent_id, int options, int flags, + struct timeval *timeout, + php_stream_context *context STREAMS_DC); +typedef php_stream_transport_factory_func *php_stream_transport_factory; + +BEGIN_EXTERN_C() +PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory); +PHPAPI int php_stream_xport_unregister(const char *protocol); + +#define STREAM_XPORT_CLIENT 0 +#define STREAM_XPORT_SERVER 1 + +#define STREAM_XPORT_CONNECT 2 +#define STREAM_XPORT_BIND 4 +#define STREAM_XPORT_LISTEN 8 +#define STREAM_XPORT_CONNECT_ASYNC 16 + +/* Open a client or server socket connection */ +PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, int options, + int flags, const char *persistent_id, + struct timeval *timeout, + php_stream_context *context, + zend_string **error_string, + int *error_code + STREAMS_DC); + +#define php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode) \ + _php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode STREAMS_CC) + +/* Bind the stream to a local address */ +PHPAPI int php_stream_xport_bind(php_stream *stream, + const char *name, size_t namelen, + zend_string **error_text + ); + +/* Connect to a remote address */ +PHPAPI int php_stream_xport_connect(php_stream *stream, + const char *name, size_t namelen, + int asynchronous, + struct timeval *timeout, + zend_string **error_text, + int *error_code + ); + +/* Prepare to listen */ +PHPAPI int php_stream_xport_listen(php_stream *stream, + int backlog, + zend_string **error_text + ); + +/* Get the next client and their address as a string, or the underlying address + * structure. You must efree either of these if you request them */ +PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client, + zend_string **textaddr, + void **addr, socklen_t *addrlen, + struct timeval *timeout, + zend_string **error_text + ); + +/* Get the name of either the socket or it's peer */ +PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer, + zend_string **textaddr, + void **addr, socklen_t *addrlen + ); + +enum php_stream_xport_send_recv_flags { + STREAM_OOB = 1, + STREAM_PEEK = 2 +}; + +/* Similar to recv() system call; read data from the stream, optionally + * peeking, optionally retrieving OOB data */ +PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t buflen, + int flags, void **addr, socklen_t *addrlen, + zend_string **textaddr); + +/* Similar to send() system call; send data to the stream, optionally + * sending it as OOB data */ +PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen, + int flags, void *addr, socklen_t addrlen); + +typedef enum { + STREAM_SHUT_RD, + STREAM_SHUT_WR, + STREAM_SHUT_RDWR +} stream_shutdown_t; + +/* Similar to shutdown() system call; shut down part of a full-duplex + * connection */ +PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how); +END_EXTERN_C() + + +/* Structure definition for the set_option interface that the above functions wrap */ + +typedef struct _php_stream_xport_param { + enum { + STREAM_XPORT_OP_BIND, STREAM_XPORT_OP_CONNECT, + STREAM_XPORT_OP_LISTEN, STREAM_XPORT_OP_ACCEPT, + STREAM_XPORT_OP_CONNECT_ASYNC, + STREAM_XPORT_OP_GET_NAME, + STREAM_XPORT_OP_GET_PEER_NAME, + STREAM_XPORT_OP_RECV, + STREAM_XPORT_OP_SEND, + STREAM_XPORT_OP_SHUTDOWN + } op; + unsigned int want_addr:1; + unsigned int want_textaddr:1; + unsigned int want_errortext:1; + unsigned int how:2; + + struct { + char *name; + size_t namelen; + struct timeval *timeout; + struct sockaddr *addr; + char *buf; + size_t buflen; + socklen_t addrlen; + int backlog; + int flags; + } inputs; + struct { + php_stream *client; + struct sockaddr *addr; + socklen_t addrlen; + zend_string *textaddr; + zend_string *error_text; + int returncode; + int error_code; + } outputs; +} php_stream_xport_param; + +/* Because both client and server streams use the same mechanisms + for encryption we use the LSB to denote clients. +*/ +typedef enum { + STREAM_CRYPTO_METHOD_SSLv2_CLIENT = (1 << 1 | 1), + STREAM_CRYPTO_METHOD_SSLv3_CLIENT = (1 << 2 | 1), + /* v23 no longer negotiates SSL2 or SSL3 */ + STREAM_CRYPTO_METHOD_SSLv23_CLIENT = ((1 << 3) | (1 << 4) | (1 << 5) | 1), + STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT = (1 << 3 | 1), + STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT = (1 << 4 | 1), + STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT = (1 << 5 | 1), + STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT = (1 << 6 | 1), + /* TLS equates to TLS_ANY as of PHP 7.2 */ + STREAM_CRYPTO_METHOD_TLS_CLIENT = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | 1), + STREAM_CRYPTO_METHOD_TLS_ANY_CLIENT = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | 1), + STREAM_CRYPTO_METHOD_ANY_CLIENT = ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | 1), + STREAM_CRYPTO_METHOD_SSLv2_SERVER = (1 << 1), + STREAM_CRYPTO_METHOD_SSLv3_SERVER = (1 << 2), + /* v23 no longer negotiates SSL2 or SSL3 */ + STREAM_CRYPTO_METHOD_SSLv23_SERVER = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6)), + STREAM_CRYPTO_METHOD_TLSv1_0_SERVER = (1 << 3), + STREAM_CRYPTO_METHOD_TLSv1_1_SERVER = (1 << 4), + STREAM_CRYPTO_METHOD_TLSv1_2_SERVER = (1 << 5), + STREAM_CRYPTO_METHOD_TLSv1_3_SERVER = (1 << 6), + /* TLS equates to TLS_ANY as of PHP 7.2 */ + STREAM_CRYPTO_METHOD_TLS_SERVER = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6)), + STREAM_CRYPTO_METHOD_TLS_ANY_SERVER = ((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6)), + STREAM_CRYPTO_METHOD_ANY_SERVER = ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6)) +} php_stream_xport_crypt_method_t; + +/* These functions provide crypto support on the underlying transport */ + +BEGIN_EXTERN_C() +PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream); +PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate); +END_EXTERN_C() + +typedef struct _php_stream_xport_crypto_param { + struct { + php_stream *session; + int activate; + php_stream_xport_crypt_method_t method; + } inputs; + struct { + int returncode; + } outputs; + enum { + STREAM_XPORT_CRYPTO_OP_SETUP, + STREAM_XPORT_CRYPTO_OP_ENABLE + } op; +} php_stream_xport_crypto_param; + +BEGIN_EXTERN_C() +PHPAPI HashTable *php_stream_xport_get_hash(void); +PHPAPI php_stream_transport_factory_func php_stream_generic_socket_factory; +END_EXTERN_C() diff --git a/include/php/main/streams/php_stream_userspace.h b/include/php/main/streams/php_stream_userspace.h new file mode 100644 index 0000000..18e0f40 --- /dev/null +++ b/include/php/main/streams/php_stream_userspace.h @@ -0,0 +1,21 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ + */ + +/* for user-space streams */ +PHPAPI extern const php_stream_ops php_stream_userspace_ops; +PHPAPI extern const php_stream_ops php_stream_userspace_dir_ops; +#define PHP_STREAM_IS_USERSPACE &php_stream_userspace_ops +#define PHP_STREAM_IS_USERSPACE_DIR &php_stream_userspace_dir_ops diff --git a/include/php/main/streams/php_streams_int.h b/include/php/main/streams/php_streams_int.h new file mode 100644 index 0000000..a3c55bd --- /dev/null +++ b/include/php/main/streams/php_streams_int.h @@ -0,0 +1,62 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Wez Furlong | + +----------------------------------------------------------------------+ +*/ + +#if ZEND_DEBUG + +#define emalloc_rel_orig(size) \ + ( __php_stream_call_depth == 0 \ + ? _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \ + : _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ) + +#define erealloc_rel_orig(ptr, size) \ + ( __php_stream_call_depth == 0 \ + ? _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \ + : _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ) + +#define pemalloc_rel_orig(size, persistent) ((persistent) ? malloc((size)) : emalloc_rel_orig((size))) +#define perealloc_rel_orig(ptr, size, persistent) ((persistent) ? realloc((ptr), (size)) : erealloc_rel_orig((ptr), (size))) +#else +# define pemalloc_rel_orig(size, persistent) pemalloc((size), (persistent)) +# define perealloc_rel_orig(ptr, size, persistent) perealloc((ptr), (size), (persistent)) +# define emalloc_rel_orig(size) emalloc((size)) +#endif + +#define STREAM_DEBUG 0 +#define STREAM_WRAPPER_PLAIN_FILES ((php_stream_wrapper*)-1) + +#ifndef MAP_FAILED +#define MAP_FAILED ((void *) -1) +#endif + +#define CHUNK_SIZE 8192 + +#ifdef PHP_WIN32 +# ifdef EWOULDBLOCK +# undef EWOULDBLOCK +# endif +# define EWOULDBLOCK WSAEWOULDBLOCK +# ifdef EMSGSIZE +# undef EMSGSIZE +# endif +# define EMSGSIZE WSAEMSGSIZE +#endif + +/* This functions transforms the first char to 'w' if it's not 'r', 'a' or 'w' + * and strips any subsequent chars except '+' and 'b'. + * Use this to sanitize stream->mode if you call e.g. fdopen, fopencookie or + * any other function that expects standard modes and you allow non-standard + * ones. result should be a char[5]. */ +void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *result); diff --git a/include/php/main/streams/userspace_arginfo.h b/include/php/main/streams/userspace_arginfo.h new file mode 100644 index 0000000..097e581 --- /dev/null +++ b/include/php/main/streams/userspace_arginfo.h @@ -0,0 +1,31 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 9198095c858c95fcb31252ddfa24fe04787d0460 */ + + + +static void register_userspace_symbols(int module_number) +{ + REGISTER_LONG_CONSTANT("STREAM_USE_PATH", USE_PATH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_IGNORE_URL", IGNORE_URL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_REPORT_ERRORS", REPORT_ERRORS, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_MUST_SEEK", STREAM_MUST_SEEK, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_URL_STAT_LINK", PHP_STREAM_URL_STAT_LINK, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_URL_STAT_QUIET", PHP_STREAM_URL_STAT_QUIET, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_MKDIR_RECURSIVE", PHP_STREAM_MKDIR_RECURSIVE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_IS_URL", PHP_STREAM_IS_URL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_OPTION_BLOCKING", PHP_STREAM_OPTION_BLOCKING, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_OPTION_READ_TIMEOUT", PHP_STREAM_OPTION_READ_TIMEOUT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_OPTION_READ_BUFFER", PHP_STREAM_OPTION_READ_BUFFER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_OPTION_WRITE_BUFFER", PHP_STREAM_OPTION_WRITE_BUFFER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_BUFFER_NONE", PHP_STREAM_BUFFER_NONE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_BUFFER_LINE", PHP_STREAM_BUFFER_LINE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_BUFFER_FULL", PHP_STREAM_BUFFER_FULL, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CAST_AS_STREAM", PHP_STREAM_AS_STDIO, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CAST_FOR_SELECT", PHP_STREAM_AS_FD_FOR_SELECT, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_META_TOUCH", PHP_STREAM_META_TOUCH, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_META_OWNER", PHP_STREAM_META_OWNER, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_META_OWNER_NAME", PHP_STREAM_META_OWNER_NAME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_META_GROUP", PHP_STREAM_META_GROUP, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_META_GROUP_NAME", PHP_STREAM_META_GROUP_NAME, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_META_ACCESS", PHP_STREAM_META_ACCESS, CONST_PERSISTENT); +} diff --git a/include/php/sapi/cli/cli.h b/include/php/sapi/cli/cli.h new file mode 100644 index 0000000..8fefab6 --- /dev/null +++ b/include/php/sapi/cli/cli.h @@ -0,0 +1,39 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Johannes Schlueter | + +----------------------------------------------------------------------+ +*/ + +#ifndef CLI_H +#define CLI_H + +#ifdef PHP_WIN32 +# define PHP_CLI_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_CLI_API __attribute__ ((visibility("default"))) +#else +# define PHP_CLI_API +#endif + + +extern PHP_CLI_API ssize_t sapi_cli_single_write(const char *str, size_t str_length); + +typedef struct { + size_t (*cli_shell_write)(const char *str, size_t str_length); + size_t (*cli_shell_ub_write)(const char *str, size_t str_length); + int (*cli_shell_run)(void); +} cli_shell_callbacks_t; + +extern PHP_CLI_API cli_shell_callbacks_t *php_cli_get_shell_callbacks(void); + +#endif /* CLI_H */ diff --git a/lib/php/build/Makefile.global b/lib/php/build/Makefile.global new file mode 100644 index 0000000..b11ce20 --- /dev/null +++ b/lib/php/build/Makefile.global @@ -0,0 +1,163 @@ +mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p +INSTALL = $(top_srcdir)/build/shtool install -c +INSTALL_DATA = $(INSTALL) -m 644 + +DEFS = -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir) +COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH) + +all: $(all_targets) + @echo + @echo "Build complete." + @echo "Don't forget to run 'make test'." + @echo + +build-modules: $(PHP_MODULES) $(PHP_ZEND_EX) + +build-binaries: $(PHP_BINARIES) + +libphp.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) + $(LIBTOOL) --tag=CC --mode=link $(CC) $(LIBPHP_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ + -@$(LIBTOOL) --silent --tag=CC --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1 + +libs/libphp.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) + $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp.so + +install: $(all_targets) $(install_targets) + +install-sapi: $(OVERALL_TARGET) + @echo "Installing PHP SAPI module: $(PHP_SAPI)" + -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) + -@if test ! -r $(phptempdir)/libphp.$(SHLIB_DL_SUFFIX_NAME); then \ + for i in 0.0.0 0.0 0; do \ + if test -r $(phptempdir)/libphp.$(SHLIB_DL_SUFFIX_NAME).$$i; then \ + $(LN_S) $(phptempdir)/libphp.$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp.$(SHLIB_DL_SUFFIX_NAME); \ + break; \ + fi; \ + done; \ + fi + @$(INSTALL_IT) + +install-binaries: build-binaries $(install_binary_targets) + +install-modules: build-modules + @test -d modules && \ + $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) + @echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/" + @rm -f modules/*.la >/dev/null 2>&1 + @$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) + +install-headers: + -@if test "$(INSTALL_HEADERS)"; then \ + for i in `echo $(INSTALL_HEADERS)`; do \ + i=`$(top_srcdir)/build/shtool path -d $$i`; \ + paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \ + done; \ + $(mkinstalldirs) $$paths && \ + echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \ + for i in `echo $(INSTALL_HEADERS)`; do \ + if test "$(PHP_PECL_EXTENSION)"; then \ + src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \ + else \ + src=$$i; \ + fi; \ + if test -f "$(top_srcdir)/$$src"; then \ + $(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \ + elif test -f "$(top_builddir)/$$src"; then \ + $(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \ + else \ + (cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \ + cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \ + fi \ + done; \ + fi + +PHP_TEST_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' +PHP_TEST_SHARED_EXTENSIONS = ` \ + if test "x$(PHP_MODULES)" != "x"; then \ + for i in $(PHP_MODULES)""; do \ + . $$i; \ + if test "x$$dlname" != "xdl_test.so"; then \ + $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \ + fi; \ + done; \ + fi; \ + if test "x$(PHP_ZEND_EX)" != "x"; then \ + for i in $(PHP_ZEND_EX)""; do \ + . $$i; $(top_srcdir)/build/shtool echo -n -- " -d zend_extension=$(top_builddir)/modules/$$dlname"; \ + done; \ + fi` +PHP_DEPRECATED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*=' + +test: all + @if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \ + INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \ + if test "$$INI_FILE"; then \ + $(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \ + else \ + echo > $(top_builddir)/tmp-php.ini; \ + fi; \ + INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \ + if test "$$INI_SCANNED_PATH"; then \ + INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \ + $(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \ + fi; \ + TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \ + TEST_PHP_SRCDIR=$(top_srcdir) \ + CC="$(CC)" \ + $(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \ + TEST_RESULT_EXIT_CODE=$$?; \ + rm $(top_builddir)/tmp-php.ini; \ + exit $$TEST_RESULT_EXIT_CODE; \ + else \ + echo "ERROR: Cannot run tests without CLI sapi."; \ + fi + +clean: + find . -name \*.gcno -o -name \*.gcda | xargs rm -f + find . -name \*.lo -o -name \*.o -o -name \*.dep | xargs rm -f + find . -name \*.la -o -name \*.a | xargs rm -f + find . -name \*.so | xargs rm -f + find . -name .libs -a -type d|xargs rm -rf + rm -f libphp.la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/* + rm -f ext/opcache/jit/zend_jit_x86.c + rm -f ext/opcache/jit/zend_jit_arm64.c + rm -f ext/opcache/minilua + +distclean: clean + rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h + rm -f main/build-defs.h scripts/phpize + rm -f ext/date/lib/timelib_config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak + rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1 + rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html + rm -f ext/phar/phar.phar ext/phar/phar.php + if test "$(srcdir)" != "$(builddir)"; then \ + rm -f ext/phar/phar/phar.inc; \ + fi + $(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f + +prof-gen: + CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-generate all + find . -name \*.gcda | xargs rm -f + +prof-clean: + find . -name \*.lo -o -name \*.o | xargs rm -f + find . -name \*.la -o -name \*.a | xargs rm -f + find . -name \*.so | xargs rm -f + rm -f libphp.la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/* + +prof-use: + CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-use all + +%_arginfo.h: %.stub.php + @if test -e "$(top_srcdir)/build/gen_stub.php"; then \ + if test ! -z "$(PHP)"; then \ + echo Parse $< to generate $@;\ + $(PHP) $(top_srcdir)/build/gen_stub.php $<; \ + elif test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \ + echo Parse $< to generate $@;\ + $(PHP_EXECUTABLE) $(top_srcdir)/build/gen_stub.php $<; \ + fi; \ + fi; + +.PHONY: all clean install distclean test prof-gen prof-clean prof-use +.NOEXPORT: diff --git a/lib/php/build/ax_check_compile_flag.m4 b/lib/php/build/ax_check_compile_flag.m4 new file mode 100644 index 0000000..bd753b3 --- /dev/null +++ b/lib/php/build/ax_check_compile_flag.m4 @@ -0,0 +1,53 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 6 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff --git a/lib/php/build/ax_gcc_func_attribute.m4 b/lib/php/build/ax_gcc_func_attribute.m4 new file mode 100644 index 0000000..79478f5 --- /dev/null +++ b/lib/php/build/ax_gcc_func_attribute.m4 @@ -0,0 +1,241 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) +# +# DESCRIPTION +# +# This macro checks if the compiler supports one of GCC's function +# attributes; many other compilers also provide function attributes with +# the same syntax. Compiler warnings are used to detect supported +# attributes as unsupported ones are ignored by default so quieting +# warnings when using this macro will yield false positives. +# +# The ATTRIBUTE parameter holds the name of the attribute to be checked. +# +# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_. +# +# The macro caches its result in the ax_cv_have_func_attribute_ +# variable. +# +# The macro currently supports the following function attributes: +# +# alias +# aligned +# alloc_size +# always_inline +# artificial +# cold +# const +# constructor +# constructor_priority for constructor attribute with priority +# deprecated +# destructor +# dllexport +# dllimport +# error +# externally_visible +# fallthrough +# flatten +# format +# format_arg +# gnu_inline +# hot +# ifunc +# leaf +# malloc +# noclone +# noinline +# nonnull +# noreturn +# nothrow +# optimize +# pure +# sentinel +# sentinel_position +# unused +# used +# visibility +# warning +# warn_unused_result +# weak +# weakref +# +# Unsupported function attributes will be tested with a prototype +# returning an int and not accepting any arguments and the result of the +# check might be wrong or meaningless so use with care. +# +# LICENSE +# +# Copyright (c) 2013 Gabriele Svelto +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 9 + +AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ + AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) + + AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ + m4_case([$1], + [alias], [ + int foo( void ) { return 0; } + int bar( void ) __attribute__(($1("foo"))); + ], + [aligned], [ + int foo( void ) __attribute__(($1(32))); + ], + [alloc_size], [ + void *foo(int a) __attribute__(($1(1))); + ], + [always_inline], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [artificial], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [cold], [ + int foo( void ) __attribute__(($1)); + ], + [const], [ + int foo( void ) __attribute__(($1)); + ], + [constructor_priority], [ + int foo( void ) __attribute__((__constructor__(65535/2))); + ], + [constructor], [ + int foo( void ) __attribute__(($1)); + ], + [deprecated], [ + int foo( void ) __attribute__(($1(""))); + ], + [destructor], [ + int foo( void ) __attribute__(($1)); + ], + [dllexport], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [dllimport], [ + int foo( void ) __attribute__(($1)); + ], + [error], [ + int foo( void ) __attribute__(($1(""))); + ], + [externally_visible], [ + int foo( void ) __attribute__(($1)); + ], + [fallthrough], [ + int foo( void ) {switch (0) { case 1: __attribute__(($1)); case 2: break ; }}; + ], + [flatten], [ + int foo( void ) __attribute__(($1)); + ], + [format], [ + int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); + ], + [format_arg], [ + char *foo(const char *p) __attribute__(($1(1))); + ], + [gnu_inline], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [hot], [ + int foo( void ) __attribute__(($1)); + ], + [ifunc], [ + int my_foo( void ) { return 0; } + static int (*resolve_foo(void))(void) { return my_foo; } + int foo( void ) __attribute__(($1("resolve_foo"))); + ], + [leaf], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [malloc], [ + void *foo( void ) __attribute__(($1)); + ], + [noclone], [ + int foo( void ) __attribute__(($1)); + ], + [noinline], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [nonnull], [ + int foo(char *p) __attribute__(($1(1))); + ], + [noreturn], [ + void foo( void ) __attribute__(($1)); + ], + [nothrow], [ + int foo( void ) __attribute__(($1)); + ], + [optimize], [ + __attribute__(($1(3))) int foo( void ) { return 0; } + ], + [pure], [ + int foo( void ) __attribute__(($1)); + ], + [sentinel], [ + int foo(void *p, ...) __attribute__(($1)); + ], + [sentinel_position], [ + int foo(void *p, ...) __attribute__(($1(1))); + ], + [returns_nonnull], [ + void *foo( void ) __attribute__(($1)); + ], + [unused], [ + int foo( void ) __attribute__(($1)); + ], + [used], [ + int foo( void ) __attribute__(($1)); + ], + [visibility], [ + int foo_def( void ) __attribute__(($1("default"))); + int foo_hid( void ) __attribute__(($1("hidden"))); + int foo_int( void ) __attribute__(($1("internal"))); + int foo_pro( void ) __attribute__(($1("protected"))); + ], + [warning], [ + int foo( void ) __attribute__(($1(""))); + ], + [warn_unused_result], [ + int foo( void ) __attribute__(($1)); + ], + [weak], [ + int foo( void ) __attribute__(($1)); + ], + [weakref], [ + static int foo( void ) { return 0; } + static int bar( void ) __attribute__(($1("foo"))); + ], + [target], [ + static int bar( void ) __attribute__(($1("sse2"))); + ], + [ + m4_warn([syntax], [Unsupported attribute $1, the test may fail]) + int foo( void ) __attribute__(($1)); + ] + )], []) + ], + dnl GCC doesn't exit with an error if an unknown attribute is + dnl provided but only outputs a warning, so accept the attribute + dnl only if no warning were issued. + [AS_IF([test -s conftest.err], + [AS_VAR_SET([ac_var], [no])], + [AS_VAR_SET([ac_var], [yes])])], + [AS_VAR_SET([ac_var], [no])]) + ]) + + AS_IF([test yes = AS_VAR_GET([ac_var])], + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1, + [Define to 1 if the system has the `$1' function attribute])], []) + + AS_VAR_POPDEF([ac_var]) +]) diff --git a/lib/php/build/config.guess b/lib/php/build/config.guess new file mode 100755 index 0000000..354a8cc --- /dev/null +++ b/lib/php/build/config.guess @@ -0,0 +1,1774 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2023 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2023-06-23' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system '$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2023 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# Just in case it came from the environment. +GUESS= + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case $UNAME_SYSTEM in +Linux|GNU|GNU/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif + EOF + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case $UNAME_VERSION in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + GUESS=$machine-${os}${release}${abi-} + ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; + *:ekkoBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; + *:SolidBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; + macppc:MirBSD:*:*) + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; + *:MirBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; + alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case $ALPHA_CPU_TYPE in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; + Amiga*:UNIX_System_V:4.0:*) + GUESS=m68k-unknown-sysv4 + ;; + *:[Aa]miga[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; + *:[Mm]orph[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-morphos + ;; + *:OS/390:*:*) + GUESS=i370-ibm-openedition + ;; + *:z/VM:*:*) + GUESS=s390-ibm-zvmoe + ;; + *:OS400:*:*) + GUESS=powerpc-ibm-os400 + ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + GUESS=arm-unknown-riscos + ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + GUESS=hppa1.1-hitachi-hiuxmpp + ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; + NILE*:*:*:dcosx) + GUESS=pyramid-pyramid-svr4 + ;; + DRS?6000:unix:4.0:6*) + GUESS=sparc-icl-nx6 + ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; + s390x:SunOS:*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; + sun4H:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; + sun4*:SunOS:*:*) + case `/usr/bin/arch -k` in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like '4.1.3-JL'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; + sun3*:SunOS:*:*) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in + sun3) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun4) + GUESS=sparc-sun-sunos$UNAME_RELEASE + ;; + esac + ;; + aushp:SunOS:*:*) + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; + m68k:machten:*:*) + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; + powerpc:machten:*:*) + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; + RISC*:Mach:*:*) + GUESS=mips-dec-mach_bsd4.3 + ;; + RISC*:ULTRIX:*:*) + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; + VAX*:ULTRIX*:*:*) + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; + Motorola:PowerMAX_OS:*:*) + GUESS=powerpc-motorola-powermax + ;; + Motorola:*:4.3:PL8-*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:Power_UNIX:*:*) + GUESS=powerpc-harris-powerunix + ;; + m88k:CX/UX:7*:*) + GUESS=m88k-harris-cxux7 + ;; + m88k:*:4*:R4*) + GUESS=m88k-motorola-sysv4 + ;; + m88k:*:3*:R3*) + GUESS=m88k-motorola-sysv3 + ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x + then + GUESS=m88k-dg-dgux$UNAME_RELEASE + else + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE + fi + else + GUESS=i586-dg-dgux$UNAME_RELEASE + fi + ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + GUESS=m88k-dolphin-sysv3 + ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + GUESS=m88k-motorola-sysv3 + ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + GUESS=m88k-tektronix-sysv3 + ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + GUESS=m68k-tektronix-bsd + ;; + *:IRIX*:*:*) + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + GUESS=i386-ibm-aix + ;; + ia64:AIX:*:*) + if test -x /usr/bin/oslevel ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + GUESS=$SYSTEM_NAME + else + GUESS=rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + GUESS=rs6000-ibm-aix3.2.4 + else + GUESS=rs6000-ibm-aix3.2 + fi + ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; + *:AIX:*:*) + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + GUESS=rs6000-bull-bosx + ;; + DPX/2?00:B.O.S.:*:*) + GUESS=m68k-bull-sysv3 + ;; + 9000/[34]??:4.3bsd:1.*:*) + GUESS=m68k-hp-bsd + ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + GUESS=m68k-hp-bsd4.4 + ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if test -x /usr/bin/getconf; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case $sc_cpu_version in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case $sc_kernel_bits in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if test "$HP_ARCH" = hppa2.0w + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; + 9000/8??:4.3bsd:*:*) + GUESS=hppa1.0-hp-bsd + ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; + hp8??:OSF1:*:*) + GUESS=hppa1.0-hp-osf + ;; + i*86:OSF1:*:*) + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk + else + GUESS=$UNAME_MACHINE-unknown-osf1 + fi + ;; + parisc*:Lites*:*:*) + GUESS=hppa1.1-hp-lites + ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + GUESS=c1-convex-bsd + ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + GUESS=c34-convex-bsd + ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + GUESS=c38-convex-bsd + ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + GUESS=c4-convex-bsd + ;; + CRAY*Y-MP:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; + CRAY*T3E:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; + CRAY*SV1:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; + *:UNICOS/mp:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; + sparc*:BSD/OS:*:*) + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; + *:BSD/OS:*:*) + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case $UNAME_PROCESSOR in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; + i*:CYGWIN*:*) + GUESS=$UNAME_MACHINE-pc-cygwin + ;; + *:MINGW64*:*) + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; + *:MINGW*:*) + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; + *:MSYS*:*) + GUESS=$UNAME_MACHINE-pc-msys + ;; + i*:PW*:*) + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; + *:Interix*:*) + case $UNAME_MACHINE in + x86) + GUESS=i586-pc-interix$UNAME_RELEASE + ;; + authenticamd | genuineintel | EM64T) + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; + IA64) + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; + esac ;; + i*:UWIN*:*) + GUESS=$UNAME_MACHINE-pc-uwin + ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + GUESS=x86_64-pc-cygwin + ;; + prep*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; + *:GNU:*:*) + # the GNU system + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; + aarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi + else + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf + fi + fi + ;; + avr32*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + cris:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + crisv32:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + frv:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + hexagon:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:Linux:*:*) + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; + ia64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m32r*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m68*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + openrisc*:Linux:*:*) + GUESS=or1k-unknown-linux-$LIBC + ;; + or32:Linux:*:* | or1k*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + padre:Linux:*:*) + GUESS=sparc-unknown-linux-$LIBC + ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + GUESS=hppa64-unknown-linux-$LIBC + ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; + esac + ;; + ppc64:Linux:*:*) + GUESS=powerpc64-unknown-linux-$LIBC + ;; + ppc:Linux:*:*) + GUESS=powerpc-unknown-linux-$LIBC + ;; + ppc64le:Linux:*:*) + GUESS=powerpc64le-unknown-linux-$LIBC + ;; + ppcle:Linux:*:*) + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + s390:Linux:*:* | s390x:Linux:*:*) + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; + sh64*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sh*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + tile*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + vax:Linux:*:*) + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; + x86_64:Linux:*:*) + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac + fi + GUESS=$CPU-pc-linux-$LIBCABI + ;; + xtensa*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + GUESS=i386-sequent-sysv4 + ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; + i*86:OS/2:*:*) + # If we were able to find 'uname', then EMX Unix compatibility + # is probably installed. + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; + i*86:XTS-300:*:STOP) + GUESS=$UNAME_MACHINE-unknown-stop + ;; + i*86:atheos:*:*) + GUESS=$UNAME_MACHINE-unknown-atheos + ;; + i*86:syllable:*:*) + GUESS=$UNAME_MACHINE-pc-syllable + ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; + i*86:*DOS:*:*) + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL + fi + ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv32 + fi + ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + GUESS=i586-pc-msdosdjgpp + ;; + Intel:Mach:3*:*) + GUESS=i386-pc-mach3 + ;; + paragon:*:*:*) + GUESS=i860-intel-osf1 + ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 + fi + ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + GUESS=m68010-convergent-sysv + ;; + mc68k:UNIX:SYSTEM5:3.51m) + GUESS=m68k-convergent-sysv + ;; + M680?0:D-NIX:5.3:*) + GUESS=m68k-diab-dnix + ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; + mc68030:UNIX_System_V:4.*:*) + GUESS=m68k-atari-sysv4 + ;; + TSUNAMI:LynxOS:2.*:*) + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; + rs6000:LynxOS:2.*:*) + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; + SM[BE]S:UNIX_SV:*:*) + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; + RM*:ReliantUNIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + RM*:SINIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 + else + GUESS=ns32k-sni-sysv + fi + ;; + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort + # says + GUESS=i586-unisys-sysv4 + ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + GUESS=hppa1.1-stratus-sysv4 + ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + GUESS=i860-stratus-sysv4 + ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=$UNAME_MACHINE-stratus-vos + ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=hppa1.1-stratus-vos + ;; + mc68*:A/UX:*:*) + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; + news*:NEWS-OS:6*:*) + GUESS=mips-sony-newsos6 + ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE + else + GUESS=mips-unknown-sysv$UNAME_RELEASE + fi + ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + GUESS=powerpc-be-beos + ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + GUESS=powerpc-apple-beos + ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + GUESS=i586-pc-beos + ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + GUESS=i586-pc-haiku + ;; + ppc:Haiku:*:*) # Haiku running on Apple PowerPC + GUESS=powerpc-apple-haiku + ;; + *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) + GUESS=$UNAME_MACHINE-unknown-haiku + ;; + SX-4:SUPER-UX:*:*) + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; + SX-5:SUPER-UX:*:*) + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; + SX-6:SUPER-UX:*:*) + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; + SX-7:SUPER-UX:*:*) + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; + SX-8:SUPER-UX:*:*) + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; + SX-8R:SUPER-UX:*:*) + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; + Power*:Rhapsody:*:*) + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; + *:Rhapsody:*:*) + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; + *:QNX:*:4*) + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; + NSE-*:NONSTOP_KERNEL:*:*) + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; + *:NonStop-UX:*:*) + GUESS=mips-compaq-nonstopux + ;; + BS2000:POSIX*:*:*) + GUESS=bs2000-siemens-sysv + ;; + DS/*:UNIX_System_V:*:*) + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "${cputype-}" = 386; then + UNAME_MACHINE=i386 + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype + fi + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; + *:TOPS-10:*:*) + GUESS=pdp10-unknown-tops10 + ;; + *:TENEX:*:*) + GUESS=pdp10-unknown-tenex + ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + GUESS=pdp10-dec-tops20 + ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + GUESS=pdp10-xkl-tops20 + ;; + *:TOPS-20:*:*) + GUESS=pdp10-unknown-tops20 + ;; + *:ITS:*:*) + GUESS=pdp10-unknown-its + ;; + SEI:*:*:SEIUX) + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; + *:DragonFly:*:*) + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; + esac ;; + *:XENIX:*:SysV) + GUESS=i386-pc-xenix + ;; + i*86:skyos:*:*) + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; + i*86:rdos:*:*) + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; + x86_64:VMkernel:*:*) + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/lib/php/build/config.sub b/lib/php/build/config.sub new file mode 100755 index 0000000..9865d6e --- /dev/null +++ b/lib/php/build/config.sub @@ -0,0 +1,1914 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2023 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2023-06-26' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2023 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ + | windows-* ) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if test x$basic_os != x +then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) + ;; + uclinux-uclibc* ) + ;; + managarm-mlibc* | managarm-kernel* ) + ;; + windows*-gnu* | windows*-msvc*) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + -kernel* ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + *-kernel* ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 + ;; + *-msvc* ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) + vendor=acorn + ;; + *-sunos*) + vendor=sun + ;; + *-cnk* | *-aix*) + vendor=ibm + ;; + *-beos*) + vendor=be + ;; + *-hpux*) + vendor=hp + ;; + *-mpeix*) + vendor=hp + ;; + *-hiux*) + vendor=hitachi + ;; + *-unos*) + vendor=crds + ;; + *-dgux*) + vendor=dg + ;; + *-luna*) + vendor=omron + ;; + *-genix*) + vendor=ns + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) + vendor=sequent + ;; + *-tpf*) + vendor=ibm + ;; + *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; + *-aux*) + vendor=apple + ;; + *-hms*) + vendor=hitachi + ;; + *-mpw* | *-macos*) + vendor=apple + ;; + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; + *-vos*) + vendor=stratus + ;; + esac + ;; +esac + +echo "$cpu-$vendor-${kernel:+$kernel-}$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/lib/php/build/gen_stub.php b/lib/php/build/gen_stub.php new file mode 100644 index 0000000..b3f3fcf --- /dev/null +++ b/lib/php/build/gen_stub.php @@ -0,0 +1,5179 @@ +#!/usr/bin/env php +getPathName(); + if (preg_match('/\.stub\.php$/', $pathName)) { + $pathNames[] = $pathName; + } + } + + // Make sure stub files are processed in a predictable, system-independent order. + sort($pathNames); + + $fileInfos = []; + foreach ($pathNames as $pathName) { + $fileInfo = processStubFile($pathName, $context); + if ($fileInfo) { + $fileInfos[] = $fileInfo; + } + } + return $fileInfos; +} + +function processStubFile(string $stubFile, Context $context, bool $includeOnly = false): ?FileInfo { + try { + if (!file_exists($stubFile)) { + throw new Exception("File $stubFile does not exist"); + } + + if (!$includeOnly) { + $stubFilenameWithoutExtension = str_replace(".stub.php", "", $stubFile); + $arginfoFile = "{$stubFilenameWithoutExtension}_arginfo.h"; + $legacyFile = "{$stubFilenameWithoutExtension}_legacy_arginfo.h"; + + $stubCode = file_get_contents($stubFile); + $stubHash = computeStubHash($stubCode); + $oldStubHash = extractStubHash($arginfoFile); + if ($stubHash === $oldStubHash && !$context->forceParse) { + /* Stub file did not change, do not regenerate. */ + return null; + } + } + + if (!$fileInfo = $context->parsedFiles[$stubFile] ?? null) { + initPhpParser(); + $fileInfo = parseStubFile($stubCode ?? file_get_contents($stubFile)); + $context->parsedFiles[$stubFile] = $fileInfo; + + foreach ($fileInfo->dependencies as $dependency) { + // TODO add header search path for extensions? + $prefixes = [dirname($stubFile) . "/", dirname(__DIR__) . "/"]; + foreach ($prefixes as $prefix) { + $depFile = $prefix . $dependency; + if (file_exists($depFile)) { + break; + } + $depFile = null; + } + if (!$depFile) { + throw new Exception("File $stubFile includes a file $dependency which does not exist"); + } + processStubFile($depFile, $context, true); + } + + $constInfos = $fileInfo->getAllConstInfos(); + $context->allConstInfos = array_merge($context->allConstInfos, $constInfos); + } + + if ($includeOnly) { + return $fileInfo; + } + + $arginfoCode = generateArgInfoCode( + basename($stubFilenameWithoutExtension), + $fileInfo, + $context->allConstInfos, + $stubHash + ); + if (($context->forceRegeneration || $stubHash !== $oldStubHash) && file_put_contents($arginfoFile, $arginfoCode)) { + echo "Saved $arginfoFile\n"; + } + + if ($fileInfo->generateLegacyArginfoForPhpVersionId !== null && $fileInfo->generateLegacyArginfoForPhpVersionId < PHP_80_VERSION_ID) { + $legacyFileInfo = clone $fileInfo; + + foreach ($legacyFileInfo->getAllFuncInfos() as $funcInfo) { + $funcInfo->discardInfoForOldPhpVersions(); + } + foreach ($legacyFileInfo->getAllConstInfos() as $constInfo) { + $constInfo->discardInfoForOldPhpVersions(); + } + foreach ($legacyFileInfo->getAllPropertyInfos() as $propertyInfo) { + $propertyInfo->discardInfoForOldPhpVersions(); + } + + $arginfoCode = generateArgInfoCode( + basename($stubFilenameWithoutExtension), + $legacyFileInfo, + $context->allConstInfos, + $stubHash + ); + if (($context->forceRegeneration || $stubHash !== $oldStubHash) && file_put_contents($legacyFile, $arginfoCode)) { + echo "Saved $legacyFile\n"; + } + } + + return $fileInfo; + } catch (Exception $e) { + echo "In $stubFile:\n{$e->getMessage()}\n"; + exit(1); + } +} + +function computeStubHash(string $stubCode): string { + return sha1(str_replace("\r\n", "\n", $stubCode)); +} + +function extractStubHash(string $arginfoFile): ?string { + if (!file_exists($arginfoFile)) { + return null; + } + + $arginfoCode = file_get_contents($arginfoFile); + if (!preg_match('/\* Stub hash: ([0-9a-f]+) \*/', $arginfoCode, $matches)) { + return null; + } + + return $matches[1]; +} + +class Context { + public bool $forceParse = false; + public bool $forceRegeneration = false; + /** @var iterable */ + public iterable $allConstInfos = []; + /** @var FileInfo[] */ + public array $parsedFiles = []; +} + +class ArrayType extends SimpleType { + public Type $keyType; + public Type $valueType; + + public static function createGenericArray(): self + { + return new ArrayType(Type::fromString("int|string"), Type::fromString("mixed|ref")); + } + + public function __construct(Type $keyType, Type $valueType) + { + parent::__construct("array", true); + + $this->keyType = $keyType; + $this->valueType = $valueType; + } + + public function toOptimizerTypeMask(): string { + $typeMasks = [ + parent::toOptimizerTypeMask(), + $this->keyType->toOptimizerTypeMaskForArrayKey(), + $this->valueType->toOptimizerTypeMaskForArrayValue(), + ]; + + return implode("|", $typeMasks); + } + + public function equals(SimpleType $other): bool { + if (!parent::equals($other)) { + return false; + } + + assert(get_class($other) === self::class); + + return Type::equals($this->keyType, $other->keyType) && + Type::equals($this->valueType, $other->valueType); + } +} + +class SimpleType { + public string $name; + public bool $isBuiltin; + + public static function fromNode(Node $node): SimpleType { + if ($node instanceof Node\Name) { + if ($node->toLowerString() === 'static') { + // PHP internally considers "static" a builtin type. + return new SimpleType($node->toLowerString(), true); + } + + if ($node->toLowerString() === 'self') { + throw new Exception('The exact class name must be used instead of "self"'); + } + + assert($node->isFullyQualified()); + return new SimpleType($node->toString(), false); + } + + if ($node instanceof Node\Identifier) { + if ($node->toLowerString() === 'array') { + return ArrayType::createGenericArray(); + } + + return new SimpleType($node->toLowerString(), true); + } + + throw new Exception("Unexpected node type"); + } + + public static function fromString(string $typeString): SimpleType + { + switch (strtolower($typeString)) { + case "void": + case "null": + case "false": + case "true": + case "bool": + case "int": + case "float": + case "string": + case "callable": + case "object": + case "resource": + case "mixed": + case "static": + case "never": + case "ref": + return new SimpleType(strtolower($typeString), true); + case "array": + return ArrayType::createGenericArray(); + case "self": + throw new Exception('The exact class name must be used instead of "self"'); + case "iterable": + throw new Exception('This should not happen'); + } + + $matches = []; + $isArray = preg_match("/(.*)\s*\[\s*\]/", $typeString, $matches); + if ($isArray) { + return new ArrayType(Type::fromString("int"), Type::fromString($matches[1])); + } + + $matches = []; + $isArray = preg_match("/array\s*<\s*([A-Za-z0-9_|-]+)?(\s*,\s*)?([A-Za-z0-9_|-]+)?\s*>/i", $typeString, $matches); + if ($isArray) { + if (empty($matches[1]) || empty($matches[3])) { + throw new Exception("array<> type hint must have both a key and a value"); + } + + return new ArrayType(Type::fromString($matches[1]), Type::fromString($matches[3])); + } + + return new SimpleType($typeString, false); + } + + /** + * @param mixed $value + */ + public static function fromValue($value): SimpleType + { + switch (gettype($value)) { + case "NULL": + return SimpleType::null(); + case "boolean": + return SimpleType::bool(); + case "integer": + return SimpleType::int(); + case "double": + return SimpleType::float(); + case "string": + return SimpleType::string(); + case "array": + return SimpleType::array(); + case "object": + return SimpleType::object(); + default: + throw new Exception("Type \"" . gettype($value) . "\" cannot be inferred based on value"); + } + } + + public static function null(): SimpleType + { + return new SimpleType("null", true); + } + + public static function bool(): SimpleType + { + return new SimpleType("bool", true); + } + + public static function int(): SimpleType + { + return new SimpleType("int", true); + } + + public static function float(): SimpleType + { + return new SimpleType("float", true); + } + + public static function string(): SimpleType + { + return new SimpleType("string", true); + } + + public static function array(): SimpleType + { + return new SimpleType("array", true); + } + + public static function object(): SimpleType + { + return new SimpleType("object", true); + } + + public static function void(): SimpleType + { + return new SimpleType("void", true); + } + + protected function __construct(string $name, bool $isBuiltin) { + $this->name = $name; + $this->isBuiltin = $isBuiltin; + } + + public function isScalar(): bool { + return $this->isBuiltin && in_array($this->name, ["null", "false", "true", "bool", "int", "float"], true); + } + + public function isNull(): bool { + return $this->isBuiltin && $this->name === 'null'; + } + + public function isBool(): bool { + return $this->isBuiltin && $this->name === 'bool'; + } + + public function isInt(): bool { + return $this->isBuiltin && $this->name === 'int'; + } + + public function isFloat(): bool { + return $this->isBuiltin && $this->name === 'float'; + } + + public function isString(): bool { + return $this->isBuiltin && $this->name === 'string'; + } + + public function isArray(): bool { + return $this->isBuiltin && $this->name === 'array'; + } + + public function toTypeCode(): string { + assert($this->isBuiltin); + switch ($this->name) { + case "bool": + return "_IS_BOOL"; + case "int": + return "IS_LONG"; + case "float": + return "IS_DOUBLE"; + case "string": + return "IS_STRING"; + case "array": + return "IS_ARRAY"; + case "object": + return "IS_OBJECT"; + case "void": + return "IS_VOID"; + case "callable": + return "IS_CALLABLE"; + case "mixed": + return "IS_MIXED"; + case "static": + return "IS_STATIC"; + case "never": + return "IS_NEVER"; + case "null": + return "IS_NULL"; + case "false": + return "IS_FALSE"; + case "true": + return "IS_TRUE"; + default: + throw new Exception("Not implemented: $this->name"); + } + } + + public function toTypeMask(): string { + assert($this->isBuiltin); + + switch ($this->name) { + case "null": + return "MAY_BE_NULL"; + case "false": + return "MAY_BE_FALSE"; + case "true": + return "MAY_BE_TRUE"; + case "bool": + return "MAY_BE_BOOL"; + case "int": + return "MAY_BE_LONG"; + case "float": + return "MAY_BE_DOUBLE"; + case "string": + return "MAY_BE_STRING"; + case "array": + return "MAY_BE_ARRAY"; + case "object": + return "MAY_BE_OBJECT"; + case "callable": + return "MAY_BE_CALLABLE"; + case "mixed": + return "MAY_BE_ANY"; + case "void": + return "MAY_BE_VOID"; + case "static": + return "MAY_BE_STATIC"; + case "never": + return "MAY_BE_NEVER"; + default: + throw new Exception("Not implemented: $this->name"); + } + } + + public function toOptimizerTypeMaskForArrayKey(): string { + assert($this->isBuiltin); + + switch ($this->name) { + case "int": + return "MAY_BE_ARRAY_KEY_LONG"; + case "string": + return "MAY_BE_ARRAY_KEY_STRING"; + default: + throw new Exception("Type $this->name cannot be an array key"); + } + } + + public function toOptimizerTypeMaskForArrayValue(): string { + if (!$this->isBuiltin) { + return "MAY_BE_ARRAY_OF_OBJECT"; + } + + switch ($this->name) { + case "null": + return "MAY_BE_ARRAY_OF_NULL"; + case "false": + return "MAY_BE_ARRAY_OF_FALSE"; + case "true": + return "MAY_BE_ARRAY_OF_TRUE"; + case "bool": + return "MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE"; + case "int": + return "MAY_BE_ARRAY_OF_LONG"; + case "float": + return "MAY_BE_ARRAY_OF_DOUBLE"; + case "string": + return "MAY_BE_ARRAY_OF_STRING"; + case "array": + return "MAY_BE_ARRAY_OF_ARRAY"; + case "object": + return "MAY_BE_ARRAY_OF_OBJECT"; + case "resource": + return "MAY_BE_ARRAY_OF_RESOURCE"; + case "mixed": + return "MAY_BE_ARRAY_OF_ANY"; + case "ref": + return "MAY_BE_ARRAY_OF_REF"; + default: + throw new Exception("Type $this->name cannot be an array value"); + } + } + + public function toOptimizerTypeMask(): string { + if (!$this->isBuiltin) { + return "MAY_BE_OBJECT"; + } + + switch ($this->name) { + case "resource": + return "MAY_BE_RESOURCE"; + case "callable": + return "MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_OBJECT"; + case "iterable": + return "MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_OBJECT"; + case "mixed": + return "MAY_BE_ANY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY"; + } + + return $this->toTypeMask(); + } + + public function toEscapedName(): string { + // Escape backslashes, and also encode \u, \U, and \N to avoid compilation errors in generated macros + return str_replace( + ['\\', '\\u', '\\U', '\\N'], + ['\\\\', '\\\\165', '\\\\125', '\\\\116'], + $this->name + ); + } + + public function toVarEscapedName(): string { + return str_replace('\\', '_', $this->name); + } + + public function equals(SimpleType $other): bool { + return $this->name === $other->name && $this->isBuiltin === $other->isBuiltin; + } +} + +class Type { + /** @var SimpleType[] */ + public array $types; + public bool $isIntersection; + + public static function fromNode(Node $node): Type { + if ($node instanceof Node\UnionType || $node instanceof Node\IntersectionType) { + $nestedTypeObjects = array_map(['Type', 'fromNode'], $node->types); + $types = []; + foreach ($nestedTypeObjects as $typeObject) { + array_push($types, ...$typeObject->types); + } + return new Type($types, ($node instanceof Node\IntersectionType)); + } + + if ($node instanceof Node\NullableType) { + return new Type( + [ + ...Type::fromNode($node->type)->types, + SimpleType::null(), + ], + false + ); + } + + if ($node instanceof Node\Identifier && $node->toLowerString() === "iterable") { + return new Type( + [ + SimpleType::fromString("Traversable"), + ArrayType::createGenericArray(), + ], + false + ); + } + + return new Type([SimpleType::fromNode($node)], false); + } + + public static function fromString(string $typeString): self { + $typeString .= "|"; + $simpleTypes = []; + $simpleTypeOffset = 0; + $inArray = false; + $isIntersection = false; + + $typeStringLength = strlen($typeString); + for ($i = 0; $i < $typeStringLength; $i++) { + $char = $typeString[$i]; + + if ($char === "<") { + $inArray = true; + continue; + } + + if ($char === ">") { + $inArray = false; + continue; + } + + if ($inArray) { + continue; + } + + if ($char === "|" || $char === "&") { + $isIntersection = ($char === "&"); + $simpleTypeName = trim(substr($typeString, $simpleTypeOffset, $i - $simpleTypeOffset)); + + $simpleTypes[] = SimpleType::fromString($simpleTypeName); + + $simpleTypeOffset = $i + 1; + } + } + + return new Type($simpleTypes, $isIntersection); + } + + /** + * @param SimpleType[] $types + */ + private function __construct(array $types, bool $isIntersection) { + $this->types = $types; + $this->isIntersection = $isIntersection; + } + + public function isScalar(): bool { + foreach ($this->types as $type) { + if (!$type->isScalar()) { + return false; + } + } + + return true; + } + + public function isNullable(): bool { + foreach ($this->types as $type) { + if ($type->isNull()) { + return true; + } + } + + return false; + } + + public function getWithoutNull(): Type { + return new Type( + array_values( + array_filter( + $this->types, + function(SimpleType $type) { + return !$type->isNull(); + } + ) + ), + false + ); + } + + public function tryToSimpleType(): ?SimpleType { + $withoutNull = $this->getWithoutNull(); + /* type has only null */ + if (count($withoutNull->types) === 0) { + return $this->types[0]; + } + if (count($withoutNull->types) === 1) { + return $withoutNull->types[0]; + } + return null; + } + + public function toArginfoType(): ArginfoType { + $classTypes = []; + $builtinTypes = []; + foreach ($this->types as $type) { + if ($type->isBuiltin) { + $builtinTypes[] = $type; + } else { + $classTypes[] = $type; + } + } + return new ArginfoType($classTypes, $builtinTypes); + } + + public function toOptimizerTypeMask(): string { + $optimizerTypes = []; + + foreach ($this->types as $type) { + // TODO Support for toOptimizerMask for intersection + $optimizerTypes[] = $type->toOptimizerTypeMask(); + } + + return implode("|", $optimizerTypes); + } + + public function toOptimizerTypeMaskForArrayKey(): string { + $typeMasks = []; + + foreach ($this->types as $type) { + $typeMasks[] = $type->toOptimizerTypeMaskForArrayKey(); + } + + return implode("|", $typeMasks); + } + + public function toOptimizerTypeMaskForArrayValue(): string { + $typeMasks = []; + + foreach ($this->types as $type) { + $typeMasks[] = $type->toOptimizerTypeMaskForArrayValue(); + } + + return implode("|", $typeMasks); + } + + public function getTypeForDoc(DOMDocument $doc): DOMElement { + if (count($this->types) > 1) { + $typeSort = $this->isIntersection ? "intersection" : "union"; + $typeElement = $doc->createElement('type'); + $typeElement->setAttribute("class", $typeSort); + + foreach ($this->types as $type) { + $unionTypeElement = $doc->createElement('type', $type->name); + $typeElement->appendChild($unionTypeElement); + } + } else { + $type = $this->types[0]; + $name = $type->name; + + $typeElement = $doc->createElement('type', $name); + } + + return $typeElement; + } + + public static function equals(?Type $a, ?Type $b): bool { + if ($a === null || $b === null) { + return $a === $b; + } + + if (count($a->types) !== count($b->types)) { + return false; + } + + for ($i = 0; $i < count($a->types); $i++) { + if (!$a->types[$i]->equals($b->types[$i])) { + return false; + } + } + + return true; + } + + public function __toString() { + if ($this->types === null) { + return 'mixed'; + } + + $char = $this->isIntersection ? '&' : '|'; + return implode($char, array_map( + function ($type) { return $type->name; }, + $this->types) + ); + } +} + +class ArginfoType { + /** @var SimpleType[] $classTypes */ + public array $classTypes; + /** @var SimpleType[] $builtinTypes */ + private array $builtinTypes; + + /** + * @param SimpleType[] $classTypes + * @param SimpleType[] $builtinTypes + */ + public function __construct(array $classTypes, array $builtinTypes) { + $this->classTypes = $classTypes; + $this->builtinTypes = $builtinTypes; + } + + public function hasClassType(): bool { + return !empty($this->classTypes); + } + + public function toClassTypeString(): string { + return implode('|', array_map(function(SimpleType $type) { + return $type->toEscapedName(); + }, $this->classTypes)); + } + + public function toTypeMask(): string { + if (empty($this->builtinTypes)) { + return '0'; + } + return implode('|', array_map(function(SimpleType $type) { + return $type->toTypeMask(); + }, $this->builtinTypes)); + } +} + +class ArgInfo { + const SEND_BY_VAL = 0; + const SEND_BY_REF = 1; + const SEND_PREFER_REF = 2; + + public string $name; + public int $sendBy; + public bool $isVariadic; + public ?Type $type; + public ?Type $phpDocType; + public ?string $defaultValue; + /** @var AttributeInfo[] */ + public array $attributes; + + /** + * @param AttributeInfo[] $attributes + */ + public function __construct( + string $name, + int $sendBy, + bool $isVariadic, + ?Type $type, + ?Type $phpDocType, + ?string $defaultValue, + array $attributes + ) { + $this->name = $name; + $this->sendBy = $sendBy; + $this->isVariadic = $isVariadic; + $this->setTypes($type, $phpDocType); + $this->defaultValue = $defaultValue; + $this->attributes = $attributes; + } + + public function equals(ArgInfo $other): bool { + return $this->name === $other->name + && $this->sendBy === $other->sendBy + && $this->isVariadic === $other->isVariadic + && Type::equals($this->type, $other->type) + && $this->defaultValue === $other->defaultValue; + } + + public function getSendByString(): string { + switch ($this->sendBy) { + case self::SEND_BY_VAL: + return "0"; + case self::SEND_BY_REF: + return "1"; + case self::SEND_PREFER_REF: + return "ZEND_SEND_PREFER_REF"; + } + throw new Exception("Invalid sendBy value"); + } + + public function getMethodSynopsisType(): Type { + if ($this->type) { + return $this->type; + } + + if ($this->phpDocType) { + return $this->phpDocType; + } + + throw new Exception("A parameter must have a type"); + } + + public function hasProperDefaultValue(): bool { + return $this->defaultValue !== null && $this->defaultValue !== "UNKNOWN"; + } + + public function getDefaultValueAsArginfoString(): string { + if ($this->hasProperDefaultValue()) { + return '"' . addslashes($this->defaultValue) . '"'; + } + + return "NULL"; + } + + public function getDefaultValueAsMethodSynopsisString(): ?string { + if ($this->defaultValue === null) { + return null; + } + + switch ($this->defaultValue) { + case 'UNKNOWN': + return null; + case 'false': + case 'true': + case 'null': + return "&{$this->defaultValue};"; + } + + return $this->defaultValue; + } + + private function setTypes(?Type $type, ?Type $phpDocType): void + { + $this->type = $type; + $this->phpDocType = $phpDocType; + } +} + +interface VariableLikeName { + public function __toString(): string; + public function getDeclarationName(): string; +} + +interface ConstOrClassConstName extends VariableLikeName { + public function equals(ConstOrClassConstName $const): bool; + public function isClassConst(): bool; + public function isUnknown(): bool; +} + +abstract class AbstractConstName implements ConstOrClassConstName +{ + public function equals(ConstOrClassConstName $const): bool + { + return $this->__toString() === $const->__toString(); + } + + public function isUnknown(): bool + { + return strtolower($this->__toString()) === "unknown"; + } +} + +class ConstName extends AbstractConstName { + public string $const; + + public function __construct(?Name $namespace, string $const) + { + if ($namespace && ($namespace = $namespace->slice(0, -1))) { + $const = $namespace->toString() . '\\' . $const; + } + $this->const = $const; + } + + public function isClassConst(): bool + { + return false; + } + + public function isUnknown(): bool + { + $name = $this->__toString(); + if (($pos = strrpos($name, '\\')) !== false) { + $name = substr($name, $pos + 1); + } + return strtolower($name) === "unknown"; + } + + public function __toString(): string + { + return $this->const; + } + + public function getDeclarationName(): string + { + return $this->name->toString(); + } +} + +class ClassConstName extends AbstractConstName { + public Name $class; + public string $const; + + public function __construct(Name $class, string $const) + { + $this->class = $class; + $this->const = $const; + } + + public function isClassConst(): bool + { + return true; + } + + public function __toString(): string + { + return $this->class->toString() . "::" . $this->const; + } + + public function getDeclarationName(): string + { + return $this->const; + } +} + +class PropertyName implements VariableLikeName { + public Name $class; + public string $property; + + public function __construct(Name $class, string $property) + { + $this->class = $class; + $this->property = $property; + } + + public function __toString() + { + return $this->class->toString() . "::$" . $this->property; + } + + public function getDeclarationName(): string + { + return $this->property; + } +} + +interface FunctionOrMethodName { + public function getDeclaration(): string; + public function getArgInfoName(): string; + public function getMethodSynopsisFilename(): string; + public function getNameForAttributes(): string; + public function __toString(): string; + public function isMethod(): bool; + public function isConstructor(): bool; + public function isDestructor(): bool; +} + +class FunctionName implements FunctionOrMethodName { + private Name $name; + + public function __construct(Name $name) { + $this->name = $name; + } + + public function getNamespace(): ?string { + if ($this->name->isQualified()) { + return $this->name->slice(0, -1)->toString(); + } + return null; + } + + public function getNonNamespacedName(): string { + if ($this->name->isQualified()) { + throw new Exception("Namespaced name not supported here"); + } + return $this->name->toString(); + } + + public function getDeclarationName(): string { + return implode('_', $this->name->getParts()); + } + + public function getFunctionName(): string { + return $this->name->getLast(); + } + + public function getDeclaration(): string { + return "ZEND_FUNCTION({$this->getDeclarationName()});\n"; + } + + public function getArgInfoName(): string { + $underscoreName = implode('_', $this->name->getParts()); + return "arginfo_$underscoreName"; + } + + public function getMethodSynopsisFilename(): string { + return implode('_', $this->name->getParts()); + } + + public function getNameForAttributes(): string { + return strtolower($this->name->toString()); + } + + public function __toString(): string { + return $this->name->toString(); + } + + public function isMethod(): bool { + return false; + } + + public function isConstructor(): bool { + return false; + } + + public function isDestructor(): bool { + return false; + } +} + +class MethodName implements FunctionOrMethodName { + public Name $className; + public string $methodName; + + public function __construct(Name $className, string $methodName) { + $this->className = $className; + $this->methodName = $methodName; + } + + public function getDeclarationClassName(): string { + return implode('_', $this->className->getParts()); + } + + public function getDeclaration(): string { + return "ZEND_METHOD({$this->getDeclarationClassName()}, $this->methodName);\n"; + } + + public function getArgInfoName(): string { + return "arginfo_class_{$this->getDeclarationClassName()}_{$this->methodName}"; + } + + public function getMethodSynopsisFilename(): string { + return $this->getDeclarationClassName() . "_{$this->methodName}"; + } + + public function getNameForAttributes(): string { + return strtolower($this->methodName); + } + + public function __toString(): string { + return "$this->className::$this->methodName"; + } + + public function isMethod(): bool { + return true; + } + + public function isConstructor(): bool { + return $this->methodName === "__construct"; + } + + public function isDestructor(): bool { + return $this->methodName === "__destruct"; + } +} + +class ReturnInfo { + const REFCOUNT_0 = "0"; + const REFCOUNT_1 = "1"; + const REFCOUNT_N = "N"; + + const REFCOUNTS = [ + self::REFCOUNT_0, + self::REFCOUNT_1, + self::REFCOUNT_N, + ]; + + public bool $byRef; + public ?Type $type; + public ?Type $phpDocType; + public bool $tentativeReturnType; + public string $refcount; + + public function __construct(bool $byRef, ?Type $type, ?Type $phpDocType, bool $tentativeReturnType, ?string $refcount) { + $this->byRef = $byRef; + $this->setTypes($type, $phpDocType, $tentativeReturnType); + $this->setRefcount($refcount); + } + + public function equalsApartFromPhpDocAndRefcount(ReturnInfo $other): bool { + return $this->byRef === $other->byRef + && Type::equals($this->type, $other->type) + && $this->tentativeReturnType === $other->tentativeReturnType; + } + + public function getMethodSynopsisType(): ?Type { + return $this->type ?? $this->phpDocType; + } + + private function setTypes(?Type $type, ?Type $phpDocType, bool $tentativeReturnType): void + { + $this->type = $type; + $this->phpDocType = $phpDocType; + $this->tentativeReturnType = $tentativeReturnType; + } + + private function setRefcount(?string $refcount): void + { + $type = $this->phpDocType ?? $this->type; + $isScalarType = $type !== null && $type->isScalar(); + + if ($refcount === null) { + $this->refcount = $isScalarType ? self::REFCOUNT_0 : self::REFCOUNT_N; + return; + } + + if (!in_array($refcount, ReturnInfo::REFCOUNTS, true)) { + throw new Exception("@refcount must have one of the following values: \"0\", \"1\", \"N\", $refcount given"); + } + + if ($isScalarType && $refcount !== self::REFCOUNT_0) { + throw new Exception('A scalar return type of "' . $type->__toString() . '" must have a refcount of "' . self::REFCOUNT_0 . '"'); + } + + if (!$isScalarType && $refcount === self::REFCOUNT_0) { + throw new Exception('A non-scalar return type of "' . $type->__toString() . '" cannot have a refcount of "' . self::REFCOUNT_0 . '"'); + } + + $this->refcount = $refcount; + } +} + +class FuncInfo { + public FunctionOrMethodName $name; + public int $classFlags; + public int $flags; + public ?string $aliasType; + public ?FunctionOrMethodName $alias; + public bool $isDeprecated; + public bool $supportsCompileTimeEval; + public bool $verify; + /** @var ArgInfo[] */ + public array $args; + public ReturnInfo $return; + public int $numRequiredArgs; + public ?string $cond; + public bool $isUndocumentable; + /** @var AttributeInfo[] */ + public array $attributes; + + /** + * @param AttributeInfo[] $attributes + * @param ArgInfo[] $args + */ + public function __construct( + FunctionOrMethodName $name, + int $classFlags, + int $flags, + ?string $aliasType, + ?FunctionOrMethodName $alias, + bool $isDeprecated, + bool $supportsCompileTimeEval, + bool $verify, + array $args, + ReturnInfo $return, + int $numRequiredArgs, + ?string $cond, + bool $isUndocumentable, + array $attributes + ) { + $this->name = $name; + $this->classFlags = $classFlags; + $this->flags = $flags; + $this->aliasType = $aliasType; + $this->alias = $alias; + $this->isDeprecated = $isDeprecated; + $this->supportsCompileTimeEval = $supportsCompileTimeEval; + $this->verify = $verify; + $this->args = $args; + $this->return = $return; + $this->numRequiredArgs = $numRequiredArgs; + $this->cond = $cond; + $this->isUndocumentable = $isUndocumentable; + $this->attributes = $attributes; + } + + public function isMethod(): bool + { + return $this->name->isMethod(); + } + + public function isFinalMethod(): bool + { + return ($this->flags & Class_::MODIFIER_FINAL) || ($this->classFlags & Class_::MODIFIER_FINAL); + } + + public function isInstanceMethod(): bool + { + return !($this->flags & Class_::MODIFIER_STATIC) && $this->isMethod() && !$this->name->isConstructor(); + } + + /** @return string[] */ + public function getModifierNames(): array + { + if (!$this->isMethod()) { + return []; + } + + $result = []; + + if ($this->flags & Class_::MODIFIER_FINAL) { + $result[] = "final"; + } elseif ($this->flags & Class_::MODIFIER_ABSTRACT && $this->classFlags & ~Class_::MODIFIER_ABSTRACT) { + $result[] = "abstract"; + } + + if ($this->flags & Class_::MODIFIER_PROTECTED) { + $result[] = "protected"; + } elseif ($this->flags & Class_::MODIFIER_PRIVATE) { + $result[] = "private"; + } else { + $result[] = "public"; + } + + if ($this->flags & Class_::MODIFIER_STATIC) { + $result[] = "static"; + } + + return $result; + } + + public function hasParamWithUnknownDefaultValue(): bool + { + foreach ($this->args as $arg) { + if ($arg->defaultValue && !$arg->hasProperDefaultValue()) { + return true; + } + } + + return false; + } + + public function equalsApartFromNameAndRefcount(FuncInfo $other): bool { + if (count($this->args) !== count($other->args)) { + return false; + } + + for ($i = 0; $i < count($this->args); $i++) { + if (!$this->args[$i]->equals($other->args[$i])) { + return false; + } + } + + return $this->return->equalsApartFromPhpDocAndRefcount($other->return) + && $this->numRequiredArgs === $other->numRequiredArgs + && $this->cond === $other->cond; + } + + public function getArgInfoName(): string { + return $this->name->getArgInfoName(); + } + + public function getDeclarationKey(): string + { + $name = $this->alias ?? $this->name; + + return "$name|$this->cond"; + } + + public function getDeclaration(): ?string + { + if ($this->flags & Class_::MODIFIER_ABSTRACT) { + return null; + } + + $name = $this->alias ?? $this->name; + + return $name->getDeclaration(); + } + + public function getFunctionEntry(): string { + if ($this->name instanceof MethodName) { + if ($this->alias) { + if ($this->alias instanceof MethodName) { + return sprintf( + "\tZEND_MALIAS(%s, %s, %s, %s, %s)\n", + $this->alias->getDeclarationClassName(), $this->name->methodName, + $this->alias->methodName, $this->getArgInfoName(), $this->getFlagsAsArginfoString() + ); + } else if ($this->alias instanceof FunctionName) { + return sprintf( + "\tZEND_ME_MAPPING(%s, %s, %s, %s)\n", + $this->name->methodName, $this->alias->getNonNamespacedName(), + $this->getArgInfoName(), $this->getFlagsAsArginfoString() + ); + } else { + throw new Error("Cannot happen"); + } + } else { + $declarationClassName = $this->name->getDeclarationClassName(); + if ($this->flags & Class_::MODIFIER_ABSTRACT) { + return sprintf( + "\tZEND_ABSTRACT_ME_WITH_FLAGS(%s, %s, %s, %s)\n", + $declarationClassName, $this->name->methodName, $this->getArgInfoName(), + $this->getFlagsAsArginfoString() + ); + } + + return sprintf( + "\tZEND_ME(%s, %s, %s, %s)\n", + $declarationClassName, $this->name->methodName, $this->getArgInfoName(), + $this->getFlagsAsArginfoString() + ); + } + } else if ($this->name instanceof FunctionName) { + $namespace = $this->name->getNamespace(); + $functionName = $this->name->getFunctionName(); + $declarationName = $this->alias ? $this->alias->getNonNamespacedName() : $this->name->getDeclarationName(); + + if ($namespace) { + // Namespaced functions are always declared as aliases to avoid name conflicts when two functions with + // the same name exist in separate namespaces + $macro = $this->isDeprecated ? 'ZEND_NS_DEP_FALIAS' : 'ZEND_NS_FALIAS'; + + // Render A\B as "A\\B" in C strings for namespaces + return sprintf( + "\t%s(\"%s\", %s, %s, %s)\n", + $macro, addslashes($namespace), $this->name->getFunctionName(), $declarationName, $this->getArgInfoName() + ); + } + + if ($this->alias) { + $macro = $this->isDeprecated ? 'ZEND_DEP_FALIAS' : 'ZEND_FALIAS'; + + return sprintf( + "\t%s(%s, %s, %s)\n", + $macro, $functionName, $declarationName, $this->getArgInfoName() + ); + } + + switch (true) { + case $this->isDeprecated: + $macro = 'ZEND_DEP_FE'; + break; + case $this->supportsCompileTimeEval: + $macro = 'ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE'; + break; + default: + $macro = 'ZEND_FE'; + } + + return sprintf("\t%s(%s, %s)\n", $macro, $functionName, $this->getArgInfoName()); + } else { + throw new Error("Cannot happen"); + } + } + + public function getOptimizerInfo(): ?string { + if ($this->isMethod()) { + return null; + } + + if ($this->alias !== null) { + return null; + } + + if ($this->return->refcount !== ReturnInfo::REFCOUNT_1 && $this->return->phpDocType === null) { + return null; + } + + $type = $this->return->phpDocType ?? $this->return->type; + if ($type === null) { + return null; + } + + return "\tF" . $this->return->refcount . '("' . $this->name->__toString() . '", ' . $type->toOptimizerTypeMask() . "),\n"; + } + + public function discardInfoForOldPhpVersions(): void { + $this->attributes = []; + $this->return->type = null; + foreach ($this->args as $arg) { + $arg->type = null; + $arg->defaultValue = null; + $arg->attributes = []; + } + } + + private function getFlagsAsArginfoString(): string + { + $flags = "ZEND_ACC_PUBLIC"; + if ($this->flags & Class_::MODIFIER_PROTECTED) { + $flags = "ZEND_ACC_PROTECTED"; + } elseif ($this->flags & Class_::MODIFIER_PRIVATE) { + $flags = "ZEND_ACC_PRIVATE"; + } + + if ($this->flags & Class_::MODIFIER_STATIC) { + $flags .= "|ZEND_ACC_STATIC"; + } + + if ($this->flags & Class_::MODIFIER_FINAL) { + $flags .= "|ZEND_ACC_FINAL"; + } + + if ($this->flags & Class_::MODIFIER_ABSTRACT) { + $flags .= "|ZEND_ACC_ABSTRACT"; + } + + if ($this->isDeprecated) { + $flags .= "|ZEND_ACC_DEPRECATED"; + } + + return $flags; + } + + /** + * @param array $funcMap + * @param array $aliasMap + * @throws Exception + */ + public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?string { + + $doc = new DOMDocument(); + $doc->formatOutput = true; + $methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc); + if (!$methodSynopsis) { + return null; + } + + $doc->appendChild($methodSynopsis); + + return $doc->saveXML(); + } + + /** + * @param array $funcMap + * @param array $aliasMap + * @throws Exception + */ + public function getMethodSynopsisElement(array $funcMap, array $aliasMap, DOMDocument $doc): ?DOMElement { + if ($this->hasParamWithUnknownDefaultValue()) { + return null; + } + + if ($this->name->isConstructor()) { + $synopsisType = "constructorsynopsis"; + } elseif ($this->name->isDestructor()) { + $synopsisType = "destructorsynopsis"; + } else { + $synopsisType = "methodsynopsis"; + } + + $methodSynopsis = $doc->createElement($synopsisType); + + if ($this->isMethod()) { + assert($this->name instanceof MethodName); + $role = $doc->createAttribute("role"); + $role->value = addslashes($this->name->className->__toString()); + $methodSynopsis->appendChild($role); + } + + $methodSynopsis->appendChild(new DOMText("\n ")); + + foreach ($this->getModifierNames() as $modifierString) { + $modifierElement = $doc->createElement('modifier', $modifierString); + $methodSynopsis->appendChild($modifierElement); + $methodSynopsis->appendChild(new DOMText(" ")); + } + + $returnType = $this->return->getMethodSynopsisType(); + if ($returnType) { + $methodSynopsis->appendChild($returnType->getTypeForDoc($doc)); + } + + $methodname = $doc->createElement('methodname', $this->name->__toString()); + $methodSynopsis->appendChild($methodname); + + if (empty($this->args)) { + $methodSynopsis->appendChild(new DOMText("\n ")); + $void = $doc->createElement('void'); + $methodSynopsis->appendChild($void); + } else { + foreach ($this->args as $arg) { + $methodSynopsis->appendChild(new DOMText("\n ")); + $methodparam = $doc->createElement('methodparam'); + if ($arg->defaultValue !== null) { + $methodparam->setAttribute("choice", "opt"); + } + if ($arg->isVariadic) { + $methodparam->setAttribute("rep", "repeat"); + } + + $methodSynopsis->appendChild($methodparam); + $methodparam->appendChild($arg->getMethodSynopsisType()->getTypeForDoc($doc)); + + $parameter = $doc->createElement('parameter', $arg->name); + if ($arg->sendBy !== ArgInfo::SEND_BY_VAL) { + $parameter->setAttribute("role", "reference"); + } + + $methodparam->appendChild($parameter); + $defaultValue = $arg->getDefaultValueAsMethodSynopsisString(); + if ($defaultValue !== null) { + $initializer = $doc->createElement('initializer'); + if (preg_match('/^[a-zA-Z_][a-zA-Z_0-9]*$/', $defaultValue)) { + $constant = $doc->createElement('constant', $defaultValue); + $initializer->appendChild($constant); + } else { + $initializer->nodeValue = $defaultValue; + } + $methodparam->appendChild($initializer); + } + } + } + $methodSynopsis->appendChild(new DOMText("\n ")); + + return $methodSynopsis; + } + + public function __clone() + { + foreach ($this->args as $key => $argInfo) { + $this->args[$key] = clone $argInfo; + } + $this->return = clone $this->return; + } +} + +class EvaluatedValue +{ + /** @var mixed */ + public $value; + public SimpleType $type; + public Expr $expr; + public bool $isUnknownConstValue; + /** @var ConstInfo[] */ + public array $originatingConsts; + + /** + * @param iterable $allConstInfos + */ + public static function createFromExpression(Expr $expr, ?SimpleType $constType, ?string $cConstName, iterable $allConstInfos): EvaluatedValue + { + // This visitor replaces the PHP constants by C constants. It allows direct expansion of the compiled constants, e.g. later in the pretty printer. + $visitor = new class($allConstInfos) extends PhpParser\NodeVisitorAbstract + { + /** @var iterable */ + public array $visitedConstants = []; + /** @var iterable */ + public iterable $allConstInfos; + + /** @param iterable $allConstInfos */ + public function __construct(iterable $allConstInfos) + { + $this->allConstInfos = $allConstInfos; + } + + /** @return Node|null */ + public function enterNode(Node $expr) + { + if (!$expr instanceof Expr\ConstFetch && !$expr instanceof Expr\ClassConstFetch) { + return null; + } + + if ($expr instanceof Expr\ClassConstFetch) { + $originatingConstName = new ClassConstName($expr->class, $expr->name->toString()); + } else { + $originatingConstName = new ConstName($expr->name->getAttribute('namespacedName'), $expr->name->toString()); + } + + if ($originatingConstName->isUnknown()) { + return null; + } + + foreach ($this->allConstInfos as $const) { + if ($originatingConstName->equals($const->name)) { + $this->visitedConstants[] = $const; + return $const->getValue($this->allConstInfos)->expr; + } + } + } + }; + + $nodeTraverser = new PhpParser\NodeTraverser; + $nodeTraverser->addVisitor($visitor); + $expr = $nodeTraverser->traverse([$expr])[0]; + + $isUnknownConstValue = false; + + $evaluator = new ConstExprEvaluator( + static function (Expr $expr) use ($allConstInfos, &$isUnknownConstValue) { + // $expr is a ConstFetch with a name of a C macro here + if (!$expr instanceof Expr\ConstFetch) { + throw new Exception($this->getVariableTypeName() . " " . $this->name->__toString() . " has an unsupported value"); + } + + $constName = $expr->name->__toString(); + if (strtolower($constName) === "unknown") { + $isUnknownConstValue = true; + return null; + } + + foreach ($allConstInfos as $const) { + if ($constName != $const->cValue) { + continue; + } + + $constType = ($const->phpDocType ?? $const->type)->tryToSimpleType(); + if ($constType) { + if ($constType->isBool()) { + return true; + } elseif ($constType->isInt()) { + return 1; + } elseif ($constType->isFloat()) { + return M_PI; + } elseif ($constType->isString()) { + return $const->name; + } elseif ($constType->isArray()) { + return []; + } + } + + return null; + } + + throw new Exception("Constant " . $originatingConstName->__toString() . " cannot be found"); + } + ); + + $result = $evaluator->evaluateDirectly($expr); + + return new EvaluatedValue( + $result, // note: we are generally not interested in the actual value of $result, unless it's a bare value, without constants + $constType ?? SimpleType::fromValue($result), + $cConstName === null ? $expr : new Expr\ConstFetch(new Node\Name($cConstName)), + $visitor->visitedConstants, + $isUnknownConstValue + ); + } + + public static function null(): EvaluatedValue + { + return new self(null, SimpleType::null(), new Expr\ConstFetch(new Node\Name('null')), [], false); + } + + /** + * @param mixed $value + * @param ConstInfo[] $originatingConsts + */ + private function __construct($value, SimpleType $type, Expr $expr, array $originatingConsts, bool $isUnknownConstValue) + { + $this->value = $value; + $this->type = $type; + $this->expr = $expr; + $this->originatingConsts = $originatingConsts; + $this->isUnknownConstValue = $isUnknownConstValue; + } + + public function initializeZval(string $zvalName): string + { + $cExpr = $this->getCExpr(); + + $code = "\tzval $zvalName;\n"; + + if ($this->type->isNull()) { + $code .= "\tZVAL_NULL(&$zvalName);\n"; + } elseif ($this->type->isBool()) { + if ($cExpr == 'true') { + $code .= "\tZVAL_TRUE(&$zvalName);\n"; + } elseif ($cExpr == 'false') { + $code .= "\tZVAL_FALSE(&$zvalName);\n"; + } else { + $code .= "\tZVAL_BOOL(&$zvalName, $cExpr);\n"; + } + } elseif ($this->type->isInt()) { + $code .= "\tZVAL_LONG(&$zvalName, $cExpr);\n"; + } elseif ($this->type->isFloat()) { + $code .= "\tZVAL_DOUBLE(&$zvalName, $cExpr);\n"; + } elseif ($this->type->isString()) { + if ($cExpr === '""') { + $code .= "\tZVAL_EMPTY_STRING(&$zvalName);\n"; + } else { + $code .= "\tzend_string *{$zvalName}_str = zend_string_init($cExpr, strlen($cExpr), 1);\n"; + $code .= "\tZVAL_STR(&$zvalName, {$zvalName}_str);\n"; + } + } elseif ($this->type->isArray()) { + if ($cExpr == '[]') { + $code .= "\tZVAL_EMPTY_ARRAY(&$zvalName);\n"; + } else { + throw new Exception("Unimplemented default value"); + } + } else { + throw new Exception("Invalid default value: " . print_r($this->value, true) . ", type: " . print_r($this->type, true)); + } + + return $code; + } + + public function getCExpr(): ?string + { + // $this->expr has all its PHP constants replaced by C constants + $prettyPrinter = new Standard; + $expr = $prettyPrinter->prettyPrintExpr($this->expr); + // PHP single-quote to C double-quote string + if ($this->type->isString()) { + $expr = preg_replace("/(^'|'$)/", '"', $expr); + } + return $expr[0] == '"' ? $expr : preg_replace('(\bnull\b)', 'NULL', str_replace('\\', '', $expr)); + } +} + +abstract class VariableLike +{ + public int $flags; + public ?Type $type; + public ?Type $phpDocType; + public ?string $link; + public ?int $phpVersionIdMinimumCompatibility; + /** @var AttributeInfo[] */ + public array $attributes; + + /** + * @var AttributeInfo[] $attributes + */ + public function __construct( + int $flags, + ?Type $type, + ?Type $phpDocType, + ?string $link, + ?int $phpVersionIdMinimumCompatibility, + array $attributes + ) { + $this->flags = $flags; + $this->type = $type; + $this->phpDocType = $phpDocType; + $this->link = $link; + $this->phpVersionIdMinimumCompatibility = $phpVersionIdMinimumCompatibility; + $this->attributes = $attributes; + } + + abstract protected function getVariableTypeCode(): string; + + abstract protected function getVariableTypeName(): string; + + abstract protected function getFieldSynopsisDefaultLinkend(): string; + + abstract protected function getFieldSynopsisName(): string; + + /** + * @param iterable $allConstInfos + */ + abstract protected function getFieldSynopsisValueString(iterable $allConstInfos): ?string; + + abstract public function discardInfoForOldPhpVersions(): void; + + protected function addTypeToFieldSynopsis(DOMDocument $doc, DOMElement $fieldsynopsisElement): void + { + $type = $this->phpDocType ?? $this->type; + + if ($type) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($type->getTypeForDoc($doc)); + } + } + + /** + * @return array + */ + protected function getFlagsByPhpVersion(): array + { + $flags = "ZEND_ACC_PUBLIC"; + if ($this->flags & Class_::MODIFIER_PROTECTED) { + $flags = "ZEND_ACC_PROTECTED"; + } elseif ($this->flags & Class_::MODIFIER_PRIVATE) { + $flags = "ZEND_ACC_PRIVATE"; + } + + return [ + PHP_70_VERSION_ID => [$flags], + PHP_80_VERSION_ID => [$flags], + PHP_81_VERSION_ID => [$flags], + PHP_82_VERSION_ID => [$flags], + PHP_83_VERSION_ID => [$flags], + ]; + } + + protected function getTypeCode(string $variableLikeName, string &$code): string + { + $variableLikeType = $this->getVariableTypeName(); + + $typeCode = ""; + if ($this->type) { + $arginfoType = $this->type->toArginfoType(); + if ($arginfoType->hasClassType()) { + if (count($arginfoType->classTypes) >= 2) { + foreach ($arginfoType->classTypes as $classType) { + $escapedClassName = $classType->toEscapedName(); + $varEscapedClassName = $classType->toVarEscapedName(); + $code .= "\tzend_string *{$variableLikeType}_{$variableLikeName}_class_{$varEscapedClassName} = zend_string_init(\"{$escapedClassName}\", sizeof(\"{$escapedClassName}\") - 1, 1);\n"; + } + + $classTypeCount = count($arginfoType->classTypes); + $code .= "\tzend_type_list *{$variableLikeType}_{$variableLikeName}_type_list = malloc(ZEND_TYPE_LIST_SIZE($classTypeCount));\n"; + $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->num_types = $classTypeCount;\n"; + + foreach ($arginfoType->classTypes as $k => $classType) { + $escapedClassName = $classType->toEscapedName(); + $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$escapedClassName}, 0, 0);\n"; + } + + $typeMaskCode = $this->type->toArginfoType()->toTypeMask(); + + if ($this->type->isIntersection) { + $code .= "\tzend_type {$variableLikeType}_{$variableLikeName}_type = ZEND_TYPE_INIT_INTERSECTION({$variableLikeType}_{$variableLikeName}_type_list, $typeMaskCode);\n"; + } else { + $code .= "\tzend_type {$variableLikeType}_{$variableLikeName}_type = ZEND_TYPE_INIT_UNION({$variableLikeType}_{$variableLikeName}_type_list, $typeMaskCode);\n"; + } + $typeCode = "{$variableLikeType}_{$variableLikeName}_type"; + } else { + $escapedClassName = $arginfoType->classTypes[0]->toEscapedName(); + $varEscapedClassName = $arginfoType->classTypes[0]->toVarEscapedName(); + $code .= "\tzend_string *{$variableLikeType}_{$variableLikeName}_class_{$varEscapedClassName} = zend_string_init(\"{$escapedClassName}\", sizeof(\"{$escapedClassName}\")-1, 1);\n"; + + $typeCode = "(zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$varEscapedClassName}, 0, " . $arginfoType->toTypeMask() . ")"; + } + } else { + $typeCode = "(zend_type) ZEND_TYPE_INIT_MASK(" . $arginfoType->toTypeMask() . ")"; + } + } else { + $typeCode = "(zend_type) ZEND_TYPE_INIT_NONE(0)"; + } + + return $typeCode; + } + + /** + * @param iterable $allConstInfos + */ + public function getFieldSynopsisElement(DOMDocument $doc, iterable $allConstInfos): DOMElement + { + $fieldsynopsisElement = $doc->createElement("fieldsynopsis"); + + $this->addModifiersToFieldSynopsis($doc, $fieldsynopsisElement); + + $this->addTypeToFieldSynopsis($doc, $fieldsynopsisElement); + + $varnameElement = $doc->createElement("varname", $this->getFieldSynopsisName()); + if ($this->link) { + $varnameElement->setAttribute("linkend", $this->link); + } else { + $varnameElement->setAttribute("linkend", $this->getFieldSynopsisDefaultLinkend()); + } + + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($varnameElement); + + $valueString = $this->getFieldSynopsisValueString($allConstInfos); + if ($valueString) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $initializerElement = $doc->createElement("initializer", $valueString); + $fieldsynopsisElement->appendChild($initializerElement); + } + + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + + return $fieldsynopsisElement; + } + + protected function addModifiersToFieldSynopsis(DOMDocument $doc, DOMElement $fieldsynopsisElement): void + { + if ($this->flags & Class_::MODIFIER_PUBLIC) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "public")); + } elseif ($this->flags & Class_::MODIFIER_PROTECTED) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "protected")); + } elseif ($this->flags & Class_::MODIFIER_PRIVATE) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "private")); + } + } + + /** + * @param array $flags + * @return array + */ + protected function addFlagForVersionsAbove(array $flags, string $flag, int $minimumVersionId): array + { + $write = false; + + foreach ($flags as $version => $versionFlags) { + if ($version === $minimumVersionId || $write === true) { + $flags[$version][] = $flag; + $write = true; + } + } + + return $flags; + } +} + +class ConstInfo extends VariableLike +{ + public ConstOrClassConstName $name; + public Expr $value; + public bool $isDeprecated; + public ?string $valueString; + public ?string $cond; + public ?string $cValue; + + /** + * @var AttributeInfo[] $attributes + */ + public function __construct( + ConstOrClassConstName $name, + int $flags, + Expr $value, + ?string $valueString, + ?Type $type, + ?Type $phpDocType, + bool $isDeprecated, + ?string $cond, + ?string $cValue, + ?string $link, + ?int $phpVersionIdMinimumCompatibility, + array $attributes + ) { + $this->name = $name; + $this->value = $value; + $this->valueString = $valueString; + $this->isDeprecated = $isDeprecated; + $this->cond = $cond; + $this->cValue = $cValue; + parent::__construct($flags, $type, $phpDocType, $link, $phpVersionIdMinimumCompatibility, $attributes); + } + + /** + * @param iterable $allConstInfos + */ + public function getValue(iterable $allConstInfos): EvaluatedValue + { + return EvaluatedValue::createFromExpression( + $this->value, + ($this->phpDocType ?? $this->type)->tryToSimpleType(), + $this->cValue, + $allConstInfos + ); + } + + protected function getVariableTypeName(): string + { + return "constant"; + } + + protected function getVariableTypeCode(): string + { + return "const"; + } + + protected function getFieldSynopsisDefaultLinkend(): string + { + $className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString()); + + return "$className.constants." . strtolower(str_replace("_", "-", $this->name->getDeclarationName())); + } + + protected function getFieldSynopsisName(): string + { + return $this->name->__toString(); + } + + /** + * @param iterable $allConstInfos + */ + protected function getFieldSynopsisValueString(iterable $allConstInfos): ?string + { + $value = EvaluatedValue::createFromExpression($this->value, null, $this->cValue, $allConstInfos); + if ($value->isUnknownConstValue) { + return null; + } + + if ($value->originatingConsts) { + return implode("\n", array_map(function (ConstInfo $const) use ($allConstInfos) { + return $const->getFieldSynopsisValueString($allConstInfos); + }, $value->originatingConsts)); + } + + return $this->valueString; + } + + public function discardInfoForOldPhpVersions(): void { + $this->type = null; + $this->flags &= ~Class_::MODIFIER_FINAL; + $this->isDeprecated = false; + $this->attributes = []; + } + + /** + * @param iterable $allConstInfos + */ + public function getDeclaration(iterable $allConstInfos): string + { + $simpleType = ($this->phpDocType ?? $this->type)->tryToSimpleType(); + if ($simpleType && $simpleType->name === "mixed") { + $simpleType = null; + } + + $value = EvaluatedValue::createFromExpression($this->value, $simpleType, $this->cValue, $allConstInfos); + if ($value->isUnknownConstValue && ($simpleType === null || !$simpleType->isBuiltin)) { + throw new Exception("Constant " . $this->name->__toString() . " must have a built-in PHPDoc type as the type couldn't be inferred from its value"); + } + + // i.e. const NAME = UNKNOWN;, without the annotation + if ($value->isUnknownConstValue && $this->cValue === null && $value->expr instanceof Expr\ConstFetch && $value->expr->name->__toString() === "UNKNOWN") { + throw new Exception("Constant " . $this->name->__toString() . " must have a @cvalue annotation"); + } + + $code = ""; + + if ($this->cond) { + $code .= "#if {$this->cond}\n"; + } + + if ($this->name->isClassConst()) { + $code .= $this->getClassConstDeclaration($value, $allConstInfos); + } else { + $code .= $this->getGlobalConstDeclaration($value, $allConstInfos); + } + $code .= $this->getValueAssertion($value); + + if ($this->cond) { + $code .= "#endif\n"; + } + + return $code; + } + + /** + * @param iterable $allConstInfos + */ + private function getGlobalConstDeclaration(EvaluatedValue $value, iterable $allConstInfos): string + { + $constName = str_replace('\\', '\\\\', $this->name->__toString()); + $constValue = $value->value; + $cExpr = $value->getCExpr(); + + $flags = "CONST_PERSISTENT"; + if ($this->phpVersionIdMinimumCompatibility !== null && $this->phpVersionIdMinimumCompatibility < 80000) { + $flags .= " | CONST_CS"; + } + + if ($this->isDeprecated) { + $flags .= " | CONST_DEPRECATED"; + } + if ($value->type->isNull()) { + return "\tREGISTER_NULL_CONSTANT(\"$constName\", $flags);\n"; + } + + if ($value->type->isBool()) { + return "\tREGISTER_BOOL_CONSTANT(\"$constName\", " . ($cExpr ?: ($constValue ? "true" : "false")) . ", $flags);\n"; + } + + if ($value->type->isInt()) { + return "\tREGISTER_LONG_CONSTANT(\"$constName\", " . ($cExpr ?: (int) $constValue) . ", $flags);\n"; + } + + if ($value->type->isFloat()) { + return "\tREGISTER_DOUBLE_CONSTANT(\"$constName\", " . ($cExpr ?: (float) $constValue) . ", $flags);\n"; + } + + if ($value->type->isString()) { + return "\tREGISTER_STRING_CONSTANT(\"$constName\", " . ($cExpr ?: '"' . addslashes($constValue) . '"') . ", $flags);\n"; + } + + throw new Exception("Unimplemented constant type");} + + /** + * @param iterable $allConstInfos + */ + private function getClassConstDeclaration(EvaluatedValue $value, iterable $allConstInfos): string + { + $constName = $this->name->getDeclarationName(); + + $zvalCode = $value->initializeZval("const_{$constName}_value", $allConstInfos); + + $code = "\n" . $zvalCode; + + $code .= "\tzend_string *const_{$constName}_name = zend_string_init_interned(\"$constName\", sizeof(\"$constName\") - 1, 1);\n"; + $nameCode = "const_{$constName}_name"; + + $php83MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >= PHP_83_VERSION_ID; + + if ($this->type && !$php83MinimumCompatibility) { + $code .= "#if (PHP_VERSION_ID >= " . PHP_83_VERSION_ID . ")\n"; + } + + if ($this->type) { + $typeCode = $this->getTypeCode($constName, $code); + + if (!empty($this->attributes)) { + $template = "\tzend_class_constant *const_" . $this->name->getDeclarationName() . " = "; + } else { + $template = "\t"; + } + $template .= "zend_declare_typed_class_constant(class_entry, $nameCode, &const_{$constName}_value, %s, NULL, $typeCode);\n"; + + $flagsCode = generateVersionDependentFlagCode( + $template, + $this->getFlagsByPhpVersion(), + $this->phpVersionIdMinimumCompatibility + ); + $code .= implode("", $flagsCode); + } + + if ($this->type && !$php83MinimumCompatibility) { + $code .= "#else\n"; + } + + if (!$this->type || !$php83MinimumCompatibility) { + if (!empty($this->attributes)) { + $template = "\tzend_class_constant *const_" . $this->name->getDeclarationName() . " = "; + } else { + $template = "\t"; + } + $template .= "zend_declare_class_constant_ex(class_entry, $nameCode, &const_{$constName}_value, %s, NULL);\n"; + $flagsCode = generateVersionDependentFlagCode( + $template, + $this->getFlagsByPhpVersion(), + $this->phpVersionIdMinimumCompatibility + ); + $code .= implode("", $flagsCode); + } + + if ($this->type && !$php83MinimumCompatibility) { + $code .= "#endif\n"; + } + + $code .= "\tzend_string_release(const_{$constName}_name);\n"; + + return $code; + } + + private function getValueAssertion(EvaluatedValue $value): string + { + if ($value->isUnknownConstValue || $value->originatingConsts || $this->cValue === null) { + return ""; + } + + $cExpr = $value->getCExpr(); + $constValue = $value->value; + + if ($value->type->isNull()) { + return "\tZEND_ASSERT($cExpr == NULL);\n"; + } + + if ($value->type->isBool()) { + $cValue = $constValue ? "true" : "false"; + return "\tZEND_ASSERT($cExpr == $cValue);\n"; + } + + if ($value->type->isInt()) { + $cValue = (int) $constValue; + return "\tZEND_ASSERT($cExpr == $cValue);\n"; + } + + if ($value->type->isFloat()) { + $cValue = (float) $constValue; + return "\tZEND_ASSERT($cExpr == $cValue);\n"; + } + + if ($value->type->isString()) { + $cValue = '"' . addslashes($constValue) . '"'; + return "\tZEND_ASSERT(strcmp($cExpr, $cValue) == 0);\n"; + } + + throw new Exception("Unimplemented constant type"); + } + + /** + * @return array + */ + protected function getFlagsByPhpVersion(): array + { + $flags = parent::getFlagsByPhpVersion(); + + if ($this->isDeprecated) { + $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID); + } + + if ($this->flags & Class_::MODIFIER_FINAL) { + $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_FINAL", PHP_81_VERSION_ID); + } + + return $flags; + } + + protected function addModifiersToFieldSynopsis(DOMDocument $doc, DOMElement $fieldsynopsisElement): void + { + parent::addModifiersToFieldSynopsis($doc, $fieldsynopsisElement); + + if ($this->flags & Class_::MODIFIER_FINAL) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "final")); + } + + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "const")); + } +} + +class PropertyInfo extends VariableLike +{ + public PropertyName $name; + public ?Expr $defaultValue; + public ?string $defaultValueString; + public bool $isDocReadonly; + + /** + * @var AttributeInfo[] $attributes + */ + public function __construct( + PropertyName $name, + int $flags, + ?Type $type, + ?Type $phpDocType, + ?Expr $defaultValue, + ?string $defaultValueString, + bool $isDocReadonly, + ?string $link, + ?int $phpVersionIdMinimumCompatibility, + array $attributes + ) { + $this->name = $name; + $this->defaultValue = $defaultValue; + $this->defaultValueString = $defaultValueString; + $this->isDocReadonly = $isDocReadonly; + parent::__construct($flags, $type, $phpDocType, $link, $phpVersionIdMinimumCompatibility, $attributes); + } + + protected function getVariableTypeCode(): string + { + return "property"; + } + + protected function getVariableTypeName(): string + { + return "property"; + } + + protected function getFieldSynopsisDefaultLinkend(): string + { + $className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString()); + + return "$className.props." . strtolower(str_replace("_", "-", $this->name->getDeclarationName())); + } + + protected function getFieldSynopsisName(): string + { + return $this->name->getDeclarationName(); + } + + /** + * @param iterable $allConstInfos + */ + protected function getFieldSynopsisValueString(iterable $allConstInfos): ?string + { + return $this->defaultValueString; + } + + public function discardInfoForOldPhpVersions(): void { + $this->type = null; + $this->flags &= ~Class_::MODIFIER_READONLY; + $this->attributes = []; + } + + /** + * @param iterable $allConstInfos + */ + public function getDeclaration(iterable $allConstInfos): string { + $code = "\n"; + + $propertyName = $this->name->getDeclarationName(); + + if ($this->defaultValue === null) { + $defaultValue = EvaluatedValue::null(); + } else { + $defaultValue = EvaluatedValue::createFromExpression($this->defaultValue, null, null, $allConstInfos); + if ($defaultValue->isUnknownConstValue || ($defaultValue->originatingConsts && $defaultValue->getCExpr() === null)) { + echo "Skipping code generation for property $this->name, because it has an unknown constant default value\n"; + return ""; + } + } + + $zvalName = "property_{$propertyName}_default_value"; + if ($this->defaultValue === null && $this->type !== null) { + $code .= "\tzval $zvalName;\n\tZVAL_UNDEF(&$zvalName);\n"; + } else { + $code .= $defaultValue->initializeZval($zvalName); + } + + $code .= "\tzend_string *property_{$propertyName}_name = zend_string_init(\"$propertyName\", sizeof(\"$propertyName\") - 1, 1);\n"; + $nameCode = "property_{$propertyName}_name"; + $typeCode = $this->getTypeCode($propertyName, $code); + + if (!empty($this->attributes)) { + $template = "\tzend_property_info *property_" . $this->name->getDeclarationName() . " = "; + } else { + $template = "\t"; + } + $template .= "zend_declare_typed_property(class_entry, $nameCode, &$zvalName, %s, NULL, $typeCode);\n"; + $flagsCode = generateVersionDependentFlagCode( + $template, + $this->getFlagsByPhpVersion(), + $this->phpVersionIdMinimumCompatibility + ); + $code .= implode("", $flagsCode); + + $code .= "\tzend_string_release(property_{$propertyName}_name);\n"; + + return $code; + } + + /** + * @return array + */ + protected function getFlagsByPhpVersion(): array + { + $flags = parent::getFlagsByPhpVersion(); + + if ($this->flags & Class_::MODIFIER_STATIC) { + $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_STATIC", PHP_70_VERSION_ID); + } + + if ($this->flags & Class_::MODIFIER_READONLY) { + $flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_READONLY", PHP_81_VERSION_ID); + } + + return $flags; + } + + protected function addModifiersToFieldSynopsis(DOMDocument $doc, DOMElement $fieldsynopsisElement): void + { + parent::addModifiersToFieldSynopsis($doc, $fieldsynopsisElement); + + if ($this->flags & Class_::MODIFIER_STATIC) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "static")); + } + + if ($this->flags & Class_::MODIFIER_READONLY || $this->isDocReadonly) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "readonly")); + } + } + + public function __clone() + { + if ($this->type) { + $this->type = clone $this->type; + } + } +} + +class EnumCaseInfo { + public string $name; + public ?Expr $value; + + public function __construct(string $name, ?Expr $value) { + $this->name = $name; + $this->value = $value; + } + + /** + * @param iterable $allConstInfos + */ + public function getDeclaration(iterable $allConstInfos): string { + $escapedName = addslashes($this->name); + if ($this->value === null) { + $code = "\n\tzend_enum_add_case_cstr(class_entry, \"$escapedName\", NULL);\n"; + } else { + $value = EvaluatedValue::createFromExpression($this->value, null, null, $allConstInfos); + + $zvalName = "enum_case_{$escapedName}_value"; + $code = "\n" . $value->initializeZval($zvalName); + $code .= "\tzend_enum_add_case_cstr(class_entry, \"$escapedName\", &$zvalName);\n"; + } + + return $code; + } +} + +class AttributeInfo { + public string $class; + /** @var \PhpParser\Node\Arg[] */ + public array $args; + + /** @param \PhpParser\Node\Arg[] $args */ + public function __construct(string $class, array $args) { + $this->class = $class; + $this->args = $args; + } + + /** @param iterable $allConstInfos */ + public function generateCode(string $invocation, string $nameSuffix, iterable $allConstInfos, ?int $phpVersionIdMinimumCompatibility): string { + $php82MinimumCompatibility = $phpVersionIdMinimumCompatibility === null || $phpVersionIdMinimumCompatibility >= PHP_82_VERSION_ID; + /* see ZEND_KNOWN_STRINGS in Zend/strings.h */ + $knowns = []; + if ($php82MinimumCompatibility) { + $knowns["SensitiveParameter"] = "ZEND_STR_SENSITIVEPARAMETER"; + } + + $code = "\n"; + $escapedAttributeName = strtr($this->class, '\\', '_'); + if (isset($knowns[$escapedAttributeName])) { + $code .= "\t" . ($this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocation, ZSTR_KNOWN({$knowns[$escapedAttributeName]}), " . count($this->args) . ");\n"; + } else { + $code .= "\tzend_string *attribute_name_{$escapedAttributeName}_$nameSuffix = zend_string_init_interned(\"" . addcslashes($this->class, "\\") . "\", sizeof(\"" . addcslashes($this->class, "\\") . "\") - 1, 1);\n"; + $code .= "\t" . ($this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocation, attribute_name_{$escapedAttributeName}_$nameSuffix, " . count($this->args) . ");\n"; + $code .= "\tzend_string_release(attribute_name_{$escapedAttributeName}_$nameSuffix);\n"; + } + foreach ($this->args as $i => $arg) { + $value = EvaluatedValue::createFromExpression($arg->value, null, null, $allConstInfos); + $zvalName = "attribute_{$escapedAttributeName}_{$nameSuffix}_arg$i"; + $code .= $value->initializeZval($zvalName); + $code .= "\tZVAL_COPY_VALUE(&attribute_{$escapedAttributeName}_{$nameSuffix}->args[$i].value, &$zvalName);\n"; + if ($arg->name) { + $code .= "\tattribute_{$escapedAttributeName}_{$nameSuffix}->args[$i].name = zend_string_init(\"{$arg->name->name}\", sizeof(\"{$arg->name->name}\") - 1, 1);\n"; + } + } + return $code; + } +} + +class ClassInfo { + public Name $name; + public int $flags; + public string $type; + public ?string $alias; + public ?SimpleType $enumBackingType; + public bool $isDeprecated; + public bool $isStrictProperties; + /** @var AttributeInfo[] */ + public array $attributes; + public bool $isNotSerializable; + /** @var Name[] */ + public array $extends; + /** @var Name[] */ + public array $implements; + /** @var ConstInfo[] */ + public array $constInfos; + /** @var PropertyInfo[] */ + public array $propertyInfos; + /** @var FuncInfo[] */ + public array $funcInfos; + /** @var EnumCaseInfo[] */ + public array $enumCaseInfos; + public ?string $cond; + public ?int $phpVersionIdMinimumCompatibility; + public bool $isUndocumentable; + + /** + * @param AttributeInfo[] $attributes + * @param Name[] $extends + * @param Name[] $implements + * @param ConstInfo[] $constInfos + * @param PropertyInfo[] $propertyInfos + * @param FuncInfo[] $funcInfos + * @param EnumCaseInfo[] $enumCaseInfos + */ + public function __construct( + Name $name, + int $flags, + string $type, + ?string $alias, + ?SimpleType $enumBackingType, + bool $isDeprecated, + bool $isStrictProperties, + array $attributes, + bool $isNotSerializable, + array $extends, + array $implements, + array $constInfos, + array $propertyInfos, + array $funcInfos, + array $enumCaseInfos, + ?string $cond, + ?int $minimumPhpVersionIdCompatibility, + bool $isUndocumentable + ) { + $this->name = $name; + $this->flags = $flags; + $this->type = $type; + $this->alias = $alias; + $this->enumBackingType = $enumBackingType; + $this->isDeprecated = $isDeprecated; + $this->isStrictProperties = $isStrictProperties; + $this->attributes = $attributes; + $this->isNotSerializable = $isNotSerializable; + $this->extends = $extends; + $this->implements = $implements; + $this->constInfos = $constInfos; + $this->propertyInfos = $propertyInfos; + $this->funcInfos = $funcInfos; + $this->enumCaseInfos = $enumCaseInfos; + $this->cond = $cond; + $this->phpVersionIdMinimumCompatibility = $minimumPhpVersionIdCompatibility; + $this->isUndocumentable = $isUndocumentable; + } + + /** + * @param ConstInfo[] $allConstInfos + */ + public function getRegistration(iterable $allConstInfos): string + { + $params = []; + foreach ($this->extends as $extends) { + $params[] = "zend_class_entry *class_entry_" . implode("_", $extends->getParts()); + } + foreach ($this->implements as $implements) { + $params[] = "zend_class_entry *class_entry_" . implode("_", $implements->getParts()); + } + + $escapedName = implode("_", $this->name->getParts()); + + $code = ''; + + $php80MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >= PHP_80_VERSION_ID; + $php81MinimumCompatibility = $this->phpVersionIdMinimumCompatibility === null || $this->phpVersionIdMinimumCompatibility >= PHP_81_VERSION_ID; + + if ($this->type === "enum" && !$php81MinimumCompatibility) { + $code .= "#if (PHP_VERSION_ID >= " . PHP_81_VERSION_ID . ")\n"; + } + + if ($this->cond) { + $code .= "#if {$this->cond}\n"; + } + + $code .= "static zend_class_entry *register_class_$escapedName(" . (empty($params) ? "void" : implode(", ", $params)) . ")\n"; + + $code .= "{\n"; + if ($this->type === "enum") { + $name = addslashes((string) $this->name); + $backingType = $this->enumBackingType + ? $this->enumBackingType->toTypeCode() : "IS_UNDEF"; + $code .= "\tzend_class_entry *class_entry = zend_register_internal_enum(\"$name\", $backingType, class_{$escapedName}_methods);\n"; + } else { + $code .= "\tzend_class_entry ce, *class_entry;\n\n"; + if (count($this->name->getParts()) > 1) { + $className = $this->name->getLast(); + $namespace = addslashes((string) $this->name->slice(0, -1)); + + $code .= "\tINIT_NS_CLASS_ENTRY(ce, \"$namespace\", \"$className\", class_{$escapedName}_methods);\n"; + } else { + $code .= "\tINIT_CLASS_ENTRY(ce, \"$this->name\", class_{$escapedName}_methods);\n"; + } + + if ($this->type === "class" || $this->type === "trait") { + $code .= "\tclass_entry = zend_register_internal_class_ex(&ce, " . (isset($this->extends[0]) ? "class_entry_" . str_replace("\\", "_", $this->extends[0]->toString()) : "NULL") . ");\n"; + } else { + $code .= "\tclass_entry = zend_register_internal_interface(&ce);\n"; + } + } + + $flagCodes = generateVersionDependentFlagCode("\tclass_entry->ce_flags |= %s;\n", $this->getFlagsByPhpVersion(), $this->phpVersionIdMinimumCompatibility); + $code .= implode("", $flagCodes); + + $implements = array_map( + function (Name $item) { + return "class_entry_" . implode("_", $item->getParts()); + }, + $this->type === "interface" ? $this->extends : $this->implements + ); + + if (!empty($implements)) { + $code .= "\tzend_class_implements(class_entry, " . count($implements) . ", " . implode(", ", $implements) . ");\n"; + } + + if ($this->alias) { + $code .= "\tzend_register_class_alias(\"" . str_replace("\\", "\\\\", $this->alias) . "\", class_entry);\n"; + } + + foreach ($this->constInfos as $const) { + $code .= $const->getDeclaration($allConstInfos); + } + + foreach ($this->enumCaseInfos as $enumCase) { + $code .= $enumCase->getDeclaration($allConstInfos); + } + + foreach ($this->propertyInfos as $property) { + $code .= $property->getDeclaration($allConstInfos); + } + + if (!empty($this->attributes)) { + if (!$php80MinimumCompatibility) { + $code .= "\n#if (PHP_VERSION_ID >= " . PHP_80_VERSION_ID . ")"; + } + + foreach ($this->attributes as $key => $attribute) { + $code .= $attribute->generateCode( + "zend_add_class_attribute(class_entry", + "class_{$escapedName}_$key", + $allConstInfos, + $this->phpVersionIdMinimumCompatibility + ); + } + + if (!$php80MinimumCompatibility) { + $code .= "#endif\n"; + } + } + + if ($attributeInitializationCode = generateConstantAttributeInitialization($this->constInfos, $allConstInfos, $this->phpVersionIdMinimumCompatibility, $this->cond)) { + if (!$php80MinimumCompatibility) { + $code .= "#if (PHP_VERSION_ID >= " . PHP_80_VERSION_ID . ")"; + } + + $code .= "\n" . $attributeInitializationCode; + + if (!$php80MinimumCompatibility) { + $code .= "#endif\n"; + } + } + + if ($attributeInitializationCode = generatePropertyAttributeInitialization($this->propertyInfos, $allConstInfos, $this->phpVersionIdMinimumCompatibility)) { + if (!$php80MinimumCompatibility) { + $code .= "#if (PHP_VERSION_ID >= " . PHP_80_VERSION_ID . ")"; + } + + $code .= "\n" . $attributeInitializationCode; + + if (!$php80MinimumCompatibility) { + $code .= "#endif\n"; + } + } + + if ($attributeInitializationCode = generateFunctionAttributeInitialization($this->funcInfos, $allConstInfos, $this->phpVersionIdMinimumCompatibility, $this->cond)) { + if (!$php80MinimumCompatibility) { + $code .= "#if (PHP_VERSION_ID >= " . PHP_80_VERSION_ID . ")\n"; + } + + $code .= "\n" . $attributeInitializationCode; + + if (!$php80MinimumCompatibility) { + $code .= "#endif\n"; + } + } + + $code .= "\n\treturn class_entry;\n"; + + $code .= "}\n"; + + if ($this->cond) { + $code .= "#endif\n"; + } + + if ($this->type === "enum" && !$php81MinimumCompatibility) { + $code .= "#endif\n"; + } + + return $code; + } + + /** + * @return array + */ + private function getFlagsByPhpVersion(): array + { + $php70Flags = []; + + if ($this->type === "trait") { + $php70Flags[] = "ZEND_ACC_TRAIT"; + } + + if ($this->flags & Class_::MODIFIER_FINAL) { + $php70Flags[] = "ZEND_ACC_FINAL"; + } + + if ($this->flags & Class_::MODIFIER_ABSTRACT) { + $php70Flags[] = "ZEND_ACC_ABSTRACT"; + } + + if ($this->isDeprecated) { + $php70Flags[] = "ZEND_ACC_DEPRECATED"; + } + + $php80Flags = $php70Flags; + + if ($this->isStrictProperties) { + $php80Flags[] = "ZEND_ACC_NO_DYNAMIC_PROPERTIES"; + } + + $php81Flags = $php80Flags; + + if ($this->isNotSerializable) { + $php81Flags[] = "ZEND_ACC_NOT_SERIALIZABLE"; + } + + $php82Flags = $php81Flags; + + if ($this->flags & Class_::MODIFIER_READONLY) { + $php82Flags[] = "ZEND_ACC_READONLY_CLASS"; + } + + foreach ($this->attributes as $attr) { + if ($attr->class === "AllowDynamicProperties") { + $php82Flags[] = "ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES"; + break; + } + } + + $php83Flags = $php82Flags; + + return [ + PHP_70_VERSION_ID => $php70Flags, + PHP_80_VERSION_ID => $php80Flags, + PHP_81_VERSION_ID => $php81Flags, + PHP_82_VERSION_ID => $php82Flags, + PHP_83_VERSION_ID => $php83Flags, + ]; + } + + /** + * @param array $classMap + * @param iterable $allConstInfos + * @param iterable $allConstInfo + */ + public function getClassSynopsisDocument(array $classMap, iterable $allConstInfos): ?string { + + $doc = new DOMDocument(); + $doc->formatOutput = true; + $classSynopsis = $this->getClassSynopsisElement($doc, $classMap, $allConstInfos); + if (!$classSynopsis) { + return null; + } + + $doc->appendChild($classSynopsis); + + return $doc->saveXML(); + } + + /** + * @param array $classMap + * @param iterable $allConstInfos + */ + public function getClassSynopsisElement(DOMDocument $doc, array $classMap, iterable $allConstInfos): ?DOMElement { + + $classSynopsis = $doc->createElement("classsynopsis"); + $classSynopsis->setAttribute("class", $this->type === "interface" ? "interface" : "class"); + + $exceptionOverride = $this->type === "class" && $this->isException($classMap) ? "exception" : null; + $ooElement = self::createOoElement($doc, $this, $exceptionOverride, true, null, 4); + if (!$ooElement) { + return null; + } + $classSynopsis->appendChild(new DOMText("\n ")); + $classSynopsis->appendChild($ooElement); + + foreach ($this->extends as $k => $parent) { + $parentInfo = $classMap[$parent->toString()] ?? null; + if ($parentInfo === null) { + throw new Exception("Missing parent class " . $parent->toString()); + } + + $ooElement = self::createOoElement( + $doc, + $parentInfo, + null, + false, + $k === 0 ? "extends" : null, + 4 + ); + if (!$ooElement) { + return null; + } + + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsis->appendChild($ooElement); + } + + foreach ($this->implements as $k => $interface) { + $interfaceInfo = $classMap[$interface->toString()] ?? null; + if (!$interfaceInfo) { + throw new Exception("Missing implemented interface " . $interface->toString()); + } + + $ooElement = self::createOoElement($doc, $interfaceInfo, null, false, $k === 0 ? "implements" : null, 4); + if (!$ooElement) { + return null; + } + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsis->appendChild($ooElement); + } + + /** @var array $parentsWithInheritedConstants */ + $parentsWithInheritedConstants = []; + /** @var array $parentsWithInheritedProperties */ + $parentsWithInheritedProperties = []; + /** @var array $parentsWithInheritedMethods */ + $parentsWithInheritedMethods = []; + + $this->collectInheritedMembers( + $parentsWithInheritedConstants, + $parentsWithInheritedProperties, + $parentsWithInheritedMethods, + $this->hasConstructor(), + $classMap + ); + + $this->appendInheritedMemberSectionToClassSynopsis( + $doc, + $classSynopsis, + $parentsWithInheritedConstants, + "&Constants;", + "&InheritedConstants;" + ); + + if (!empty($this->constInfos)) { + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Constants;"); + $classSynopsisInfo->setAttribute("role", "comment"); + $classSynopsis->appendChild($classSynopsisInfo); + + foreach ($this->constInfos as $constInfo) { + $classSynopsis->appendChild(new DOMText("\n ")); + $fieldSynopsisElement = $constInfo->getFieldSynopsisElement($doc, $allConstInfos); + $classSynopsis->appendChild($fieldSynopsisElement); + } + } + + if (!empty($this->propertyInfos)) { + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Properties;"); + $classSynopsisInfo->setAttribute("role", "comment"); + $classSynopsis->appendChild($classSynopsisInfo); + + foreach ($this->propertyInfos as $propertyInfo) { + $classSynopsis->appendChild(new DOMText("\n ")); + $fieldSynopsisElement = $propertyInfo->getFieldSynopsisElement($doc, $allConstInfos); + $classSynopsis->appendChild($fieldSynopsisElement); + } + } + + $this->appendInheritedMemberSectionToClassSynopsis( + $doc, + $classSynopsis, + $parentsWithInheritedProperties, + "&Properties;", + "&InheritedProperties;" + ); + + if (!empty($this->funcInfos)) { + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Methods;"); + $classSynopsisInfo->setAttribute("role", "comment"); + $classSynopsis->appendChild($classSynopsisInfo); + + $classReference = self::getClassSynopsisReference($this->name); + $escapedName = addslashes($this->name->__toString()); + + if ($this->hasConstructor()) { + $classSynopsis->appendChild(new DOMText("\n ")); + $includeElement = $this->createIncludeElement( + $doc, + "xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='$escapedName'])" + ); + $classSynopsis->appendChild($includeElement); + } + + if ($this->hasMethods()) { + $classSynopsis->appendChild(new DOMText("\n ")); + $includeElement = $this->createIncludeElement( + $doc, + "xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedName'])" + ); + $classSynopsis->appendChild($includeElement); + } + + if ($this->hasDestructor()) { + $classSynopsis->appendChild(new DOMText("\n ")); + $includeElement = $this->createIncludeElement( + $doc, + "xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[@role='$escapedName'])" + ); + $classSynopsis->appendChild($includeElement); + } + } + + if (!empty($parentsWithInheritedMethods)) { + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&InheritedMethods;"); + $classSynopsisInfo->setAttribute("role", "comment"); + $classSynopsis->appendChild($classSynopsisInfo); + + foreach ($parentsWithInheritedMethods as $parent) { + $parentName = $parent["name"]; + $parentMethodsynopsisTypes = $parent["types"]; + + $parentReference = self::getClassSynopsisReference($parentName); + $escapedParentName = addslashes($parentName->__toString()); + + foreach ($parentMethodsynopsisTypes as $parentMethodsynopsisType) { + $classSynopsis->appendChild(new DOMText("\n ")); + $includeElement = $this->createIncludeElement( + $doc, + "xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:refentry/db:refsect1[@role='description']/descendant::db:{$parentMethodsynopsisType}[@role='$escapedParentName'])" + ); + + $classSynopsis->appendChild($includeElement); + } + } + } + + $classSynopsis->appendChild(new DOMText("\n ")); + + return $classSynopsis; + } + + private static function createOoElement( + DOMDocument $doc, + ClassInfo $classInfo, + ?string $typeOverride, + bool $withModifiers, + ?string $modifierOverride, + int $indentationLevel + ): ?DOMElement { + $indentation = str_repeat(" ", $indentationLevel); + + if ($classInfo->type !== "class" && $classInfo->type !== "interface") { + echo "Class synopsis generation is not implemented for " . $classInfo->type . "\n"; + return null; + } + + $type = $typeOverride !== null ? $typeOverride : $classInfo->type; + + $ooElement = $doc->createElement("oo$type"); + $ooElement->appendChild(new DOMText("\n$indentation ")); + if ($modifierOverride !== null) { + $ooElement->appendChild($doc->createElement('modifier', $modifierOverride)); + $ooElement->appendChild(new DOMText("\n$indentation ")); + } elseif ($withModifiers) { + if ($classInfo->flags & Class_::MODIFIER_FINAL) { + $ooElement->appendChild($doc->createElement('modifier', 'final')); + $ooElement->appendChild(new DOMText("\n$indentation ")); + } + if ($classInfo->flags & Class_::MODIFIER_ABSTRACT) { + $ooElement->appendChild($doc->createElement('modifier', 'abstract')); + $ooElement->appendChild(new DOMText("\n$indentation ")); + } + if ($classInfo->flags & Class_::MODIFIER_READONLY) { + $ooElement->appendChild($doc->createElement('modifier', 'readonly')); + $ooElement->appendChild(new DOMText("\n$indentation ")); + } + } + + $nameElement = $doc->createElement("{$type}name", $classInfo->name->toString()); + $ooElement->appendChild($nameElement); + $ooElement->appendChild(new DOMText("\n$indentation")); + + return $ooElement; + } + + public static function getClassSynopsisFilename(Name $name): string { + return strtolower(str_replace("_", "-", implode('-', $name->getParts()))); + } + + public static function getClassSynopsisReference(Name $name): string { + return "class." . self::getClassSynopsisFilename($name); + } + + /** + * @param array $parentsWithInheritedConstants + * @param array $parentsWithInheritedProperties + * @param array $parentsWithInheritedMethods + * @param array $classMap + */ + private function collectInheritedMembers( + array &$parentsWithInheritedConstants, + array &$parentsWithInheritedProperties, + array &$parentsWithInheritedMethods, + bool $hasConstructor, + array $classMap + ): void { + foreach ($this->extends as $parent) { + $parentInfo = $classMap[$parent->toString()] ?? null; + $parentName = $parent->toString(); + + if (!$parentInfo) { + throw new Exception("Missing parent class $parentName"); + } + + if (!empty($parentInfo->constInfos) && !isset($parentsWithInheritedConstants[$parentName])) { + $parentsWithInheritedConstants[] = $parent; + } + + if (!empty($parentInfo->propertyInfos) && !isset($parentsWithInheritedProperties[$parentName])) { + $parentsWithInheritedProperties[$parentName] = $parent; + } + + if (!$hasConstructor && $parentInfo->hasNonPrivateConstructor()) { + $parentsWithInheritedMethods[$parentName]["name"] = $parent; + $parentsWithInheritedMethods[$parentName]["types"][] = "constructorsynopsis"; + } + + if ($parentInfo->hasMethods()) { + $parentsWithInheritedMethods[$parentName]["name"] = $parent; + $parentsWithInheritedMethods[$parentName]["types"][] = "methodsynopsis"; + } + + if ($parentInfo->hasDestructor()) { + $parentsWithInheritedMethods[$parentName]["name"] = $parent; + $parentsWithInheritedMethods[$parentName]["types"][] = "destructorsynopsis"; + } + + $parentInfo->collectInheritedMembers( + $parentsWithInheritedConstants, + $parentsWithInheritedProperties, + $parentsWithInheritedMethods, + $hasConstructor, + $classMap + ); + } + + foreach ($this->implements as $parent) { + $parentInfo = $classMap[$parent->toString()] ?? null; + if (!$parentInfo) { + throw new Exception("Missing parent interface " . $parent->toString()); + } + + if (!empty($parentInfo->constInfos) && !isset($parentsWithInheritedConstants[$parent->toString()])) { + $parentsWithInheritedConstants[$parent->toString()] = $parent; + } + + $unusedParentsWithInheritedProperties = []; + $unusedParentsWithInheritedMethods = []; + + $parentInfo->collectInheritedMembers( + $parentsWithInheritedConstants, + $unusedParentsWithInheritedProperties, + $unusedParentsWithInheritedMethods, + $hasConstructor, + $classMap + ); + } + } + + /** @param array $classMap */ + private function isException(array $classMap): bool + { + if ($this->name->toString() === "Throwable") { + return true; + } + + foreach ($this->extends as $parentName) { + $parent = $classMap[$parentName->toString()] ?? null; + if ($parent === null) { + throw new Exception("Missing parent class " . $parentName->toString()); + } + + if ($parent->isException($classMap)) { + return true; + } + } + + if ($this->type === "class") { + foreach ($this->implements as $interfaceName) { + $interface = $classMap[$interfaceName->toString()] ?? null; + if ($interface === null) { + throw new Exception("Missing implemented interface " . $interfaceName->toString()); + } + + if ($interface->isException($classMap)) { + return true; + } + } + } + + return false; + } + + private function hasConstructor(): bool + { + foreach ($this->funcInfos as $funcInfo) { + if ($funcInfo->name->isConstructor()) { + return true; + } + } + + return false; + } + + private function hasNonPrivateConstructor(): bool + { + foreach ($this->funcInfos as $funcInfo) { + if ($funcInfo->name->isConstructor() && !($funcInfo->flags & Class_::MODIFIER_PRIVATE)) { + return true; + } + } + + return false; + } + + private function hasDestructor(): bool + { + foreach ($this->funcInfos as $funcInfo) { + if ($funcInfo->name->isDestructor()) { + return true; + } + } + + return false; + } + + private function hasMethods(): bool + { + foreach ($this->funcInfos as $funcInfo) { + if (!$funcInfo->name->isConstructor() && !$funcInfo->name->isDestructor()) { + return true; + } + } + + return false; + } + + private function createIncludeElement(DOMDocument $doc, string $query): DOMElement + { + $includeElement = $doc->createElement("xi:include"); + $attr = $doc->createAttribute("xpointer"); + $attr->value = $query; + $includeElement->appendChild($attr); + $fallbackElement = $doc->createElement("xi:fallback"); + $includeElement->appendChild(new DOMText("\n ")); + $includeElement->appendChild($fallbackElement); + $includeElement->appendChild(new DOMText("\n ")); + + return $includeElement; + } + + public function __clone() + { + foreach ($this->propertyInfos as $key => $propertyInfo) { + $this->propertyInfos[$key] = clone $propertyInfo; + } + + foreach ($this->funcInfos as $key => $funcInfo) { + $this->funcInfos[$key] = clone $funcInfo; + } + } + + /** + * @param Name[] $parents + */ + private function appendInheritedMemberSectionToClassSynopsis(DOMDocument $doc, DOMElement $classSynopsis, array $parents, string $label, string $inheritedLabel): void + { + if (empty($parents)) { + return; + } + + $classSynopsis->appendChild(new DOMText("\n\n ")); + $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "$inheritedLabel"); + $classSynopsisInfo->setAttribute("role", "comment"); + $classSynopsis->appendChild($classSynopsisInfo); + + foreach ($parents as $parent) { + $classSynopsis->appendChild(new DOMText("\n ")); + $parentReference = self::getClassSynopsisReference($parent); + + $includeElement = $this->createIncludeElement( + $doc, + "xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='$label']]))" + ); + $classSynopsis->appendChild($includeElement); + } + } +} + +class FileInfo { + /** @var string[] */ + public array $dependencies = []; + /** @var ConstInfo[] */ + public array $constInfos = []; + /** @var FuncInfo[] */ + public array $funcInfos = []; + /** @var ClassInfo[] */ + public array $classInfos = []; + public bool $generateFunctionEntries = false; + public string $declarationPrefix = ""; + public ?int $generateLegacyArginfoForPhpVersionId = null; + public bool $generateClassEntries = false; + public bool $isUndocumentable = false; + + /** + * @return iterable + */ + public function getAllFuncInfos(): iterable { + yield from $this->funcInfos; + foreach ($this->classInfos as $classInfo) { + yield from $classInfo->funcInfos; + } + } + + /** + * @return iterable + */ + public function getAllConstInfos(): iterable { + $result = $this->constInfos; + + foreach ($this->classInfos as $classInfo) { + $result = array_merge($result, $classInfo->constInfos); + } + + return $result; + } + + /** + * @return iterable + */ + public function getAllPropertyInfos(): iterable { + foreach ($this->classInfos as $classInfo) { + yield from $classInfo->propertyInfos; + } + } + + public function __clone() + { + foreach ($this->funcInfos as $key => $funcInfo) { + $this->funcInfos[$key] = clone $funcInfo; + } + + foreach ($this->classInfos as $key => $classInfo) { + $this->classInfos[$key] = clone $classInfo; + } + } +} + +class DocCommentTag { + public string $name; + public ?string $value; + + public function __construct(string $name, ?string $value) { + $this->name = $name; + $this->value = $value; + } + + public function getValue(): string { + if ($this->value === null) { + throw new Exception("@$this->name does not have a value"); + } + + return $this->value; + } + + public function getType(): string { + $value = $this->getValue(); + + $matches = []; + + if ($this->name === "param") { + preg_match('/^\s*([\w\|\\\\\[\]<>, ]+)\s*(?:[{(]|\$\w+).*$/', $value, $matches); + } elseif ($this->name === "return" || $this->name === "var") { + preg_match('/^\s*([\w\|\\\\\[\]<>, ]+)/', $value, $matches); + } + + if (!isset($matches[1])) { + throw new Exception("@$this->name doesn't contain a type or has an invalid format \"$value\""); + } + + return trim($matches[1]); + } + + public function getVariableName(): string { + $value = $this->value; + if ($value === null || strlen($value) === 0) { + throw new Exception("@$this->name doesn't have any value"); + } + + $matches = []; + + if ($this->name === "param") { + // Allow for parsing extended types like callable(string):mixed in docblocks + preg_match('/^\s*(?[\w\|\\\\]+(?\((?(?:(?&parens)|[^(){}[\]]*+))++\)|\{(?&inparens)\}|\[(?&inparens)\])*+(?::(?&type))?)\s*\$(?\w+).*$/', $value, $matches); + } elseif ($this->name === "prefer-ref") { + preg_match('/^\s*\$(?\w+).*$/', $value, $matches); + } + + if (!isset($matches["name"])) { + throw new Exception("@$this->name doesn't contain a variable name or has an invalid format \"$value\""); + } + + return $matches["name"]; + } +} + +/** @return DocCommentTag[] */ +function parseDocComment(DocComment $comment): array { + $commentText = substr($comment->getText(), 2, -2); + $tags = []; + foreach (explode("\n", $commentText) as $commentLine) { + $regex = '/^\*\s*@([a-z-]+)(?:\s+(.+))?$/'; + if (preg_match($regex, trim($commentLine), $matches)) { + $tags[] = new DocCommentTag($matches[1], $matches[2] ?? null); + } + } + + return $tags; +} + +function parseFunctionLike( + PrettyPrinterAbstract $prettyPrinter, + FunctionOrMethodName $name, + int $classFlags, + int $flags, + Node\FunctionLike $func, + ?string $cond, + bool $isUndocumentable +): FuncInfo { + try { + $comment = $func->getDocComment(); + $paramMeta = []; + $aliasType = null; + $alias = null; + $isDeprecated = false; + $supportsCompileTimeEval = false; + $verify = true; + $docReturnType = null; + $tentativeReturnType = false; + $docParamTypes = []; + $refcount = null; + + if ($comment) { + $tags = parseDocComment($comment); + foreach ($tags as $tag) { + switch ($tag->name) { + case 'alias': + case 'implementation-alias': + $aliasType = $tag->name; + $aliasParts = explode("::", $tag->getValue()); + if (count($aliasParts) === 1) { + $alias = new FunctionName(new Name($aliasParts[0])); + } else { + $alias = new MethodName(new Name($aliasParts[0]), $aliasParts[1]); + } + break; + + case 'deprecated': + $isDeprecated = true; + break; + + case 'no-verify': + $verify = false; + break; + + case 'tentative-return-type': + $tentativeReturnType = true; + break; + + case 'return': + $docReturnType = $tag->getType(); + break; + + case 'param': + $docParamTypes[$tag->getVariableName()] = $tag->getType(); + break; + + case 'refcount': + $refcount = $tag->getValue(); + break; + + case 'compile-time-eval': + $supportsCompileTimeEval = true; + break; + + case 'prefer-ref': + $varName = $tag->getVariableName(); + if (!isset($paramMeta[$varName])) { + $paramMeta[$varName] = []; + } + $paramMeta[$varName][$tag->name] = true; + break; + + case 'undocumentable': + $isUndocumentable = true; + break; + } + } + } + + $varNameSet = []; + $args = []; + $numRequiredArgs = 0; + $foundVariadic = false; + foreach ($func->getParams() as $i => $param) { + $varName = $param->var->name; + $preferRef = !empty($paramMeta[$varName]['prefer-ref']); + unset($paramMeta[$varName]); + + if (isset($varNameSet[$varName])) { + throw new Exception("Duplicate parameter name $varName"); + } + $varNameSet[$varName] = true; + + if ($preferRef) { + $sendBy = ArgInfo::SEND_PREFER_REF; + } else if ($param->byRef) { + $sendBy = ArgInfo::SEND_BY_REF; + } else { + $sendBy = ArgInfo::SEND_BY_VAL; + } + + if ($foundVariadic) { + throw new Exception("Only the last parameter can be variadic"); + } + + $type = $param->type ? Type::fromNode($param->type) : null; + if ($type === null && !isset($docParamTypes[$varName])) { + throw new Exception("Missing parameter type"); + } + + if ($param->default instanceof Expr\ConstFetch && + $param->default->name->toLowerString() === "null" && + $type && !$type->isNullable() + ) { + $simpleType = $type->tryToSimpleType(); + if ($simpleType === null) { + throw new Exception("Parameter $varName has null default, but is not nullable"); + } + } + + if ($param->default instanceof Expr\ClassConstFetch && $param->default->class->toLowerString() === "self") { + throw new Exception('The exact class name must be used instead of "self"'); + } + + $foundVariadic = $param->variadic; + + $args[] = new ArgInfo( + $varName, + $sendBy, + $param->variadic, + $type, + isset($docParamTypes[$varName]) ? Type::fromString($docParamTypes[$varName]) : null, + $param->default ? $prettyPrinter->prettyPrintExpr($param->default) : null, + createAttributes($param->attrGroups) + ); + if (!$param->default && !$param->variadic) { + $numRequiredArgs = $i + 1; + } + } + + foreach (array_keys($paramMeta) as $var) { + throw new Exception("Found metadata for invalid param $var"); + } + + $returnType = $func->getReturnType(); + if ($returnType === null && $docReturnType === null && !$name->isConstructor() && !$name->isDestructor()) { + throw new Exception("Missing return type"); + } + + $return = new ReturnInfo( + $func->returnsByRef(), + $returnType ? Type::fromNode($returnType) : null, + $docReturnType ? Type::fromString($docReturnType) : null, + $tentativeReturnType, + $refcount + ); + + return new FuncInfo( + $name, + $classFlags, + $flags, + $aliasType, + $alias, + $isDeprecated, + $supportsCompileTimeEval, + $verify, + $args, + $return, + $numRequiredArgs, + $cond, + $isUndocumentable, + createAttributes($func->attrGroups) + ); + } catch (Exception $e) { + throw new Exception($name . "(): " .$e->getMessage()); + } +} + +/** + * @param array $attributes + */ +function parseConstLike( + PrettyPrinterAbstract $prettyPrinter, + ConstOrClassConstName $name, + Node\Const_ $const, + int $flags, + ?Node $type, + ?DocComment $docComment, + ?string $cond, + ?int $phpVersionIdMinimumCompatibility, + array $attributes +): ConstInfo { + $phpDocType = null; + $deprecated = false; + $cValue = null; + $link = null; + if ($docComment) { + $tags = parseDocComment($docComment); + foreach ($tags as $tag) { + if ($tag->name === 'var') { + $phpDocType = $tag->getType(); + } elseif ($tag->name === 'deprecated') { + $deprecated = true; + } elseif ($tag->name === 'cvalue') { + $cValue = $tag->value; + } elseif ($tag->name === 'link') { + $link = $tag->value; + } + } + } + + if ($type === null && $phpDocType === null) { + throw new Exception("Missing type for constant " . $name->__toString()); + } + + return new ConstInfo( + $name, + $flags, + $const->value, + $prettyPrinter->prettyPrintExpr($const->value), + $type ? Type::fromNode($type) : null, + $phpDocType ? Type::fromString($phpDocType) : null, + $deprecated, + $cond, + $cValue, + $link, + $phpVersionIdMinimumCompatibility, + $attributes + ); +} + +/** + * @param array $attributes + */ +function parseProperty( + Name $class, + int $flags, + Stmt\PropertyProperty $property, + ?Node $type, + ?DocComment $comment, + PrettyPrinterAbstract $prettyPrinter, + ?int $phpVersionIdMinimumCompatibility, + array $attributes +): PropertyInfo { + $phpDocType = null; + $isDocReadonly = false; + $link = null; + + if ($comment) { + $tags = parseDocComment($comment); + foreach ($tags as $tag) { + if ($tag->name === 'var') { + $phpDocType = $tag->getType(); + } elseif ($tag->name === 'readonly') { + $isDocReadonly = true; + } elseif ($tag->name === 'link') { + $link = $tag->value; + } + } + } + + $propertyType = $type ? Type::fromNode($type) : null; + if ($propertyType === null && !$phpDocType) { + throw new Exception("Missing type for property $class::\$$property->name"); + } + + if ($property->default instanceof Expr\ConstFetch && + $property->default->name->toLowerString() === "null" && + $propertyType && !$propertyType->isNullable() + ) { + $simpleType = $propertyType->tryToSimpleType(); + if ($simpleType === null) { + throw new Exception( + "Property $class::\$$property->name has null default, but is not nullable"); + } + } + + return new PropertyInfo( + new PropertyName($class, $property->name->__toString()), + $flags, + $propertyType, + $phpDocType ? Type::fromString($phpDocType) : null, + $property->default, + $property->default ? $prettyPrinter->prettyPrintExpr($property->default) : null, + $isDocReadonly, + $link, + $phpVersionIdMinimumCompatibility, + $attributes + ); +} + +/** + * @param ConstInfo[] $consts + * @param PropertyInfo[] $properties + * @param FuncInfo[] $methods + * @param EnumCaseInfo[] $enumCases + */ +function parseClass( + Name $name, + Stmt\ClassLike $class, + array $consts, + array $properties, + array $methods, + array $enumCases, + ?string $cond, + ?int $minimumPhpVersionIdCompatibility, + bool $isUndocumentable +): ClassInfo { + $flags = $class instanceof Class_ ? $class->flags : 0; + $comment = $class->getDocComment(); + $alias = null; + $isDeprecated = false; + $isStrictProperties = false; + $isNotSerializable = false; + $allowsDynamicProperties = false; + $attributes = []; + + if ($comment) { + $tags = parseDocComment($comment); + foreach ($tags as $tag) { + if ($tag->name === 'alias') { + $alias = $tag->getValue(); + } else if ($tag->name === 'deprecated') { + $isDeprecated = true; + } else if ($tag->name === 'strict-properties') { + $isStrictProperties = true; + } else if ($tag->name === 'not-serializable') { + $isNotSerializable = true; + } else if ($tag->name === 'undocumentable') { + $isUndocumentable = true; + } + } + } + + $attributes = createAttributes($class->attrGroups); + foreach ($attributes as $attribute) { + switch ($attribute->class) { + case 'AllowDynamicProperties': + $allowsDynamicProperties = true; + break 2; + } + } + + if ($isStrictProperties && $allowsDynamicProperties) { + throw new Exception("A class may not have '@strict-properties' and '#[\\AllowDynamicProperties]' at the same time."); + } + + $extends = []; + $implements = []; + + if ($class instanceof Class_) { + $classKind = "class"; + if ($class->extends) { + $extends[] = $class->extends; + } + $implements = $class->implements; + } elseif ($class instanceof Interface_) { + $classKind = "interface"; + $extends = $class->extends; + } else if ($class instanceof Trait_) { + $classKind = "trait"; + } else if ($class instanceof Enum_) { + $classKind = "enum"; + $implements = $class->implements; + } else { + throw new Exception("Unknown class kind " . get_class($class)); + } + + if ($isUndocumentable) { + foreach ($methods as $method) { + $method->isUndocumentable = true; + } + } + + return new ClassInfo( + $name, + $flags, + $classKind, + $alias, + $class instanceof Enum_ && $class->scalarType !== null + ? SimpleType::fromNode($class->scalarType) : null, + $isDeprecated, + $isStrictProperties, + $attributes, + $isNotSerializable, + $extends, + $implements, + $consts, + $properties, + $methods, + $enumCases, + $cond, + $minimumPhpVersionIdCompatibility, + $isUndocumentable + ); +} + +/** + * @param array> $attributeGroups + * @return Attribute[] + */ +function createAttributes(array $attributeGroups): array { + $attributes = []; + + foreach ($attributeGroups as $attrGroup) { + foreach ($attrGroup->attrs as $attr) { + $attributes[] = new AttributeInfo($attr->name->toString(), $attr->args); + } + } + + return $attributes; +} + +function handlePreprocessorConditions(array &$conds, Stmt $stmt): ?string { + foreach ($stmt->getComments() as $comment) { + $text = trim($comment->getText()); + if (preg_match('/^#\s*if\s+(.+)$/', $text, $matches)) { + $conds[] = $matches[1]; + } else if (preg_match('/^#\s*ifdef\s+(.+)$/', $text, $matches)) { + $conds[] = "defined($matches[1])"; + } else if (preg_match('/^#\s*ifndef\s+(.+)$/', $text, $matches)) { + $conds[] = "!defined($matches[1])"; + } else if (preg_match('/^#\s*else$/', $text)) { + if (empty($conds)) { + throw new Exception("Encountered else without corresponding #if"); + } + $cond = array_pop($conds); + $conds[] = "!($cond)"; + } else if (preg_match('/^#\s*endif$/', $text)) { + if (empty($conds)) { + throw new Exception("Encountered #endif without corresponding #if"); + } + array_pop($conds); + } else if ($text[0] === '#') { + throw new Exception("Unrecognized preprocessor directive \"$text\""); + } + } + + return empty($conds) ? null : implode(' && ', $conds); +} + +function getFileDocComment(array $stmts): ?DocComment { + if (empty($stmts)) { + return null; + } + + $comments = $stmts[0]->getComments(); + if (empty($comments)) { + return null; + } + + if ($comments[0] instanceof DocComment) { + return $comments[0]; + } + + return null; +} + +function handleStatements(FileInfo $fileInfo, array $stmts, PrettyPrinterAbstract $prettyPrinter) { + $conds = []; + foreach ($stmts as $stmt) { + $cond = handlePreprocessorConditions($conds, $stmt); + + if ($stmt instanceof Stmt\Nop) { + continue; + } + + if ($stmt instanceof Stmt\Namespace_) { + handleStatements($fileInfo, $stmt->stmts, $prettyPrinter); + continue; + } + + if ($stmt instanceof Stmt\Const_) { + foreach ($stmt->consts as $const) { + $fileInfo->constInfos[] = parseConstLike( + $prettyPrinter, + new ConstName($const->namespacedName, $const->name->toString()), + $const, + 0, + null, + $stmt->getDocComment(), + $cond, + $fileInfo->generateLegacyArginfoForPhpVersionId, + [] + ); + } + continue; + } + + if ($stmt instanceof Stmt\Function_) { + $fileInfo->funcInfos[] = parseFunctionLike( + $prettyPrinter, + new FunctionName($stmt->namespacedName), + 0, + 0, + $stmt, + $cond, + $fileInfo->isUndocumentable + ); + continue; + } + + if ($stmt instanceof Stmt\ClassLike) { + $className = $stmt->namespacedName; + $constInfos = []; + $propertyInfos = []; + $methodInfos = []; + $enumCaseInfos = []; + foreach ($stmt->stmts as $classStmt) { + $cond = handlePreprocessorConditions($conds, $classStmt); + if ($classStmt instanceof Stmt\Nop) { + continue; + } + + $classFlags = $stmt instanceof Class_ ? $stmt->flags : 0; + $abstractFlag = $stmt instanceof Stmt\Interface_ ? Class_::MODIFIER_ABSTRACT : 0; + + if ($classStmt instanceof Stmt\ClassConst) { + foreach ($classStmt->consts as $const) { + $constInfos[] = parseConstLike( + $prettyPrinter, + new ClassConstName($className, $const->name->toString()), + $const, + $classStmt->flags, + $classStmt->type, + $classStmt->getDocComment(), + $cond, + $fileInfo->generateLegacyArginfoForPhpVersionId, + createAttributes($classStmt->attrGroups) + ); + } + } else if ($classStmt instanceof Stmt\Property) { + if (!($classStmt->flags & Class_::VISIBILITY_MODIFIER_MASK)) { + throw new Exception("Visibility modifier is required"); + } + foreach ($classStmt->props as $property) { + $propertyInfos[] = parseProperty( + $className, + $classStmt->flags, + $property, + $classStmt->type, + $classStmt->getDocComment(), + $prettyPrinter, + $fileInfo->generateLegacyArginfoForPhpVersionId, + createAttributes($classStmt->attrGroups) + ); + } + } else if ($classStmt instanceof Stmt\ClassMethod) { + if (!($classStmt->flags & Class_::VISIBILITY_MODIFIER_MASK)) { + throw new Exception("Visibility modifier is required"); + } + $methodInfos[] = parseFunctionLike( + $prettyPrinter, + new MethodName($className, $classStmt->name->toString()), + $classFlags, + $classStmt->flags | $abstractFlag, + $classStmt, + $cond, + $fileInfo->isUndocumentable + ); + } else if ($classStmt instanceof Stmt\EnumCase) { + $enumCaseInfos[] = new EnumCaseInfo( + $classStmt->name->toString(), $classStmt->expr); + } else { + throw new Exception("Not implemented {$classStmt->getType()}"); + } + } + + $fileInfo->classInfos[] = parseClass( + $className, $stmt, $constInfos, $propertyInfos, $methodInfos, $enumCaseInfos, $cond, $fileInfo->generateLegacyArginfoForPhpVersionId, $fileInfo->isUndocumentable + ); + continue; + } + + if ($stmt instanceof Stmt\Expression) { + $expr = $stmt->expr; + if ($expr instanceof Expr\Include_) { + $fileInfo->dependencies[] = (string)EvaluatedValue::createFromExpression($expr->expr, null, null, [])->value; + continue; + } + } + + throw new Exception("Unexpected node {$stmt->getType()}"); + } + if (!empty($conds)) { + throw new Exception("Unterminated preprocessor conditions"); + } +} + +function parseStubFile(string $code): FileInfo { + $lexer = new PhpParser\Lexer\Emulative(); + $parser = new PhpParser\Parser\Php7($lexer); + $nodeTraverser = new PhpParser\NodeTraverser; + $nodeTraverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); + $prettyPrinter = new class extends Standard { + protected function pName_FullyQualified(Name\FullyQualified $node): string { + return implode('\\', $node->getParts()); + } + }; + + $stmts = $parser->parse($code); + $nodeTraverser->traverse($stmts); + + $fileInfo = new FileInfo; + $fileDocComment = getFileDocComment($stmts); + if ($fileDocComment) { + $fileTags = parseDocComment($fileDocComment); + foreach ($fileTags as $tag) { + if ($tag->name === 'generate-function-entries') { + $fileInfo->generateFunctionEntries = true; + $fileInfo->declarationPrefix = $tag->value ? $tag->value . " " : ""; + } else if ($tag->name === 'generate-legacy-arginfo') { + if ($tag->value && !in_array((int) $tag->value, ALL_PHP_VERSION_IDS, true)) { + throw new Exception( + "Legacy PHP version must be one of: \"" . PHP_70_VERSION_ID . "\" (PHP 7.0), \"" . PHP_80_VERSION_ID . "\" (PHP 8.0), " . + "\"" . PHP_81_VERSION_ID . "\" (PHP 8.1), \"" . PHP_82_VERSION_ID . "\" (PHP 8.2), \"" . PHP_83_VERSION_ID . "\" (PHP 8.3), " . + "\"" . $tag->value . "\" provided" + ); + } + + $fileInfo->generateLegacyArginfoForPhpVersionId = $tag->value ? (int) $tag->value : PHP_70_VERSION_ID; + } else if ($tag->name === 'generate-class-entries') { + $fileInfo->generateClassEntries = true; + $fileInfo->declarationPrefix = $tag->value ? $tag->value . " " : ""; + } else if ($tag->name === 'undocumentable') { + $fileInfo->isUndocumentable = true; + } + } + } + + // Generating class entries require generating function/method entries + if ($fileInfo->generateClassEntries && !$fileInfo->generateFunctionEntries) { + $fileInfo->generateFunctionEntries = true; + } + + handleStatements($fileInfo, $stmts, $prettyPrinter); + return $fileInfo; +} + +function funcInfoToCode(FileInfo $fileInfo, FuncInfo $funcInfo): string { + $code = ''; + $returnType = $funcInfo->return->type; + $isTentativeReturnType = $funcInfo->return->tentativeReturnType; + $php81MinimumCompatibility = $fileInfo->generateLegacyArginfoForPhpVersionId === null || $fileInfo->generateLegacyArginfoForPhpVersionId >= PHP_81_VERSION_ID; + + if ($returnType !== null) { + if ($isTentativeReturnType && !$php81MinimumCompatibility) { + $code .= "#if (PHP_VERSION_ID >= " . PHP_81_VERSION_ID . ")\n"; + } + if (null !== $simpleReturnType = $returnType->tryToSimpleType()) { + if ($simpleReturnType->isBuiltin) { + $code .= sprintf( + "%s(%s, %d, %d, %s, %d)\n", + $isTentativeReturnType ? "ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX" : "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $simpleReturnType->toTypeCode(), $returnType->isNullable() + ); + } else { + $code .= sprintf( + "%s(%s, %d, %d, %s, %d)\n", + $isTentativeReturnType ? "ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX" : "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $simpleReturnType->toEscapedName(), $returnType->isNullable() + ); + } + } else { + $arginfoType = $returnType->toArginfoType(); + if ($arginfoType->hasClassType()) { + $code .= sprintf( + "%s(%s, %d, %d, %s, %s)\n", + $isTentativeReturnType ? "ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX" : "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $arginfoType->toClassTypeString(), $arginfoType->toTypeMask() + ); + } else { + $code .= sprintf( + "%s(%s, %d, %d, %s)\n", + $isTentativeReturnType ? "ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX" : "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $arginfoType->toTypeMask() + ); + } + } + if ($isTentativeReturnType && !$php81MinimumCompatibility) { + $code .= sprintf( + "#else\nZEND_BEGIN_ARG_INFO_EX(%s, 0, %d, %d)\n#endif\n", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, $funcInfo->numRequiredArgs + ); + } + } else { + $code .= sprintf( + "ZEND_BEGIN_ARG_INFO_EX(%s, 0, %d, %d)\n", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, $funcInfo->numRequiredArgs + ); + } + + foreach ($funcInfo->args as $argInfo) { + $argKind = $argInfo->isVariadic ? "ARG_VARIADIC" : "ARG"; + $argDefaultKind = $argInfo->hasProperDefaultValue() ? "_WITH_DEFAULT_VALUE" : ""; + $argType = $argInfo->type; + if ($argType !== null) { + if (null !== $simpleArgType = $argType->tryToSimpleType()) { + if ($simpleArgType->isBuiltin) { + $code .= sprintf( + "\tZEND_%s_TYPE_INFO%s(%s, %s, %s, %d%s)\n", + $argKind, $argDefaultKind, $argInfo->getSendByString(), $argInfo->name, + $simpleArgType->toTypeCode(), $argType->isNullable(), + $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" + ); + } else { + $code .= sprintf( + "\tZEND_%s_OBJ_INFO%s(%s, %s, %s, %d%s)\n", + $argKind,$argDefaultKind, $argInfo->getSendByString(), $argInfo->name, + $simpleArgType->toEscapedName(), $argType->isNullable(), + $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" + ); + } + } else { + $arginfoType = $argType->toArginfoType(); + if ($arginfoType->hasClassType()) { + $code .= sprintf( + "\tZEND_%s_OBJ_TYPE_MASK(%s, %s, %s, %s%s)\n", + $argKind, $argInfo->getSendByString(), $argInfo->name, + $arginfoType->toClassTypeString(), $arginfoType->toTypeMask(), + !$argInfo->isVariadic ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" + ); + } else { + $code .= sprintf( + "\tZEND_%s_TYPE_MASK(%s, %s, %s, %s)\n", + $argKind, $argInfo->getSendByString(), $argInfo->name, + $arginfoType->toTypeMask(), + $argInfo->getDefaultValueAsArginfoString() + ); + } + } + } else { + $code .= sprintf( + "\tZEND_%s_INFO%s(%s, %s%s)\n", + $argKind, $argDefaultKind, $argInfo->getSendByString(), $argInfo->name, + $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" + ); + } + } + + $code .= "ZEND_END_ARG_INFO()"; + return $code . "\n"; +} + +/** @param FuncInfo[] $generatedFuncInfos */ +function findEquivalentFuncInfo(array $generatedFuncInfos, FuncInfo $funcInfo): ?FuncInfo { + foreach ($generatedFuncInfos as $generatedFuncInfo) { + if ($generatedFuncInfo->equalsApartFromNameAndRefcount($funcInfo)) { + return $generatedFuncInfo; + } + } + return null; +} + +/** + * @template T + * @param iterable $infos + * @param Closure(T): string|null $codeGenerator + * @param ?string $parentCond + */ +function generateCodeWithConditions( + iterable $infos, string $separator, Closure $codeGenerator, ?string $parentCond = null): string { + $code = ""; + foreach ($infos as $info) { + $infoCode = $codeGenerator($info); + if ($infoCode === null) { + continue; + } + + $code .= $separator; + if ($info->cond && $info->cond !== $parentCond) { + $code .= "#if {$info->cond}\n"; + $code .= $infoCode; + $code .= "#endif\n"; + } else { + $code .= $infoCode; + } + } + + return $code; +} + +/** + * @param iterable $allConstInfos + */ +function generateArgInfoCode( + string $stubFilenameWithoutExtension, + FileInfo $fileInfo, + iterable $allConstInfos, + string $stubHash +): string { + $code = "/* This is a generated file, edit the .stub.php file instead.\n" + . " * Stub hash: $stubHash */\n"; + + $generatedFuncInfos = []; + $code .= generateCodeWithConditions( + $fileInfo->getAllFuncInfos(), "\n", + static function (FuncInfo $funcInfo) use (&$generatedFuncInfos, $fileInfo) { + /* If there already is an equivalent arginfo structure, only emit a #define */ + if ($generatedFuncInfo = findEquivalentFuncInfo($generatedFuncInfos, $funcInfo)) { + $code = sprintf( + "#define %s %s\n", + $funcInfo->getArgInfoName(), $generatedFuncInfo->getArgInfoName() + ); + } else { + $code = funcInfoToCode($fileInfo, $funcInfo); + } + + $generatedFuncInfos[] = $funcInfo; + return $code; + } + ); + + if ($fileInfo->generateFunctionEntries) { + $code .= "\n\n"; + + $generatedFunctionDeclarations = []; + $code .= generateCodeWithConditions( + $fileInfo->getAllFuncInfos(), "", + static function (FuncInfo $funcInfo) use ($fileInfo, &$generatedFunctionDeclarations) { + $key = $funcInfo->getDeclarationKey(); + if (isset($generatedFunctionDeclarations[$key])) { + return null; + } + + $generatedFunctionDeclarations[$key] = true; + return $fileInfo->declarationPrefix . $funcInfo->getDeclaration(); + } + ); + + if (!empty($fileInfo->funcInfos)) { + $code .= generateFunctionEntries(null, $fileInfo->funcInfos); + } + + foreach ($fileInfo->classInfos as $classInfo) { + $code .= generateFunctionEntries($classInfo->name, $classInfo->funcInfos, $classInfo->cond); + } + } + + $php80MinimumCompatibility = $fileInfo->generateLegacyArginfoForPhpVersionId === null || $fileInfo->generateLegacyArginfoForPhpVersionId >= PHP_80_VERSION_ID; + + if ($fileInfo->generateClassEntries) { + if ($attributeInitializationCode = generateFunctionAttributeInitialization($fileInfo->funcInfos, $allConstInfos, $fileInfo->generateLegacyArginfoForPhpVersionId, null)) { + if (!$php80MinimumCompatibility) { + $attributeInitializationCode = "\n#if (PHP_VERSION_ID >= " . PHP_80_VERSION_ID . ")" . $attributeInitializationCode . "#endif\n"; + } + } + + if ($attributeInitializationCode !== "" || !empty($fileInfo->constInfos)) { + $code .= "\nstatic void register_{$stubFilenameWithoutExtension}_symbols(int module_number)\n"; + $code .= "{\n"; + + foreach ($fileInfo->constInfos as $constInfo) { + $code .= $constInfo->getDeclaration($allConstInfos); + } + + if (!empty($attributeInitializationCode !== "" && $fileInfo->constInfos)) { + $code .= "\n"; + } + + $code .= $attributeInitializationCode; + $code .= "}\n"; + } + + $code .= generateClassEntryCode($fileInfo, $allConstInfos); + } + + return $code; +} + +/** + * @param iterable $allConstInfos + */ +function generateClassEntryCode(FileInfo $fileInfo, iterable $allConstInfos): string { + $code = ""; + + foreach ($fileInfo->classInfos as $class) { + $code .= "\n" . $class->getRegistration($allConstInfos); + } + + return $code; +} + +/** @param FuncInfo[] $funcInfos */ +function generateFunctionEntries(?Name $className, array $funcInfos, ?string $cond = null): string { + $code = "\n\n"; + + if ($cond) { + $code .= "#if {$cond}\n"; + } + + $functionEntryName = "ext_functions"; + if ($className) { + $underscoreName = implode("_", $className->getParts()); + $functionEntryName = "class_{$underscoreName}_methods"; + } + + $code .= "static const zend_function_entry {$functionEntryName}[] = {\n"; + $code .= generateCodeWithConditions($funcInfos, "", static function (FuncInfo $funcInfo) { + return $funcInfo->getFunctionEntry(); + }, $cond); + $code .= "\tZEND_FE_END\n"; + $code .= "};\n"; + + if ($cond) { + $code .= "#endif\n"; + } + + return $code; +} + +/** + * @param iterable $funcInfos + */ +function generateFunctionAttributeInitialization(iterable $funcInfos, iterable $allConstInfos, ?int $phpVersionIdMinimumCompatibility, ?string $parentCond = null): string { + return generateCodeWithConditions( + $funcInfos, + "", + static function (FuncInfo $funcInfo) use ($allConstInfos, $phpVersionIdMinimumCompatibility) { + $code = null; + + if ($funcInfo->name instanceof MethodName) { + $functionTable = "&class_entry->function_table"; + } else { + $functionTable = "CG(function_table)"; + } + + foreach ($funcInfo->attributes as $key => $attribute) { + $code .= $attribute->generateCode( + "zend_add_function_attribute(zend_hash_str_find_ptr($functionTable, \"" . $funcInfo->name->getNameForAttributes() . "\", sizeof(\"" . $funcInfo->name->getNameForAttributes() . "\") - 1)", + "func_" . $funcInfo->name->getNameForAttributes() . "_$key", + $allConstInfos, + $phpVersionIdMinimumCompatibility + ); + } + + foreach ($funcInfo->args as $index => $arg) { + foreach ($arg->attributes as $key => $attribute) { + $code .= $attribute->generateCode( + "zend_add_parameter_attribute(zend_hash_str_find_ptr($functionTable, \"" . $funcInfo->name->getNameForAttributes() . "\", sizeof(\"" . $funcInfo->name->getNameForAttributes() . "\") - 1), $index", + "func_{$funcInfo->name->getNameForAttributes()}_arg{$index}_$key", + $allConstInfos, + $phpVersionIdMinimumCompatibility + ); + } + } + + return $code; + }, + $parentCond + ); +} + +/** + * @param iterable $constInfos + */ +function generateConstantAttributeInitialization( + iterable $constInfos, + iterable $allConstInfos, + ?int $phpVersionIdMinimumCompatibility, + ?string $parentCond = null +): string { + return generateCodeWithConditions( + $constInfos, + "", + static function (ConstInfo $constInfo) use ($allConstInfos, $phpVersionIdMinimumCompatibility) { + $code = null; + + foreach ($constInfo->attributes as $key => $attribute) { + $code .= $attribute->generateCode( + "zend_add_class_constant_attribute(class_entry, const_" . $constInfo->name->getDeclarationName(), + "const_" . $constInfo->name->getDeclarationName() . "_$key", + $allConstInfos, + $phpVersionIdMinimumCompatibility + ); + } + + return $code; + }, + $parentCond + ); +} + +/** + * @param iterable $propertyInfos + */ +function generatePropertyAttributeInitialization( + iterable $propertyInfos, + iterable $allConstInfos, + ?int $phpVersionIdMinimumCompatibility +): string { + $code = ""; + foreach ($propertyInfos as $propertyInfo) { + foreach ($propertyInfo->attributes as $key => $attribute) { + $code .= $attribute->generateCode( + "zend_add_property_attribute(class_entry, property_" . $propertyInfo->name->getDeclarationName(), + "property_" . $propertyInfo->name->getDeclarationName() . "_" . $key, + $allConstInfos, + $phpVersionIdMinimumCompatibility + ); + } + } + + return $code; +} + +/** @param array $funcMap */ +function generateOptimizerInfo(array $funcMap): string { + + $code = "/* This is a generated file, edit the .stub.php files instead. */\n\n"; + + $code .= "static const func_info_t func_infos[] = {\n"; + + $code .= generateCodeWithConditions($funcMap, "", static function (FuncInfo $funcInfo) { + return $funcInfo->getOptimizerInfo(); + }); + + $code .= "};\n"; + + return $code; +} + +/** + * @param array $flagsByPhpVersions + * @return string[] + */ +function generateVersionDependentFlagCode(string $codeTemplate, array $flagsByPhpVersions, ?int $phpVersionIdMinimumCompatibility): array +{ + $phpVersions = ALL_PHP_VERSION_IDS; + sort($phpVersions); + $currentPhpVersion = end($phpVersions); + + // No version compatibility is needed + if ($phpVersionIdMinimumCompatibility === null) { + if (empty($flagsByPhpVersions[$currentPhpVersion])) { + return []; + } + + return [sprintf($codeTemplate, implode("|", $flagsByPhpVersions[$currentPhpVersion]))]; + } + + // Remove flags which depend on a PHP version below the minimally supported one + ksort($flagsByPhpVersions); + $index = array_search($phpVersionIdMinimumCompatibility, array_keys($flagsByPhpVersions)); + if ($index === false) { + throw new Exception("Missing version dependent flags for PHP version ID \"$phpVersionIdMinimumCompatibility\""); + } + $flagsByPhpVersions = array_slice($flagsByPhpVersions, $index, null, true); + + // Remove empty version-specific flags + $flagsByPhpVersions = array_filter( + $flagsByPhpVersions, + static function (array $value): bool { + return !empty($value); + }); + + // There are no version-specific flags + if (empty($flagsByPhpVersions)) { + return []; + } + + // Remove version-specific flags which don't differ from the previous one + $previousVersionId = null; + foreach ($flagsByPhpVersions as $versionId => $versionFlags) { + if ($previousVersionId !== null && $flagsByPhpVersions[$previousVersionId] === $versionFlags) { + unset($flagsByPhpVersions[$versionId]); + } else { + $previousVersionId = $versionId; + } + } + + $flagCount = count($flagsByPhpVersions); + + // Do not add a condition unnecessarily when the only version is the same as the minimally supported one + if ($flagCount === 1) { + reset($flagsByPhpVersions); + $firstVersion = key($flagsByPhpVersions); + if ($firstVersion === $phpVersionIdMinimumCompatibility) { + return [sprintf($codeTemplate, implode("|", reset($flagsByPhpVersions)))]; + } + } + + // Add the necessary conditions around the code using the version-specific flags + $result = []; + $i = 0; + foreach (array_reverse($flagsByPhpVersions, true) as $version => $versionFlags) { + $code = ""; + + $if = $i === 0 ? "#if" : "#elif"; + $endif = $i === $flagCount - 1 ? "#endif\n" : ""; + + $code .= "$if (PHP_VERSION_ID >= $version)\n"; + + $code .= sprintf($codeTemplate, implode("|", $versionFlags)); + $code .= $endif; + + $result[] = $code; + $i++; + } + + return $result; +} + +/** + * @param array $classMap + * @param iterable $allConstInfos + * @return array + */ +function generateClassSynopses(array $classMap, iterable $allConstInfos): array { + $result = []; + + foreach ($classMap as $classInfo) { + $classSynopsis = $classInfo->getClassSynopsisDocument($classMap, $allConstInfos); + if ($classSynopsis !== null) { + $result[ClassInfo::getClassSynopsisFilename($classInfo->name) . ".xml"] = $classSynopsis; + } + } + + return $result; +} + +/** + * @param array $classMap + * $param iterable $allConstInfos + * @return array + */ +function replaceClassSynopses(string $targetDirectory, array $classMap, iterable $allConstInfos, bool $isVerify): array +{ + $existingClassSynopses = []; + + $classSynopses = []; + + $it = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($targetDirectory), + RecursiveIteratorIterator::LEAVES_ONLY + ); + + foreach ($it as $file) { + $pathName = $file->getPathName(); + if (!preg_match('/\.xml$/i', $pathName)) { + continue; + } + + $xml = file_get_contents($pathName); + if ($xml === false) { + continue; + } + + if (stripos($xml, "formatOutput = false; + $doc->preserveWhiteSpace = true; + $doc->validateOnParse = true; + $success = $doc->loadXML($replacedXml); + if (!$success) { + echo "Failed opening $pathName\n"; + continue; + } + + $classSynopsisElements = []; + foreach ($doc->getElementsByTagName("classsynopsis") as $element) { + $classSynopsisElements[] = $element; + } + + foreach ($classSynopsisElements as $classSynopsis) { + if (!$classSynopsis instanceof DOMElement) { + continue; + } + + $child = $classSynopsis->firstElementChild; + if ($child === null) { + continue; + } + $child = $child->lastElementChild; + if ($child === null) { + continue; + } + $className = $child->textContent; + if (!isset($classMap[$className])) { + continue; + } + + $existingClassSynopses[$className] = $className; + + $classInfo = $classMap[$className]; + + $newClassSynopsis = $classInfo->getClassSynopsisElement($doc, $classMap, $allConstInfos); + if ($newClassSynopsis === null) { + continue; + } + + // Check if there is any change - short circuit if there is not any. + + if (replaceAndCompareXmls($doc, $classSynopsis, $newClassSynopsis)) { + continue; + } + + // Return the updated XML + + $replacedXml = $doc->saveXML(); + + $replacedXml = preg_replace( + [ + "/REPLACED-ENTITY-([A-Za-z0-9._{}%-]+?;)/", + '//i', + '//i', + '//i', + '//i', + '//i', + ], + [ + "&$1", + "", + "", + "", + "", + "", + ], + $replacedXml + ); + + $classSynopses[$pathName] = $replacedXml; + } + } + + if ($isVerify) { + $missingClassSynopses = array_diff_key($classMap, $existingClassSynopses); + foreach ($missingClassSynopses as $className => $info) { + /** @var ClassInfo $info */ + if (!$info->isUndocumentable) { + echo "Warning: Missing class synopsis for $className\n"; + } + } + } + + return $classSynopses; +} + +function getReplacedSynopsisXml(string $xml): string +{ + return preg_replace( + [ + "/&([A-Za-z0-9._{}%-]+?;)/", + "/<(\/)*xi:([A-Za-z]+?)/" + ], + [ + "REPLACED-ENTITY-$1", + "<$1XI$2", + ], + $xml + ); +} + +/** + * @param array $funcMap + * @param array $aliasMap + * @return array + */ +function generateMethodSynopses(array $funcMap, array $aliasMap): array { + $result = []; + + foreach ($funcMap as $funcInfo) { + $methodSynopsis = $funcInfo->getMethodSynopsisDocument($funcMap, $aliasMap); + if ($methodSynopsis !== null) { + $result[$funcInfo->name->getMethodSynopsisFilename() . ".xml"] = $methodSynopsis; + } + } + + return $result; +} + +/** + * @param array $funcMap + * @param array $aliasMap + * @return array + */ +function replaceMethodSynopses(string $targetDirectory, array $funcMap, array $aliasMap, bool $isVerify): array { + $existingMethodSynopses = []; + $methodSynopses = []; + + $it = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($targetDirectory), + RecursiveIteratorIterator::LEAVES_ONLY + ); + + foreach ($it as $file) { + $pathName = $file->getPathName(); + if (!preg_match('/\.xml$/i', $pathName)) { + continue; + } + + $xml = file_get_contents($pathName); + if ($xml === false) { + continue; + } + + if ($isVerify) { + $matches = []; + preg_match("/\s*([\w:]+)\s*<\/refname>\s*\s*&Alias;\s*<(?:function|methodname)>\s*([\w:]+)\s*<\/(?:function|methodname)>\s*<\/refpurpose>/i", $xml, $matches); + $aliasName = $matches[1] ?? null; + $alias = $funcMap[$aliasName] ?? null; + $funcName = $matches[2] ?? null; + $func = $funcMap[$funcName] ?? null; + + if ($alias && + !$alias->isUndocumentable && + ($func === null || $func->alias === null || $func->alias->__toString() !== $aliasName) && + ($alias->alias === null || $alias->alias->__toString() !== $funcName) + ) { + echo "Warning: $aliasName()" . ($alias->alias ? " is an alias of " . $alias->alias->__toString() . "(), but it" : "") . " is incorrectly documented as an alias for $funcName()\n"; + } + + $matches = []; + preg_match("/<(?:para|simpara)>\s*(?:&info.function.alias;|&info.method.alias;|&Alias;)\s+<(?:function|methodname)>\s*([\w:]+)\s*<\/(?:function|methodname)>/i", $xml, $matches); + $descriptionFuncName = $matches[1] ?? null; + $descriptionFunc = $funcMap[$descriptionFuncName] ?? null; + if ($descriptionFunc && $funcName !== $descriptionFuncName) { + echo "Warning: Alias in the method synopsis description of $pathName doesn't match the alias in the \n"; + } + + if ($aliasName) { + $existingMethodSynopses[$aliasName] = $aliasName; + } + } + + if (stripos($xml, "formatOutput = false; + $doc->preserveWhiteSpace = true; + $doc->validateOnParse = true; + $success = $doc->loadXML($replacedXml); + if (!$success) { + echo "Failed opening $pathName\n"; + continue; + } + + $methodSynopsisElements = []; + foreach ($doc->getElementsByTagName("constructorsynopsis") as $element) { + $methodSynopsisElements[] = $element; + } + foreach ($doc->getElementsByTagName("destructorsynopsis") as $element) { + $methodSynopsisElements[] = $element; + } + foreach ($doc->getElementsByTagName("methodsynopsis") as $element) { + $methodSynopsisElements[] = $element; + } + + foreach ($methodSynopsisElements as $methodSynopsis) { + if (!$methodSynopsis instanceof DOMElement) { + continue; + } + + $list = $methodSynopsis->getElementsByTagName("methodname"); + $item = $list->item(0); + if (!$item instanceof DOMElement) { + continue; + } + $funcName = $item->textContent; + if (!isset($funcMap[$funcName])) { + continue; + } + + $funcInfo = $funcMap[$funcName]; + $existingMethodSynopses[$funcInfo->name->__toString()] = $funcInfo->name->__toString(); + + $newMethodSynopsis = $funcInfo->getMethodSynopsisElement($funcMap, $aliasMap, $doc); + if ($newMethodSynopsis === null) { + continue; + } + + // Retrieve current signature + + $params = []; + $list = $methodSynopsis->getElementsByTagName("methodparam"); + foreach ($list as $i => $item) { + if (!$item instanceof DOMElement) { + continue; + } + + $paramList = $item->getElementsByTagName("parameter"); + if ($paramList->count() !== 1) { + continue; + } + + $paramName = $paramList->item(0)->textContent; + $paramTypes = []; + + $paramList = $item->getElementsByTagName("type"); + foreach ($paramList as $type) { + if (!$type instanceof DOMElement) { + continue; + } + + $paramTypes[] = $type->textContent; + } + + $params[$paramName] = ["index" => $i, "type" => $paramTypes]; + } + + // Check if there is any change - short circuit if there is not any. + + if (replaceAndCompareXmls($doc, $methodSynopsis, $newMethodSynopsis)) { + continue; + } + + // Update parameter references + + $paramList = $doc->getElementsByTagName("parameter"); + /** @var DOMElement $paramElement */ + foreach ($paramList as $paramElement) { + if ($paramElement->parentNode && $paramElement->parentNode->nodeName === "methodparam") { + continue; + } + + $name = $paramElement->textContent; + if (!isset($params[$name])) { + continue; + } + + $index = $params[$name]["index"]; + if (!isset($funcInfo->args[$index])) { + continue; + } + + $paramElement->textContent = $funcInfo->args[$index]->name; + } + + // Return the updated XML + + $replacedXml = $doc->saveXML(); + + $replacedXml = preg_replace( + [ + "/REPLACED-ENTITY-([A-Za-z0-9._{}%-]+?;)/", + '//i', + '//i', + ], + [ + "&$1", + "", + "", + ], + $replacedXml + ); + + $methodSynopses[$pathName] = $replacedXml; + } + } + + if ($isVerify) { + $missingMethodSynopses = array_diff_key($funcMap, $existingMethodSynopses); + foreach ($missingMethodSynopses as $functionName => $info) { + /** @var FuncInfo $info */ + if (!$info->isUndocumentable) { + echo "Warning: Missing method synopsis for $functionName()\n"; + } + } + } + + return $methodSynopses; +} + +function replaceAndCompareXmls(DOMDocument $doc, DOMElement $originalSynopsis, DOMElement $newSynopsis): bool +{ + $docComparator = new DOMDocument(); + $docComparator->preserveWhiteSpace = false; + $docComparator->formatOutput = true; + + $xml1 = $doc->saveXML($originalSynopsis); + $xml1 = getReplacedSynopsisXml($xml1); + $docComparator->loadXML($xml1); + $xml1 = $docComparator->saveXML(); + + $originalSynopsis->parentNode->replaceChild($newSynopsis, $originalSynopsis); + + $xml2 = $doc->saveXML($newSynopsis); + $xml2 = getReplacedSynopsisXml($xml2); + + $docComparator->loadXML($xml2); + $xml2 = $docComparator->saveXML(); + + return $xml1 === $xml2; +} + +function installPhpParser(string $version, string $phpParserDir) { + $lockFile = __DIR__ . "/PHP-Parser-install-lock"; + $lockFd = fopen($lockFile, 'w+'); + if (!flock($lockFd, LOCK_EX)) { + throw new Exception("Failed to acquire installation lock"); + } + + try { + // Check whether a parallel process has already installed PHP-Parser. + if (is_dir($phpParserDir)) { + return; + } + + $cwd = getcwd(); + chdir(__DIR__); + + $tarName = "v$version.tar.gz"; + passthru("wget https://github.com/nikic/PHP-Parser/archive/$tarName", $exit); + if ($exit !== 0) { + passthru("curl -LO https://github.com/nikic/PHP-Parser/archive/$tarName", $exit); + } + if ($exit !== 0) { + throw new Exception("Failed to download PHP-Parser tarball"); + } + if (!mkdir($phpParserDir)) { + throw new Exception("Failed to create directory $phpParserDir"); + } + passthru("tar xvzf $tarName -C PHP-Parser-$version --strip-components 1", $exit); + if ($exit !== 0) { + throw new Exception("Failed to extract PHP-Parser tarball"); + } + unlink(__DIR__ . "/$tarName"); + chdir($cwd); + } finally { + flock($lockFd, LOCK_UN); + @unlink($lockFile); + } +} + +function initPhpParser() { + static $isInitialized = false; + if ($isInitialized) { + return; + } + + if (!extension_loaded("tokenizer")) { + throw new Exception("The \"tokenizer\" extension is not available"); + } + + $isInitialized = true; + $version = "5.0.0"; + $phpParserDir = __DIR__ . "/PHP-Parser-$version"; + if (!is_dir($phpParserDir)) { + installPhpParser($version, $phpParserDir); + } + + spl_autoload_register(static function(string $class) use ($phpParserDir) { + if (strpos($class, "PhpParser\\") === 0) { + $fileName = $phpParserDir . "/lib/" . str_replace("\\", "/", $class) . ".php"; + require $fileName; + } + }); +} + +$optind = null; +$options = getopt( + "fh", + [ + "force-regeneration", "parameter-stats", "help", "verify", "generate-classsynopses", "replace-classsynopses", + "generate-methodsynopses", "replace-methodsynopses", "generate-optimizer-info" + ], + $optind +); + +$context = new Context; +$printParameterStats = isset($options["parameter-stats"]); +$verify = isset($options["verify"]); +$generateClassSynopses = isset($options["generate-classsynopses"]); +$replaceClassSynopses = isset($options["replace-classsynopses"]); +$generateMethodSynopses = isset($options["generate-methodsynopses"]); +$replaceMethodSynopses = isset($options["replace-methodsynopses"]); +$generateOptimizerInfo = isset($options["generate-optimizer-info"]); +$context->forceRegeneration = isset($options["f"]) || isset($options["force-regeneration"]); +$context->forceParse = $context->forceRegeneration || $printParameterStats || $verify || $generateClassSynopses || $generateOptimizerInfo || $replaceClassSynopses || $generateMethodSynopses || $replaceMethodSynopses; + +$targetSynopses = $argv[$argc - 1] ?? null; +if ($replaceClassSynopses && $targetSynopses === null) { + die("A target class synopsis directory must be provided for.\n"); +} + +if ($replaceMethodSynopses && $targetSynopses === null) { + die("A target method synopsis directory must be provided.\n"); +} + +if (isset($options["h"]) || isset($options["help"])) { + die("\nusage: gen_stub.php [ -f | --force-regeneration ] [ --generate-classsynopses ] [ --replace-classsynopses ] [ --generate-methodsynopses ] [ --replace-methodsynopses ] [ --parameter-stats ] [ --verify ] [ --generate-optimizer-info ] [ -h | --help ] [ name.stub.php | directory ] [ directory ]\n\n"); +} + +$fileInfos = []; +$locations = array_slice($argv, $optind) ?: ['.']; +foreach (array_unique($locations) as $location) { + if (is_file($location)) { + // Generate single file. + $fileInfo = processStubFile($location, $context); + if ($fileInfo) { + $fileInfos[] = $fileInfo; + } + } else if (is_dir($location)) { + array_push($fileInfos, ...processDirectory($location, $context)); + } else { + echo "$location is neither a file nor a directory.\n"; + exit(1); + } +} + +if ($printParameterStats) { + $parameterStats = []; + + foreach ($fileInfos as $fileInfo) { + foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { + foreach ($funcInfo->args as $argInfo) { + if (!isset($parameterStats[$argInfo->name])) { + $parameterStats[$argInfo->name] = 0; + } + $parameterStats[$argInfo->name]++; + } + } + } + + arsort($parameterStats); + echo json_encode($parameterStats, JSON_PRETTY_PRINT), "\n"; +} + +/** @var array $classMap */ +$classMap = []; +/** @var array $funcMap */ +$funcMap = []; +/** @var array $aliasMap */ +$aliasMap = []; + +foreach ($fileInfos as $fileInfo) { + foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { + $funcMap[$funcInfo->name->__toString()] = $funcInfo; + + // TODO: Don't use aliasMap for methodsynopsis? + if ($funcInfo->aliasType === "alias") { + $aliasMap[$funcInfo->alias->__toString()] = $funcInfo; + } + } + + foreach ($fileInfo->classInfos as $classInfo) { + $classMap[$classInfo->name->__toString()] = $classInfo; + } +} + +if ($verify) { + $errors = []; + + foreach ($funcMap as $aliasFunc) { + if (!$aliasFunc->alias) { + continue; + } + + if (!isset($funcMap[$aliasFunc->alias->__toString()])) { + $errors[] = "Aliased function {$aliasFunc->alias}() cannot be found"; + continue; + } + + if (!$aliasFunc->verify) { + continue; + } + + $aliasedFunc = $funcMap[$aliasFunc->alias->__toString()]; + $aliasedArgs = $aliasedFunc->args; + $aliasArgs = $aliasFunc->args; + + if ($aliasFunc->isInstanceMethod() !== $aliasedFunc->isInstanceMethod()) { + if ($aliasFunc->isInstanceMethod()) { + $aliasedArgs = array_slice($aliasedArgs, 1); + } + + if ($aliasedFunc->isInstanceMethod()) { + $aliasArgs = array_slice($aliasArgs, 1); + } + } + + array_map( + function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc, &$errors) { + if ($aliasArg === null) { + assert($aliasedArg !== null); + $errors[] = "{$aliasFunc->name}(): Argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() is missing"; + return null; + } + + if ($aliasedArg === null) { + $errors[] = "{$aliasedFunc->name}(): Argument \$$aliasArg->name of alias function {$aliasFunc->name}() is missing"; + return null; + } + + if ($aliasArg->name !== $aliasedArg->name) { + $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same name"; + return null; + } + + if ($aliasArg->type != $aliasedArg->type) { + $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same type"; + } + + if ($aliasArg->defaultValue !== $aliasedArg->defaultValue) { + $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same default value"; + } + }, + $aliasArgs, $aliasedArgs + ); + + $aliasedReturn = $aliasedFunc->return; + $aliasReturn = $aliasFunc->return; + + if (!$aliasedFunc->name->isConstructor() && !$aliasFunc->name->isConstructor()) { + $aliasedReturnType = $aliasedReturn->type ?? $aliasedReturn->phpDocType; + $aliasReturnType = $aliasReturn->type ?? $aliasReturn->phpDocType; + if ($aliasReturnType != $aliasedReturnType) { + $errors[] = "{$aliasFunc->name}() and {$aliasedFunc->name}() must have the same return type"; + } + } + + $aliasedPhpDocReturnType = $aliasedReturn->phpDocType; + $aliasPhpDocReturnType = $aliasReturn->phpDocType; + if ($aliasedPhpDocReturnType != $aliasPhpDocReturnType && $aliasedPhpDocReturnType != $aliasReturn->type && $aliasPhpDocReturnType != $aliasedReturn->type) { + $errors[] = "{$aliasFunc->name}() and {$aliasedFunc->name}() must have the same PHPDoc return type"; + } + } + + echo implode("\n", $errors); + if (!empty($errors)) { + echo "\n"; + exit(1); + } +} + +if ($generateClassSynopses) { + $classSynopsesDirectory = getcwd() . "/classsynopses"; + + $classSynopses = generateClassSynopses($classMap, $context->allConstInfos); + if (!empty($classSynopses)) { + if (!file_exists($classSynopsesDirectory)) { + mkdir($classSynopsesDirectory); + } + + foreach ($classSynopses as $filename => $content) { + if (file_put_contents("$classSynopsesDirectory/$filename", $content)) { + echo "Saved $filename\n"; + } + } + } +} + +if ($replaceClassSynopses) { + $classSynopses = replaceClassSynopses($targetSynopses, $classMap, $context->allConstInfos, $verify); + + foreach ($classSynopses as $filename => $content) { + if (file_put_contents($filename, $content)) { + echo "Saved $filename\n"; + } + } +} + +if ($generateMethodSynopses) { + $methodSynopsesDirectory = getcwd() . "/methodsynopses"; + + $methodSynopses = generateMethodSynopses($funcMap, $aliasMap); + if (!empty($methodSynopses)) { + if (!file_exists($methodSynopsesDirectory)) { + mkdir($methodSynopsesDirectory); + } + + foreach ($methodSynopses as $filename => $content) { + if (file_put_contents("$methodSynopsesDirectory/$filename", $content)) { + echo "Saved $filename\n"; + } + } + } +} + +if ($replaceMethodSynopses) { + $methodSynopses = replaceMethodSynopses($targetSynopses, $funcMap, $aliasMap, $verify); + + foreach ($methodSynopses as $filename => $content) { + if (file_put_contents($filename, $content)) { + echo "Saved $filename\n"; + } + } +} + +if ($generateOptimizerInfo) { + $filename = dirname(__FILE__, 2) . "/Zend/Optimizer/zend_func_infos.h"; + $optimizerInfo = generateOptimizerInfo($funcMap); + + if (file_put_contents($filename, $optimizerInfo)) { + echo "Saved $filename\n"; + } +} diff --git a/lib/php/build/libtool.m4 b/lib/php/build/libtool.m4 new file mode 100644 index 0000000..8ee7b45 --- /dev/null +++ b/lib/php/build/libtool.m4 @@ -0,0 +1,6370 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, +## 2008 Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This file is free software; the Free Software Foundation gives +## unlimited permission to copy and/or distribute it, with or without +## modifications, as long as this notice is preserved. + +# serial 52 AC_PROG_LIBTOOL + +ifdef([AC_ACVERSION],[ +# autoconf 2.13 compatibility +# Set PATH_SEPARATOR variable +# --------------------------------- +# Find the correct PATH separator. Usually this is :', but +# DJGPP uses ;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) lt_cv_sys_path_separator=';' ;; + *) lt_cv_sys_path_separator=':' ;; + esac + PATH_SEPARATOR=$lt_cv_sys_path_separator +fi +]) + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +ifdef([AC_PROVIDE_IFELSE], + [], + [define([AC_PROVIDE_IFELSE], + [ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +_LT_REQUIRED_DARWIN_CHECKS + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], +[ --disable-libtool-lock Avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], +[ --with-pic Try to use only PIC/non-PIC objects [default=use both]], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm -r conftest* +])# _LT_LINKER_BOILERPLATE + + +dnl autoconf 2.13 compatibility +dnl _LT_AC_TRY_LINK() +AC_DEFUN([_LT_AC_TRY_LINK], [ +cat > conftest.$ac_ext <&5 + cat conftest.$ac_ext >&6 +ifelse([$2], , , [$2 + rm -rf conftest* +])dnl +fi +rm -f conftest*]) + +# _LT_REQUIRED_DARWIN_CHECKS +# -------------------------- +# Check for some things on darwin +AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm -rf libconftest.dylib* + fi + rm conftest.c + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + _LT_AC_TRY_LINK([lt_cv_ld_exported_symbols_list=yes],[lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[0123]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil="~$DSYMUTIL \$lib || :" + else + _lt_dsymutil= + fi + ;; + esac +]) + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +_LT_AC_TRY_LINK([ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[dnl +#AC_ARG_ENABLE([libtool-lock], +#[ --disable-libtool-lock avoid locking (might break parallel builds)]) +#test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH([C]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP([C])]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"configure:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "configure:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# --------------------------------------------------------------------- +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos* | haiku*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"configure:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "configure:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +ifelse($1,[],[ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`echo $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +haiku*) + # Since haiku provides gcc, use GNU style here + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + hardcode_into_libs=yes + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + ifelse([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], +[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], +[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_ARG_WITH([tags], +[ --with-tags[=TAGS] Include additional configurations [automatic] +], +[tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file '$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file '$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using 'LTCC=$LTCC', extracted from '$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name "$tagname" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] Build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], +changequote(<<, >>)dnl +<< --enable-static[=PKGS] Build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] + Optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +ifdef([AC_PROG_EGREP], [], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognize shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognize a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], +[ --with-gnu-ld Assume the C compiler uses GNU ld [default=no]], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin* | *-*-haiku*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH([C]) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP([C]) +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH([C++]) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= +_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + if test "$GXX" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]].*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix[[3-9]]*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP([C++]) +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + # + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + if test "$solaris_use_stlport4" != yes; then + _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) +case " $_LT_AC_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac +])# AC_LIBTOOL_POSTDEP_PREDEP + +# AC_LIBTOOL_CONFIG([TAGNAME]) +# ---------------------------- +# If TAGNAME is not passed, then create an initial libtool script +# with a default configuration from the untagged config vars. Otherwise +# add code to config.status for appending the configuration named by +# TAGNAME from the matching tagged config vars. +AC_DEFUN([AC_LIBTOOL_CONFIG], +[# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + _LT_AC_TAGVAR(compiler, $1) \ + _LT_AC_TAGVAR(CC, $1) \ + _LT_AC_TAGVAR(LD, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ + _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ + _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ + _LT_AC_TAGVAR(old_archive_cmds, $1) \ + _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ + _LT_AC_TAGVAR(predep_objects, $1) \ + _LT_AC_TAGVAR(postdep_objects, $1) \ + _LT_AC_TAGVAR(predeps, $1) \ + _LT_AC_TAGVAR(postdeps, $1) \ + _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ + _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ + _LT_AC_TAGVAR(archive_cmds, $1) \ + _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ + _LT_AC_TAGVAR(postinstall_cmds, $1) \ + _LT_AC_TAGVAR(postuninstall_cmds, $1) \ + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ + _LT_AC_TAGVAR(allow_undefined_flag, $1) \ + _LT_AC_TAGVAR(no_undefined_flag, $1) \ + _LT_AC_TAGVAR(export_symbols_cmds, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ + _LT_AC_TAGVAR(hardcode_automatic, $1) \ + _LT_AC_TAGVAR(module_cmds, $1) \ + _LT_AC_TAGVAR(module_expsym_cmds, $1) \ + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ + _LT_AC_TAGVAR(fix_srcfile_path, $1) \ + _LT_AC_TAGVAR(exclude_expsyms, $1) \ + _LT_AC_TAGVAR(include_expsyms, $1); do + + case $var in + _LT_AC_TAGVAR(old_archive_cmds, $1) | \ + _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ + _LT_AC_TAGVAR(archive_cmds, $1) | \ + _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ + _LT_AC_TAGVAR(module_cmds, $1) | \ + _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ + _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\[$]0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` + ;; + esac + +ifelse([$1], [], + [cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + AC_MSG_RESULT([ +creating $ofile])], + [cfgfile="$ofile"]) + + cat <<__EOF__ >> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The directories searched by this compiler when creating a shared +# library +compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([LT_AC_PROG_SED]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux* | k*bsd*-gnu) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | haiku* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc*) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc*) + # Intel C++, used to be incompatible with GCC. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | haiku* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + *) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if test -f "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) diff --git a/lib/php/build/ltmain.sh b/lib/php/build/ltmain.sh new file mode 100644 index 0000000..2f1c8c9 --- /dev/null +++ b/lib/php/build/ltmain.sh @@ -0,0 +1,6970 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.26 +TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)" + +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + extracted_serial=`expr $extracted_serial + 1` + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + echo "\ +$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP + +Copyright (C) 2008 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.[fF][09]?) xform=[fF][09]. ;; + *.for) xform=for ;; + *.java) xform=java ;; + *.obj) xform=obj ;; + *.sx) xform=sx ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$deplibdir/$depdepl" ; then + depdepl="$deplibdir/$depdepl" + elif test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + else + # Can't find it, oh well... + depdepl= + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + case " $deplibs" in + *\ -l* | *\ -L*) + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;; + esac + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + major=`expr $current - $age` + else + major=`expr $current - $age + 1` + fi + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + case $archive_cmds in + *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; + *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; + esac + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + case " $deplibs" in + *\ -l* | *\ -L*) + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;; + esac + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + else + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + fi + ;; + * ) + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \$*\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` + else + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $echo "Libraries have been installed in:" + for libdir in $libdirs; do + $echo " $libdir" + done + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" + fi + if test -n "$runpath_var"; then + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $echo + $echo "See any operating system documentation about shared libraries for" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/lib/php/build/php.m4 b/lib/php/build/php.m4 new file mode 100644 index 0000000..25d820c --- /dev/null +++ b/lib/php/build/php.m4 @@ -0,0 +1,2864 @@ +dnl This file contains local autoconf macros. + +dnl ---------------------------------------------------------------------------- +dnl Output stylize macros for configure (help/runtime). +dnl ---------------------------------------------------------------------------- + +dnl +dnl PHP_HELP_SEPARATOR(title) +dnl +dnl Adds separator title into the configure --help display. +dnl +AC_DEFUN([PHP_HELP_SEPARATOR],[ +AC_ARG_ENABLE([],[ +$1 +],[]) +]) + +dnl +dnl PHP_CONFIGURE_PART(title) +dnl +dnl Adds separator title configure output (idea borrowed from mm). +dnl +AC_DEFUN([PHP_CONFIGURE_PART],[ + AC_MSG_RESULT() + AC_MSG_RESULT([${T_MD}$1${T_ME}]) +]) + +dnl ---------------------------------------------------------------------------- +dnl Build system helper macros. +dnl ---------------------------------------------------------------------------- + +dnl +dnl PHP_DEF_HAVE(what) +dnl +dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [ ])'. +dnl +AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___), 1, [ ])]) + +dnl +dnl PHP_RUN_ONCE(namespace, variable, code) +dnl +dnl Execute code, if variable is not set in namespace. +dnl +AC_DEFUN([PHP_RUN_ONCE],[ + changequote({,}) + unique=`echo $2|$SED 's/[^a-zA-Z0-9]/_/g'` + changequote([,]) + cmd="echo $ac_n \"\$$1$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then + eval "$1$unique=set" + $3 + fi +]) + +dnl +dnl PHP_EXPAND_PATH(path, variable) +dnl +dnl Expands path to an absolute path and assigns it to variable. +dnl +AC_DEFUN([PHP_EXPAND_PATH],[ + if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then + $2=$1 + else + changequote({,}) + ep_dir=`echo $1|$SED 's%/*[^/][^/]*/*$%%'` + changequote([,]) + ep_realdir=`(cd "$ep_dir" && pwd)` + $2="$ep_realdir"/`basename "$1"` + fi +]) + +dnl +dnl PHP_DEFINE(WHAT [, value[, directory]]) +dnl +dnl Creates builddir/include/what.h and in there #define WHAT value. +dnl +AC_DEFUN([PHP_DEFINE],[ + [echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h] +]) + +dnl +dnl PHP_SUBST(varname) +dnl +dnl Adds variable with its value into Makefile, e.g.: +dnl CC = gcc +dnl +AC_DEFUN([PHP_SUBST],[ + PHP_VAR_SUBST="$PHP_VAR_SUBST $1" +]) + +dnl +dnl PHP_SUBST_OLD(varname, [VALUE]) +dnl +dnl Same as PHP_SUBST() but also substitutes all @VARNAME@ instances in every +dnl file passed to AC_OUTPUT. +dnl +AC_DEFUN([PHP_SUBST_OLD],[ + AC_SUBST($@) + PHP_SUBST([$1]) +]) + +dnl +dnl PHP_OUTPUT(file) +dnl +dnl Adds "file" to the list of files generated by AC_OUTPUT. This macro can be +dnl used several times. +dnl +AC_DEFUN([PHP_OUTPUT],[ + PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" +]) + +dnl ---------------------------------------------------------------------------- +dnl Build system base macros. +dnl ---------------------------------------------------------------------------- + +dnl +dnl PHP_CANONICAL_HOST_TARGET +dnl +AC_DEFUN([PHP_CANONICAL_HOST_TARGET],[ + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_CANONICAL_TARGET])dnl + dnl Make sure we do not continue if host_alias is empty. + if test -z "$host_alias" && test -n "$host"; then + host_alias=$host + fi + if test -z "$host_alias"; then + AC_MSG_ERROR([host_alias is not set!]) + fi +]) + +dnl +dnl PHP_INIT_BUILD_SYSTEM +dnl +dnl Creates build directories and Makefile placeholders. +dnl +AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[ +AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl +test -d include || $php_shtool mkdir include +> Makefile.objects +> Makefile.fragments +dnl We need to play tricks here to avoid matching the grep line itself. +pattern=define +$EGREP $pattern'.*include/php' $srcdir/configure|$SED 's/.*>//'|xargs touch 2>/dev/null +]) + +dnl +dnl PHP_GEN_GLOBAL_MAKEFILE +dnl +dnl Generates the global makefile. +dnl +AC_DEFUN([PHP_GEN_GLOBAL_MAKEFILE],[ + cat >Makefile <> Makefile + done + + cat $abs_srcdir/build/Makefile.global Makefile.fragments Makefile.objects >> Makefile +]) + +dnl +dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile [, ext_srcdir [, ext_builddir]]]) +dnl +dnl Processes a file called Makefile.frag in the source directory of the most +dnl recently added extension. $(srcdir) and $(builddir) are substituted with the +dnl proper paths. Can be used to supply custom rules and/or additional targets. +dnl +AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[ + ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1) + ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2) + ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3) + test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments +]) + +dnl +dnl PHP_ADD_SOURCES(source-path, sources [, special-flags [, type]]) +dnl +dnl Adds sources which are located relative to source-path to the array of type +dnl type. Sources are processed with optional special-flags which are passed to +dnl the compiler. Sources can be either written in C or C++ (filenames shall end +dnl in .c or .cpp, respectively). +dnl +dnl Note: If source-path begins with a "/", the "/" is removed and the path is +dnl interpreted relative to the top build-directory. +dnl +dnl Which array to append to? +dnl +AC_DEFUN([PHP_ADD_SOURCES],[ + PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS)) +]) + +dnl +dnl _PHP_ASSIGN_BUILD_VARS(type) +dnl +dnl Internal, don't use. +dnl +AC_DEFUN([_PHP_ASSIGN_BUILD_VARS],[ +ifelse($1,shared,[ + b_c_pre=$shared_c_pre + b_cxx_pre=$shared_cxx_pre + b_c_meta=$shared_c_meta + b_cxx_meta=$shared_cxx_meta + b_c_post=$shared_c_post + b_cxx_post=$shared_cxx_post +],[ + b_c_pre=$php_c_pre + b_cxx_pre=$php_cxx_pre + b_c_meta=$php_c_meta + b_cxx_meta=$php_cxx_meta + b_c_post=$php_c_post + b_cxx_post=$php_cxx_post +])dnl + b_lo=[$]$1_lo +]) + +dnl +dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared]]]) +dnl +dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the name of the +dnl array target-var directly, as well as whether shared objects will be built +dnl from the sources. Should not be used directly. +dnl +AC_DEFUN([PHP_ADD_SOURCES_X],[ +dnl Relative to source- or build-directory? +dnl ac_srcdir/ac_bdir include trailing slash + case $1 in + ""[)] ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; + /*[)] ac_srcdir=`echo "$1"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; + *[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$1/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + +dnl how to build .. shared or static? + ifelse($5,yes,_PHP_ASSIGN_BUILD_VARS(shared),_PHP_ASSIGN_BUILD_VARS(php)) + +dnl Iterate over the sources. + old_IFS=[$]IFS + for ac_src in $2; do + +dnl Remove the suffix. + IFS=. + set $ac_src + ac_obj=[$]1 + IFS=$old_IFS + +dnl Append to the array which has been dynamically chosen at m4 time. + $4="[$]$4 [$]ac_bdir[$]ac_obj.lo" + +dnl Choose the right compiler/flags/etc. for the source-file. + case $ac_src in + *.c[)] ac_comp="$b_c_pre $ac_inc $b_c_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.s[)] ac_comp="$b_c_pre $ac_inc $b_c_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.S[)] ac_comp="$b_c_pre $ac_inc $b_c_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.cpp|*.cc|*.cxx[)] ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac + +dnl Generate Makefiles with dependencies + ac_comp="$ac_comp -MMD -MF $ac_bdir$ac_obj.dep -MT $ac_bdir[$]ac_obj.lo" + +dnl Create a rule for the object/source combo. + cat >>Makefile.objects<>Makefile.objects< +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +$3 + +int main(void) +{ + FILE *fp = fopen("conftestval", "w"); + if (!fp) return(1); + fprintf(fp, "%d\n", sizeof($1)); + return(0); +} + ]])], [ + eval $php_cache_value=`cat conftestval` + ], [ + eval $php_cache_value=0 + ], [ + ifelse([$2],,[eval $php_cache_value=0], [eval $php_cache_value=$2]) +]) + LDFLAGS=$old_LDFLAGS + LIBS=$old_LIBS +]) + if eval test "\$$php_cache_value" != "0"; then +ifelse([$4],[],:,[$4]) +ifelse([$5],[],,[else $5]) + fi +]) + +dnl +dnl PHP_CHECK_SIZEOF(type, cross-value, extra-headers) +dnl +AC_DEFUN([PHP_CHECK_SIZEOF], [ + AC_MSG_CHECKING([size of $1]) + _PHP_CHECK_SIZEOF($1, $2, $3, [ + AC_DEFINE_UNQUOTED([SIZEOF_]translit($1,a-z,A-Z_), [$]php_cv_sizeof_[]$1, [Size of $1]) + AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z,A-Z_), 1, [Whether $1 is available]) + ]) + AC_MSG_RESULT([[$][php_cv_sizeof_]translit($1, ,_)]) +]) + +dnl +dnl PHP_CHECK_IN_ADDR_T +dnl +AC_DEFUN([PHP_CHECK_IN_ADDR_T], [ +dnl AIX keeps in_addr_t in /usr/include/netinet/in.h +AC_MSG_CHECKING([for in_addr_t]) +AC_CACHE_VAL(ac_cv_type_in_addr_t, +[AC_EGREP_CPP(dnl +changequote(<<,>>)dnl +<>dnl +changequote([,]), [#include +#include +#include +#ifdef HAVE_NETINET_IN_H +#include +#endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl +AC_MSG_RESULT([$ac_cv_type_in_addr_t]) +if test $ac_cv_type_in_addr_t = no; then + AC_DEFINE(in_addr_t, u_int, [ ]) +fi +]) + +dnl +dnl PHP_TIME_R_TYPE +dnl +dnl Check type of reentrant time-related functions. Type can be: irix, hpux or +dnl POSIX. +dnl +AC_DEFUN([PHP_TIME_R_TYPE],[ +AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[ +AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include + +int main(void) { +char buf[27]; +struct tm t; +time_t old = 0; +int r, s; + +s = gmtime_r(&old, &t); +r = (int) asctime_r(&t, buf, 26); +if (r == s && s == 0) return (0); +return (1); +} +]])],[ + ac_cv_time_r_type=hpux +],[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +int main(void) { + struct tm t, *s; + time_t old = 0; + char buf[27], *p; + + s = gmtime_r(&old, &t); + p = asctime_r(&t, buf, 26); + if (p == buf && s == &t) return (0); + return (1); +} + ]])],[ + ac_cv_time_r_type=irix + ],[ + ac_cv_time_r_type=POSIX + ],[ + ac_cv_time_r_type=POSIX + ]) +],[ + ac_cv_time_r_type=POSIX +]) +]) + case $ac_cv_time_r_type in + hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; + irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; + esac +]) + +dnl +dnl PHP_DOES_PWRITE_WORK +dnl +dnl Internal. +dnl +AC_DEFUN([PHP_DOES_PWRITE_WORK],[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +#include +#include +#include +$1 + int main(void) { + int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); + + if (fd < 0) return 1; + if (pwrite(fd, "text", 4, 0) != 4) return 1; + /* Linux glibc breakage until 2.2.5 */ + if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1; + return 0; + } + + ]])],[ + ac_cv_pwrite=yes + ],[ + ac_cv_pwrite=no + ],[ + ac_cv_pwrite=no + ]) +]) + +dnl +dnl PHP_DOES_PREAD_WORK +dnl +dnl Internal. +dnl +AC_DEFUN([PHP_DOES_PREAD_WORK],[ + echo test > conftest_in + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +#include +#include +#include +$1 + int main(void) { + char buf[3]; + int fd = open("conftest_in", O_RDONLY); + if (fd < 0) return 1; + if (pread(fd, buf, 2, 0) != 2) return 1; + /* Linux glibc breakage until 2.2.5 */ + if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1; + return 0; + } + ]])],[ + ac_cv_pread=yes + ],[ + ac_cv_pread=no + ],[ + ac_cv_pread=no + ]) + rm -f conftest_in +]) + +dnl +dnl PHP_PWRITE_TEST +dnl +AC_DEFUN([PHP_PWRITE_TEST],[ + AC_CACHE_CHECK(whether pwrite works,ac_cv_pwrite,[ + PHP_DOES_PWRITE_WORK + if test "$ac_cv_pwrite" = "no"; then + PHP_DOES_PWRITE_WORK([ssize_t pwrite(int, void *, size_t, off64_t);]) + if test "$ac_cv_pwrite" = "yes"; then + ac_cv_pwrite=64 + fi + fi + ]) + + if test "$ac_cv_pwrite" != "no"; then + AC_DEFINE(HAVE_PWRITE, 1, [ ]) + if test "$ac_cv_pwrite" = "64"; then + AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]) + fi + fi +]) + +dnl +dnl PHP_PREAD_TEST +dnl +AC_DEFUN([PHP_PREAD_TEST],[ + AC_CACHE_CHECK(whether pread works,ac_cv_pread,[ + PHP_DOES_PREAD_WORK + if test "$ac_cv_pread" = "no"; then + PHP_DOES_PREAD_WORK([ssize_t pread(int, void *, size_t, off64_t);]) + if test "$ac_cv_pread" = "yes"; then + ac_cv_pread=64 + fi + fi + ]) + + if test "$ac_cv_pread" != "no"; then + AC_DEFINE(HAVE_PREAD, 1, [ ]) + if test "$ac_cv_pread" = "64"; then + AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]) + fi + fi +]) + +dnl +dnl PHP_MISSING_TIME_R_DECL +dnl +AC_DEFUN([PHP_MISSING_TIME_R_DECL],[ + AC_MSG_CHECKING([for missing declarations of reentrant functions]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm *(*func)() = localtime_r]])],[ + : + ],[ + AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) + ]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm *(*func)() = gmtime_r]])],[ + : + ],[ + AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) + ]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char *(*func)() = asctime_r]])],[ + : + ],[ + AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) + ]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char *(*func)() = ctime_r]])],[ + : + ],[ + AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) + ]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char *(*func)() = strtok_r]])],[ + : + ],[ + AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) + ]) + AC_MSG_RESULT([done]) +]) + +dnl +dnl PHP_STRUCT_FLOCK +dnl +AC_DEFUN([PHP_STRUCT_FLOCK],[ +AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include + ]], [[struct flock x;]])],[ + ac_cv_struct_flock=yes + ],[ + ac_cv_struct_flock=no + ]) +) +if test "$ac_cv_struct_flock" = "yes" ; then + AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock]) +fi +]) + +dnl +dnl PHP_MISSING_FCLOSE_DECL +dnl +dnl See if we have broken header files like SunOS has. +dnl +AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[ + AC_MSG_CHECKING([for fclose declaration]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int (*func)() = fclose]])],[ + AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) + AC_MSG_RESULT([ok]) + ],[ + AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) + AC_MSG_RESULT([missing]) + ]) +]) + +dnl +dnl PHP_SOCKADDR_CHECKS +dnl +AC_DEFUN([PHP_SOCKADDR_CHECKS], [ + dnl Check for struct sockaddr_storage exists. + AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_sockaddr_storage, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], + [[struct sockaddr_storage s; s]])], + [ac_cv_sockaddr_storage=yes], [ac_cv_sockaddr_storage=no]) + ]) + if test "$ac_cv_sockaddr_storage" = "yes"; then + AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [Whether you have struct sockaddr_storage]) + fi + dnl Check if field sa_len exists in struct sockaddr. + AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], [[static struct sockaddr sa; int n = (int) sa.sa_len; return n;]])], + [ac_cv_sockaddr_sa_len=yes], [ac_cv_sockaddr_sa_len=no]) + ]) + if test "$ac_cv_sockaddr_sa_len" = "yes"; then + AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Whether struct sockaddr has field sa_len]) + fi +]) + +dnl +dnl PHP_EBCDIC +dnl +AC_DEFUN([PHP_EBCDIC], [ + AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +int main(void) { + return (unsigned char)'A' != (unsigned char)0xC1; +} +]])],[ + ac_cv_ebcdic=yes +],[ + ac_cv_ebcdic=no +],[ + ac_cv_ebcdic=no +])]) + if test "$ac_cv_ebcdic" = "yes"; then + AC_MSG_ERROR([PHP does not support EBCDIC targets]) + fi +]) + +dnl +dnl PHP_BROKEN_GETCWD +dnl +dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if a +dnl component of the path has execute but not read permissions. +dnl +AC_DEFUN([PHP_BROKEN_GETCWD],[ + AC_MSG_CHECKING([for broken getcwd]) + os=`uname -sr 2>/dev/null` + case $os in + SunOS*[)] + AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd]) + AC_MSG_RESULT([yes]);; + *[)] + AC_MSG_RESULT([no]);; + esac +]) + +dnl +dnl PHP_BROKEN_GCC_STRLEN_OPT +dnl +dnl Early releases of GCC 8 shipped with a strlen() optimization bug, so they +dnl didn't properly handle the `char val[1]` struct hack. See bug #76510. +dnl +AC_DEFUN([PHP_BROKEN_GCC_STRLEN_OPT], [ + AC_CACHE_CHECK([for broken gcc optimize-strlen],ac_cv_have_broken_gcc_strlen_opt,[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +struct s +{ + int i; + char c[1]; +}; +int main(void) +{ + struct s *s = malloc(sizeof(struct s) + 3); + s->i = 3; + strcpy(s->c, "foo"); + return strlen(s->c+1) == 2; +} +]])],[ + ac_cv_have_broken_gcc_strlen_opt=yes +],[ + ac_cv_have_broken_gcc_strlen_opt=no +],[ + ac_cv_have_broken_gcc_strlen_opt=no +])]) + if test "$ac_cv_have_broken_gcc_strlen_opt" = "yes"; then + CFLAGS="$CFLAGS -fno-optimize-strlen" + fi +]) + +dnl +dnl PHP_FOPENCOOKIE +dnl +AC_DEFUN([PHP_FOPENCOOKIE], [ + AC_CHECK_FUNC(fopencookie, [have_glibc_fopencookie=yes]) + + if test "$have_glibc_fopencookie" = "yes"; then +dnl This comes in two flavors: newer glibcs (since 2.1.2?) have a type called +dnl cookie_io_functions_t. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#define _GNU_SOURCE +#include +]], [[cookie_io_functions_t cookie;]])],[have_cookie_io_functions_t=yes],[]) + + if test "$have_cookie_io_functions_t" = "yes"; then + cookie_io_functions_t=cookie_io_functions_t + have_fopen_cookie=yes + +dnl Even newer glibcs have a different seeker definition. +AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#define _GNU_SOURCE +#include +#include + +struct cookiedata { + off64_t pos; +}; + +ssize_t reader(void *cookie, char *buffer, size_t size) +{ return size; } +ssize_t writer(void *cookie, const char *buffer, size_t size) +{ return size; } +int closer(void *cookie) +{ return 0; } +int seeker(void *cookie, off64_t *position, int whence) +{ ((struct cookiedata*)cookie)->pos = *position; return 0; } + +cookie_io_functions_t funcs = {reader, writer, seeker, closer}; + +int main(void) { + struct cookiedata g = { 0 }; + FILE *fp = fopencookie(&g, "r", funcs); + + if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192) + return 0; + return 1; +} + +]])], [ + cookie_io_functions_use_off64_t=yes +], [ + cookie_io_functions_use_off64_t=no +], [ + dnl Cross compilation. + case $host_alias in + *linux*) + cookie_io_functions_use_off64_t=yes + ;; + *) + cookie_io_functions_use_off64_t=no + ;; + esac +]) + + else + +dnl Older glibc versions (up to 2.1.2?) call it _IO_cookie_io_functions_t. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#define _GNU_SOURCE +#include +]], [[_IO_cookie_io_functions_t cookie;]])], [have_IO_cookie_io_functions_t=yes], []) + if test "$have_cookie_io_functions_t" = "yes" ; then + cookie_io_functions_t=_IO_cookie_io_functions_t + have_fopen_cookie=yes + fi + fi + + if test "$have_fopen_cookie" = "yes" ; then + AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) + AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) + if test "$cookie_io_functions_use_off64_t" = "yes" ; then + AC_DEFINE(COOKIE_SEEKER_USES_OFF64_T, 1, [ ]) + fi + fi + fi +]) + +dnl ---------------------------------------------------------------------------- +dnl Library/function existence and build sanity checks. +dnl ---------------------------------------------------------------------------- + +dnl +dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]]) +dnl +dnl Wrapper for AC_CHECK_LIB. +dnl +AC_DEFUN([PHP_CHECK_LIBRARY], [ + save_old_LDFLAGS=$LDFLAGS + ac_stuff="$5" + + save_ext_shared=$ext_shared + ext_shared=yes + PHP_EVAL_LIBLINE([$]ac_stuff, LDFLAGS) + AC_CHECK_LIB([$1],[$2],[ + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + $3 + ],[ + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + unset ac_cv_lib_$1[]_$2 + $4 + ])dnl +]) + +dnl +dnl PHP_CHECK_FRAMEWORK(framework, function [, action-found [, action-not-found ]]) +dnl +dnl El cheapo wrapper for AC_CHECK_LIB. +dnl +AC_DEFUN([PHP_CHECK_FRAMEWORK], [ + save_old_LDFLAGS=$LDFLAGS + LDFLAGS="-framework $1 $LDFLAGS" + dnl Supplying "c" to AC_CHECK_LIB is technically cheating, but rewriting + dnl AC_CHECK_LIB is overkill and this only affects the "checking.." output + dnl anyway. + AC_CHECK_LIB(c,[$2],[ + LDFLAGS=$save_old_LDFLAGS + $3 + ],[ + LDFLAGS=$save_old_LDFLAGS + $4 + ]) +]) + +dnl +dnl PHP_CHECK_FUNC_LIB(func, libs) +dnl +dnl This macro checks whether 'func' or '__func' exists in the specified +dnl library. Defines HAVE_func and HAVE_library if found and adds the library to +dnl LIBS. This should be called in the ACTION-IF-NOT-FOUND part of +dnl PHP_CHECK_FUNC. +dnl +dnl autoconf undefines the builtin "shift" :-( +dnl If possible, we use the builtin shift anyway, otherwise we use the ubercool +dnl definition that has been tested so far with FreeBSD/GNU m4. +dnl +ifdef([builtin],[builtin(define, phpshift, [builtin(shift, $@)])],[ +define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])))])]) +]) + +dnl +dnl PHP_CHECK_FUNC_LIB +dnl +AC_DEFUN([PHP_CHECK_FUNC_LIB],[ + ifelse($2,,:,[ + unset ac_cv_lib_$2[]_$1 + unset ac_cv_lib_$2[]___$1 + unset found + AC_CHECK_LIB($2, $1, [found=yes], [ + AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) + ]) + + if test "$found" = "yes"; then + ac_libs=$LIBS + LIBS="$LIBS -l$2" + AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(void) { return (0); }]])],[found=yes],[found=no],[ + dnl Cross compilation. + found=yes + ]) + LIBS=$ac_libs + fi + + if test "$found" = "yes"; then + PHP_ADD_LIBRARY($2) + PHP_DEF_HAVE($1) + PHP_DEF_HAVE(lib$2) + ac_cv_func_$1=yes + else + PHP_CHECK_FUNC_LIB($1,phpshift(phpshift($@))) + fi + ]) +]) + +dnl +dnl PHP_CHECK_FUNC(func, ...) +dnl +dnl This macro checks whether 'func' or '__func' exists in the default libraries +dnl and as a fall back in the specified library. Defines HAVE_func and +dnl HAVE_library if found and adds the library to LIBS. +dnl +AC_DEFUN([PHP_CHECK_FUNC],[ + unset ac_cv_func_$1 + unset ac_cv_func___$1 + unset found + + AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) + + case $found in + yes[)] + PHP_DEF_HAVE($1) + ac_cv_func_$1=yes + ;; + ifelse($#,1,,[ + *[)] PHP_CHECK_FUNC_LIB($@) ;; + ]) + esac +]) + +dnl +dnl PHP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs [, extra-source]]) +dnl +dnl This macro checks whether build works and given function exists. +dnl +AC_DEFUN([PHP_TEST_BUILD], [ + old_LIBS=$LIBS + LIBS="$4 $LIBS" + AC_LINK_IFELSE([AC_LANG_SOURCE([[ + $5 + char $1(); + int main(void) { + $1(); + return 0; + } + ]])],[ + LIBS=$old_LIBS + $2 + ],[ + LIBS=$old_LIBS + $3 + ]) +]) + +dnl ---------------------------------------------------------------------------- +dnl Platform characteristics checks. +dnl ---------------------------------------------------------------------------- + +dnl +dnl PHP_SHLIB_SUFFIX_NAMES +dnl +dnl Determines link library suffix SHLIB_SUFFIX_NAME which can be: .so, .sl or +dnl .dylib +dnl +dnl Determines shared library suffix SHLIB_DL_SUFFIX_NAME suffix can be: .so or +dnl .sl +dnl +AC_DEFUN([PHP_SHLIB_SUFFIX_NAMES],[ + AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl + PHP_SUBST_OLD(SHLIB_SUFFIX_NAME) + PHP_SUBST_OLD(SHLIB_DL_SUFFIX_NAME) + SHLIB_SUFFIX_NAME=so + SHLIB_DL_SUFFIX_NAME=$SHLIB_SUFFIX_NAME + case $host_alias in + *hpux*[)] + SHLIB_SUFFIX_NAME=sl + SHLIB_DL_SUFFIX_NAME=sl + ;; + *darwin*[)] + SHLIB_SUFFIX_NAME=dylib + SHLIB_DL_SUFFIX_NAME=so + ;; + esac +]) + +dnl +dnl PHP_C_BIGENDIAN +dnl +dnl Replacement macro for AC_C_BIGENDIAN. +dnl +AC_DEFUN([PHP_C_BIGENDIAN], +[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php, + [ + ac_cv_c_bigendian_php=unknown + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +int main(void) +{ + short one = 1; + char *cp = (char *)&one; + + if (*cp == 0) { + return(0); + } else { + return(1); + } +} + ]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown]) + ]) + if test $ac_cv_c_bigendian_php = yes; then + AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word]) + fi +]) + +dnl ---------------------------------------------------------------------------- +dnl Checks for programs: PHP_PROG_. +dnl ---------------------------------------------------------------------------- + +dnl +dnl PHP_PROG_SENDMAIL +dnl +dnl Search for the sendmail binary. +dnl +AC_DEFUN([PHP_PROG_SENDMAIL], [ + PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib + AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/sbin/sendmail, $PATH:$PHP_ALT_PATH) + PHP_SUBST(PROG_SENDMAIL) +]) + +dnl +dnl PHP_PROG_AWK +dnl +dnl Some vendors force mawk before gawk; mawk is broken so we don't like that. +dnl +AC_DEFUN([PHP_PROG_AWK], [ + AC_CHECK_PROGS(AWK, gawk nawk awk mawk, bork, /usr/xpg4/bin/:$PATH) + case "$AWK" in + *mawk) + AC_MSG_WARN([mawk is known to have problems on some systems. You should install GNU awk]) + ;; + *gawk) + ;; + bork) + AC_MSG_ERROR([Could not find awk; Install GNU awk]) + ;; + *) + AC_MSG_CHECKING([if $AWK is broken]) + if ! $AWK 'function foo() {}' >/dev/null 2>&1 ; then + AC_MSG_RESULT([yes]) + AC_MSG_ERROR([You should install GNU awk]) + else + AC_MSG_RESULT([no]) + fi + ;; + esac + PHP_SUBST(AWK) +]) + +dnl +dnl PHP_PROG_BISON([MIN-VERSION], [EXCLUDED-VERSION...]) +dnl +dnl Search for bison and optionally check if version is at least the minimum +dnl required version MIN-VERSION and doesn't match any of the blank separated +dnl list of excluded versions EXCLUDED-VERSION (for example "3.0 3.2"). +dnl +AC_DEFUN([PHP_PROG_BISON], [ + AC_CHECK_PROG(YACC, bison, bison) + + ifelse($1,,php_bison_required_version='',php_bison_required_version="$1") + ifelse($2,,php_bison_excluded_versions='none',php_bison_excluded_versions="$2") + + if test -n "$YACC"; then + AC_MSG_CHECKING([for bison version]) + + php_bison_version=$($YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | tr -d a-z) + if test -z "$php_bison_version"; then + php_bison_version=0.0.0 + fi + ac_IFS=$IFS; IFS="." + set $php_bison_version + IFS=$ac_IFS + php_bison_num=`expr [$]{1:-0} \* 10000 + [$]{2:-0} \* 100 + [$]{3:-0}` + php_bison_branch="[$]1.[$]2" + php_bison_check=ok + + if test -z "$php_bison_required_version" && test -z "$php_bison_num"; then + php_bison_check=invalid + elif test -n "$php_bison_required_version"; then + ac_IFS=$IFS; IFS="." + set $php_bison_required_version + IFS=$ac_IFS + php_bison_required_num=`expr [$]{1:-0} \* 10000 + [$]{2:-0} \* 100 + [$]{3:-0}` + php_bison_required_version="$php_bison_required_version or later" + + if test -z "$php_bison_num" || test "$php_bison_num" -lt "$php_bison_required_num"; then + php_bison_check=invalid + fi + fi + + for php_bison_check_version in $php_bison_excluded_versions; do + if test "$php_bison_version" = "$php_bison_check_version" || test "$php_bison_branch" = "$php_bison_check_version"; then + php_bison_check=invalid + break + fi + done + + if test "$php_bison_check" != "invalid"; then + PHP_SUBST_OLD([YFLAGS], [-Wall]) + AC_MSG_RESULT([$php_bison_version (ok)]) + else + AC_MSG_RESULT([$php_bison_version]) + fi + fi + + case $php_bison_check in + ""|invalid[)] + if test ! -f "$abs_srcdir/Zend/zend_language_parser.h" || test ! -f "$abs_srcdir/Zend/zend_language_parser.c"; then + AC_MSG_ERROR([bison $php_bison_required_version is required to generate PHP parsers (excluded versions: $php_bison_excluded_versions).]) + fi + + YACC="exit 0;" + ;; + esac + + PHP_SUBST(YACC) +]) + +dnl +dnl PHP_PROG_RE2C([MIN-VERSION]) +dnl +dnl Search for the re2c and optionally check if version is at least the minimum +dnl required version MIN-VERSION. +dnl +AC_DEFUN([PHP_PROG_RE2C],[ + AC_CHECK_PROG(RE2C, re2c, re2c) + + ifelse($1,,php_re2c_required_version='',php_re2c_required_version="$1") + + if test -n "$RE2C"; then + AC_MSG_CHECKING([for re2c version]) + + php_re2c_version=$($RE2C --version | cut -d ' ' -f 2 2>/dev/null) + if test -z "$php_re2c_version"; then + php_re2c_version=0.0.0 + fi + ac_IFS=$IFS; IFS="." + set $php_re2c_version + IFS=$ac_IFS + php_re2c_num=`expr [$]{1:-0} \* 10000 + [$]{2:-0} \* 100 + [$]{3:-0}` + php_re2c_check=ok + + if test -z "$php_re2c_required_version" && test -z "$php_re2c_num"; then + php_re2c_check=invalid + elif test -n "$php_re2c_required_version"; then + ac_IFS=$IFS; IFS="." + set $php_re2c_required_version + IFS=$ac_IFS + php_re2c_required_num=`expr [$]{1:-0} \* 10000 + [$]{2:-0} \* 100 + [$]{3:-0}` + php_re2c_required_version="$php_re2c_required_version or later" + + if test -z "$php_re2c_num" || test "$php_re2c_num" -lt "$php_re2c_required_num"; then + php_re2c_check=invalid + fi + fi + + if test "$php_re2c_check" != "invalid"; then + AC_MSG_RESULT([$php_re2c_version (ok)]) + else + AC_MSG_RESULT([$php_re2c_version (too old)]) + fi + fi + + case $php_re2c_check in + ""|invalid[)] + if test ! -f "$abs_srcdir/Zend/zend_language_scanner.c"; then + AC_MSG_ERROR([re2c $php_re2c_required_version is required to generate PHP lexers.]) + fi + + RE2C="exit 0;" + ;; + esac + + PHP_SUBST(RE2C) +]) + +AC_DEFUN([PHP_PROG_PHP],[ + AC_CHECK_PROG(PHP, php, php) + + if test -n "$PHP"; then + AC_MSG_CHECKING([for php version]) + php_version=$($PHP -v | head -n1 | cut -d ' ' -f 2 | cut -d '-' -f 1) + if test -z "$php_version"; then + php_version=0.0.0 + fi + ac_IFS=$IFS; IFS="." + set $php_version + IFS=$ac_IFS + php_version_num=`expr [$]{1:-0} \* 10000 + [$]{2:-0} \* 100 + [$]{3:-0}` + dnl Minimum supported version for gen_stub.php is PHP 7.4. + if test "$php_version_num" -lt 70400; then + AC_MSG_RESULT([$php_version (too old)]) + unset PHP + else + AC_MSG_RESULT([$php_version (ok)]) + fi + fi + PHP_SUBST(PHP) +]) + +dnl ---------------------------------------------------------------------------- +dnl Common setup macros: PHP_SETUP_ +dnl ---------------------------------------------------------------------------- + +dnl +dnl PHP_SETUP_ICU([shared-add]) +dnl +dnl Common setup macro for ICU. +dnl +AC_DEFUN([PHP_SETUP_ICU],[ + PKG_CHECK_MODULES([ICU], [icu-uc >= 50.1 icu-io icu-i18n]) + + PHP_EVAL_INCLINE($ICU_CFLAGS) + PHP_EVAL_LIBLINE($ICU_LIBS, $1) + + ICU_CFLAGS="$ICU_CFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" + ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit" + + if test "$PKG_CONFIG icu-io --atleast-version=60"; then + ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1" + fi +]) + +dnl +dnl PHP_SETUP_OPENSSL(shared-add [, action-found [, action-not-found]]) +dnl +dnl Common setup macro for openssl. +dnl +AC_DEFUN([PHP_SETUP_OPENSSL],[ + found_openssl=no + + PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.2], [found_openssl=yes]) + + if test "$found_openssl" = "yes"; then + PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1) + PHP_EVAL_INCLINE($OPENSSL_CFLAGS) +ifelse([$2],[],:,[$2]) +ifelse([$3],[],,[else $3]) + fi +]) + +dnl +dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]]) +dnl +dnl Common setup macro for iconv. +dnl +AC_DEFUN([PHP_SETUP_ICONV], [ + found_iconv=no + unset ICONV_DIR + + dnl Check libc first if no path is provided in --with-iconv. + if test "$PHP_ICONV" = "yes"; then + dnl Reset LIBS temporarily as it may have already been included -liconv in. + LIBS_save="$LIBS" + LIBS= + AC_CHECK_FUNC(iconv, [ + found_iconv=yes + ],[ + AC_CHECK_FUNC(libiconv,[ + AC_DEFINE(HAVE_LIBICONV, 1, [ ]) + found_iconv=yes + ]) + ]) + LIBS="$LIBS_save" + fi + + dnl Check external libs for iconv funcs. + if test "$found_iconv" = "no"; then + + for i in $PHP_ICONV /usr/local /usr; do + if test -r $i/include/gnu-libiconv/iconv.h; then + ICONV_DIR=$i + ICONV_INCLUDE_DIR=$i/include/gnu-libiconv + iconv_lib_name=iconv + break + elif test -r $i/include/iconv.h; then + ICONV_DIR=$i + ICONV_INCLUDE_DIR=$i/include + iconv_lib_name=iconv + break + fi + done + + if test -z "$ICONV_DIR"; then + AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=]) + fi + + if test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.a || + test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME || + test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.tbd + then + PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [ + found_iconv=yes + AC_DEFINE(HAVE_LIBICONV,1,[ ]) + AC_DEFINE([ICONV_ALIASED_LIBICONV],1,[iconv() is aliased to libiconv() in -liconv]) + ], [ + PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [ + found_iconv=yes + ], [], [ + -L$ICONV_DIR/$PHP_LIBDIR + ]) + ], [ + -L$ICONV_DIR/$PHP_LIBDIR + ]) + fi + fi + + if test "$found_iconv" = "yes"; then + AC_DEFINE(HAVE_ICONV,1,[ ]) + if test -n "$ICONV_DIR"; then + PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/$PHP_LIBDIR, $1) + PHP_ADD_INCLUDE($ICONV_INCLUDE_DIR) + fi + $2 +ifelse([$3],[],,[else $3]) + fi +]) + +dnl +dnl PHP_SETUP_LIBXML(shared-add [, action-found]) +dnl +dnl Common setup macro for libxml. +dnl +AC_DEFUN([PHP_SETUP_LIBXML], [ + PKG_CHECK_MODULES([LIBXML], [libxml-2.0 >= 2.9.0]) + + PHP_EVAL_INCLINE($LIBXML_CFLAGS) + PHP_EVAL_LIBLINE($LIBXML_LIBS, $1) + + AC_DEFINE(HAVE_LIBXML, 1, [ ]) + + $2 +]) + +dnl +dnl PHP_SETUP_EXPAT([shared-add]) +dnl +dnl Common setup macro for expat. +dnl +AC_DEFUN([PHP_SETUP_EXPAT], [ + PKG_CHECK_MODULES([EXPAT], [expat]) + + PHP_EVAL_INCLINE($EXPAT_CFLAGS) + PHP_EVAL_LIBLINE($EXPAT_LIBS, $1) + + AC_DEFINE(HAVE_LIBEXPAT, 1, [ ]) +]) + +dnl ---------------------------------------------------------------------------- +dnl Misc. macros +dnl ---------------------------------------------------------------------------- + +dnl +dnl PHP_INSTALL_HEADERS(path [, file ...]) +dnl +dnl PHP header files to be installed. +dnl +AC_DEFUN([PHP_INSTALL_HEADERS],[ + ifelse([$2],[],[ + for header_file in $1; do + PHP_RUN_ONCE(INSTALLHEADERS, $header_file, [ + INSTALL_HEADERS="$INSTALL_HEADERS $header_file" + ]) + done + ], [ + header_path=$1 + for header_file in $2; do + hp_hf="$header_path/$header_file" + PHP_RUN_ONCE(INSTALLHEADERS, $hp_hf, [ + INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" + ]) + done + ]) +]) + +dnl +dnl PHP_AP_EXTRACT_VERSION(/path/httpd) +dnl +dnl This macro is used to get a comparable version for Apache. +dnl +AC_DEFUN([PHP_AP_EXTRACT_VERSION],[ + ac_output=`$1 -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'` + ac_IFS=$IFS +IFS="- /. +" + set $ac_output + IFS=$ac_IFS + + APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6` +]) + +dnl +dnl PHP_CONFIG_NICE(filename) +dnl +dnl This macro creates script file with given filename which includes the last +dnl configure command run by user. This file is named 'config.nice' in PHP. +dnl +AC_DEFUN([PHP_CONFIG_NICE],[ + AC_REQUIRE([AC_PROG_EGREP]) + AC_REQUIRE([AC_PROG_SED]) + PHP_SUBST_OLD(EGREP) + PHP_SUBST_OLD(SED) + test -f $1 && mv $1 $1.old + rm -f $1.old + cat >$1<> $1 + if test `expr "X$ac_configure_args" : ".*${var}.*"` != 0; then + clean_configure_args=$(echo $clean_configure_args | sed -e "s#'$var=$val'##") + fi + fi + done + + echo "'[$]0' \\" >> $1 + if test `expr " [$]0" : " '.*"` = 0; then + CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]0'" + else + CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0" + fi + CONFIGURE_ARGS="$clean_configure_args" + while test "X$CONFIGURE_ARGS" != "X"; + do + if CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\('[[^']]*'\)"` + then + CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *'[[^']]*' \(.*\)"` + elif CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\([[^ ]]*\)"` + then + CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *[[^ ]]* \(.*\)"` + CURRENT_ARG="'$CURRENT_ARG'" + else + break + fi + AS_ECHO(["$CURRENT_ARG \\"]) >>$1 + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $CURRENT_ARG" + done + echo '"[$]@"' >> $1 + chmod +x $1 + CONFIGURE_COMMAND="$CONFIGURE_COMMAND $CONFIGURE_OPTIONS" + PHP_SUBST_OLD(CONFIGURE_COMMAND) + PHP_SUBST_OLD(CONFIGURE_OPTIONS) +]) + +dnl +dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]]) +dnl +AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[ + AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [ + if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then + pdo_cv_inc_path=$abs_srcdir/ext + elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then + pdo_cv_inc_path=$abs_srcdir/ext + elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then + pdo_cv_inc_path=$phpincludedir/ext + fi + ]) + if test -n "$pdo_cv_inc_path"; then +ifelse([$1],[],:,[$1]) + else +ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2]) + fi +]) + +dnl +dnl PHP_DETECT_ICC +dnl +dnl Detect Intel C++ Compiler and unset $GCC if ICC found. +dnl +AC_DEFUN([PHP_DETECT_ICC], +[ + ICC="no" + AC_MSG_CHECKING([for icc]) + AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER], + ICC="no" + AC_MSG_RESULT([no]), + ICC="yes" + GCC="no" + AC_MSG_RESULT([yes]) + ) +]) + +dnl +dnl PHP_DETECT_SUNCC +dnl +dnl Detect if the systems default compiler is suncc. We also set some useful +dnl CFLAGS if the user didn't set any. +dnl +AC_DEFUN([PHP_DETECT_SUNCC],[ + SUNCC="no" + AC_MSG_CHECKING([for suncc]) + AC_EGREP_CPP([^__SUNPRO_C], [__SUNPRO_C], + SUNCC="no" + AC_MSG_RESULT([no]), + SUNCC="yes" + GCC="no" + test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload" + GCC="" + AC_MSG_RESULT([yes]) + ) +]) + +dnl +dnl PHP_CRYPT_R_STYLE +dnl +dnl Detect the style of crypt_r() if any is available. +dnl See APR_CHECK_CRYPT_R_STYLE() for original version. +dnl +AC_DEFUN([PHP_CRYPT_R_STYLE], +[ + AC_CACHE_CHECK([which data struct is used by crypt_r], php_cv_crypt_r_style,[ + php_cv_crypt_r_style=none + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#define _REENTRANT 1 +#include +]], [[ +CRYPTD buffer; +crypt_r("passwd", "hash", &buffer); +]])],[php_cv_crypt_r_style=cryptd],[]) + + if test "$php_cv_crypt_r_style" = "none"; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#define _REENTRANT 1 +#include +]],[[ +struct crypt_data buffer; +crypt_r("passwd", "hash", &buffer); +]])],[php_cv_crypt_r_style=struct_crypt_data],[]) + fi + + if test "$php_cv_crypt_r_style" = "none"; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#define _REENTRANT 1 +#define _GNU_SOURCE +#include +]],[[ +struct crypt_data buffer; +crypt_r("passwd", "hash", &buffer); +]])],[php_cv_crypt_r_style=struct_crypt_data_gnu_source],[]) + fi + + if test "$php_cv_crypt_r_style" = "none"; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +]],[[ +struct crypt_data buffer; +crypt_r("passwd", "hash", &buffer); +]])],[php_cv_crypt_r_style=struct_crypt_data],[]) + fi + ]) + + if test "$php_cv_crypt_r_style" = "cryptd"; then + AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD]) + fi + if test "$php_cv_crypt_r_style" = "struct_crypt_data" -o "$php_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then + AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data]) + fi + if test "$php_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then + AC_DEFINE(CRYPT_R_GNU_SOURCE, 1, [Define if struct crypt_data requires _GNU_SOURCE]) + fi + if test "$php_cv_crypt_r_style" = "none"; then + AC_MSG_ERROR([Unable to detect data struct used by crypt_r]) + fi +]) + +dnl +dnl PHP_TEST_WRITE_STDOUT +dnl +AC_DEFUN([PHP_TEST_WRITE_STDOUT],[ + AC_CACHE_CHECK(whether writing to stdout works,ac_cv_write_stdout,[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#ifdef HAVE_UNISTD_H +#include +#endif + +#define TEXT "This is the test message -- " + +int main(void) +{ + int n; + + n = write(1, TEXT, sizeof(TEXT)-1); + return (!(n == sizeof(TEXT)-1)); +} + ]])],[ + ac_cv_write_stdout=yes + ],[ + ac_cv_write_stdout=no + ],[ + case $host_alias in + *linux*) + ac_cv_write_stdout=yes + ;; + *) + ac_cv_write_stdout=no + ;; + esac + ]) + ]) + if test "$ac_cv_write_stdout" = "yes"; then + AC_DEFINE(PHP_WRITE_STDOUT, 1, [whether write(2) works]) + fi +]) + +dnl +dnl PHP_INIT_DTRACE(providerdesc, header-file, sources [, module]) +dnl +AC_DEFUN([PHP_INIT_DTRACE],[ +dnl Set paths properly when called from extension. + case "$4" in + ""[)] ac_srcdir="$abs_srcdir/"; unset ac_bdir;; + /*[)] ac_srcdir=`echo "$4"|cut -c 2-`"/"; ac_bdir=$ac_srcdir;; + *[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$4/";; + esac + +dnl providerdesc. + ac_provsrc=$1 + old_IFS=[$]IFS + IFS=. + set $ac_provsrc + ac_provobj=[$]1 + IFS=$old_IFS + +dnl header-file. + ac_hdrobj=$2 + +dnl Add providerdesc.o or .lo into global objects when needed. + case $host_alias in + *freebsd*) + PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo" + PHP_LDFLAGS="$PHP_LDFLAGS -lelf" + ;; + *solaris*) + PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo" + ;; + *linux*) + PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo" + ;; + esac + +dnl DTrace objects. + old_IFS=[$]IFS + for ac_src in $3; do + IFS=. + set $ac_src + ac_obj=[$]1 + IFS=$old_IFS + + PHP_DTRACE_OBJS="[$]PHP_DTRACE_OBJS [$]ac_bdir[$]ac_obj.lo" + done; + + case [$]php_sapi_module in + shared[)] + for ac_lo in $PHP_DTRACE_OBJS; do + dtrace_objs="[$]dtrace_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" + done; + ;; + *[)] + dtrace_objs='$(PHP_DTRACE_OBJS:.lo=.o)' + ;; + esac + +dnl Generate Makefile.objects entries. The empty $ac_provsrc command stops an +dnl implicit circular dependency in GNU Make which causes the .d file to be +dnl overwritten (Bug 61268). + cat>>Makefile.objects< \$[]@ + +\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj + +EOF + + case $host_alias in + *solaris*|*linux*|*freebsd*) + dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o" + dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs" + dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o" + dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)' + for ac_lo in $PHP_DTRACE_OBJS; do + dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" + done; + dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692) + cat>>Makefile.objects< \$[]@ + @test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir + if CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] + echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\] + else [\\] + echo "pic_object='none'" >> \$[]@ [;\\] + fi + if CC="\$(CC)" CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] + echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\] + else [\\] + echo "non_pic_object='none'" >> \$[]@ [;\\] + fi + +EOF + + ;; + *) +cat>>Makefile.objects< $srcdir/$1.tmp && mv $srcdir/$1.tmp $srcdir/$1 +]) + +dnl Check if we have prctl +AC_DEFUN([PHP_CHECK_PRCTL], +[ + AC_MSG_CHECKING([for prctl]) + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[prctl(0, 0, 0, 0, 0);]])], [ + AC_DEFINE([HAVE_PRCTL], 1, [do we have prctl?]) + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + ]) +]) + +dnl Check if we have procctl +AC_DEFUN([PHP_CHECK_PROCCTL], +[ + AC_MSG_CHECKING([for procctl]) + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[procctl(0, 0, 0, 0);]])], [ + AC_DEFINE([HAVE_PROCCTL], 1, [do we have procctl?]) + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + ]) +]) + +dnl +dnl PHP_CHECK_AVX512_SUPPORTS +dnl +AC_DEFUN([PHP_CHECK_AVX512_SUPPORTS], [ + AC_MSG_CHECKING([for avx512 supports in compiler]) + save_CFLAGS="$CFLAGS" + CFLAGS="-mavx512f -mavx512cd -mavx512vl -mavx512dq -mavx512bw $CFLAGS" + + AC_LINK_IFELSE([AC_LANG_SOURCE([[ + #include + int main(void) { + __m512i mask = _mm512_set1_epi32(0x1); + char out[32]; + _mm512_storeu_si512(out, _mm512_shuffle_epi8(mask, mask)); + return 0; + }]])], [ + have_avx512_supports=1 + AC_MSG_RESULT([yes]) + ], [ + have_avx512_supports=0 + AC_MSG_RESULT([no]) + ]) + + CFLAGS="$save_CFLAGS" + + AC_DEFINE_UNQUOTED([PHP_HAVE_AVX512_SUPPORTS], + [$have_avx512_supports], [Whether the compiler supports AVX512]) +]) + +dnl +dnl PHP_CHECK_AVX512_VBMI_SUPPORTS +dnl +AC_DEFUN([PHP_CHECK_AVX512_VBMI_SUPPORTS], [ + AC_MSG_CHECKING([for avx512 vbmi supports in compiler]) + save_CFLAGS="$CFLAGS" + CFLAGS="-mavx512f -mavx512cd -mavx512vl -mavx512dq -mavx512bw -mavx512vbmi $CFLAGS" + AC_LINK_IFELSE([AC_LANG_SOURCE([[ + #include + int main(void) { + __m512i mask = _mm512_set1_epi32(0x1); + char out[32]; + _mm512_storeu_si512(out, _mm512_permutexvar_epi8(mask, mask)); + return 0; + }]])], [ + have_avx512_vbmi_supports=1 + AC_MSG_RESULT([yes]) + ], [ + have_avx512_vbmi_supports=0 + AC_MSG_RESULT([no]) + ]) + CFLAGS="$save_CFLAGS" + AC_DEFINE_UNQUOTED([PHP_HAVE_AVX512_VBMI_SUPPORTS], + [$have_avx512_vbmi_supports], [Whether the compiler supports AVX512 VBMI]) +]) diff --git a/lib/php/build/php_cxx_compile_stdcxx.m4 b/lib/php/build/php_cxx_compile_stdcxx.m4 new file mode 100644 index 0000000..f8e97fc --- /dev/null +++ b/lib/php/build/php_cxx_compile_stdcxx.m4 @@ -0,0 +1,956 @@ +dnl +dnl Based on https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +dnl Author: Anatol Belski +dnl +dnl PHP_CXX_COMPILE_STDCXX(version, mandatory|optional, var_name_to_put_switch_in) +dnl +dnl ARGUMENTS +dnl +dnl first arg - version as 11, 14, 17 or 20 +dnl second arg - if mandatory, the configure will fail when no features found. +dnl Optional will make configure silently continue +dnl third arg - a variable name where the corresponding switch would be put. If +dnl the variable is already defined, its contents will be overwritten. +dnl +dnl EXAMPLE +dnl +dnl PHP_CXX_COMPILE_STDCXX(14, mandatory, MY_STDCXX_SWiTCH) +dnl echo $MY_STDCXX_SWITCH +dnl + +dnl +dnl PHP specific implementation start. +dnl + +AC_DEFUN([PHP_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [$1], [20], [ax_cxx_compile_alternatives="20"], + [m4_fatal([invalid first argument `$1' to PHP_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [ax_cxx_compile_cxx$1_required=true], + [$2], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$2], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$2' to PHP_CXX_COMPILE_STDCXX])])dnl + AC_LANG_PUSH([C++])dnl + ac_success=no + + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + eval AS_TR_SH([$3])="$switch" + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + fi + AC_SUBST(HAVE_CXX$1) +]) + + +dnl +dnl PHP specific implementation end. +dnl The relevant part of the unchanged original implementation is below. +dnl + +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016, 2018 Krzesimir Nowak +# Copyright (c) 2019 Enji Cooper +# Copyright (c) 2020 Jason Merrill +# Copyright (c) 2021 Jörn Heusipp +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +dnl Test body for checking C++17 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Test body for checking C++20 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 +) + + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L + +]]) + + +dnl Tests for new features in C++20 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L + +]]) diff --git a/lib/php/build/phpize.m4 b/lib/php/build/phpize.m4 new file mode 100644 index 0000000..616d164 --- /dev/null +++ b/lib/php/build/phpize.m4 @@ -0,0 +1,224 @@ +dnl This file becomes configure.ac for self-contained extensions. + +dnl Include external macro definitions before the AC_INIT to also remove +dnl comments starting with # and empty newlines from the included files. +m4_include([build/ax_check_compile_flag.m4]) +m4_include([build/ax_gcc_func_attribute.m4]) +m4_include([build/libtool.m4]) +m4_include([build/php_cxx_compile_stdcxx.m4]) +m4_include([build/php.m4]) +m4_include([build/pkg.m4]) + +AC_PREREQ([2.68]) +AC_INIT +AC_CONFIG_SRCDIR([config.m4]) +AC_CONFIG_AUX_DIR([build]) +AC_PRESERVE_HELP_ORDER + +PHP_CONFIG_NICE(config.nice) + +AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl +AC_DEFUN([PHP_EXT_DIR],[""])dnl +AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl +AC_DEFUN([PHP_ALWAYS_SHARED],[ + ext_output="yes, shared" + ext_shared=yes + test "[$]$1" = "no" && $1=yes +])dnl + +test -z "$CFLAGS" && auto_cflags=1 + +abs_srcdir=`(cd $srcdir && pwd)` +abs_builddir=`pwd` + +PKG_PROG_PKG_CONFIG +AC_PROG_CC([cc gcc]) +PHP_DETECT_ICC +PHP_DETECT_SUNCC + +dnl Support systems with system libraries in e.g. /usr/lib64. +PHP_ARG_WITH([libdir], + [for system library directory], + [AS_HELP_STRING([--with-libdir=NAME], + [Look for libraries in .../NAME rather than .../lib])], + [lib], + [no]) + +PHP_RUNPATH_SWITCH +PHP_SHLIB_SUFFIX_NAMES + +dnl Find php-config script. +PHP_ARG_WITH([php-config],, + [AS_HELP_STRING([--with-php-config=PATH], + [Path to php-config [php-config]])], + [php-config], + [no]) + +dnl For BC. +PHP_CONFIG=$PHP_PHP_CONFIG +prefix=`$PHP_CONFIG --prefix 2>/dev/null` +phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null` +INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` +EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null` +PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null` + +if test -z "$prefix"; then + AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH]) +fi + +php_shtool=$srcdir/build/shtool +PHP_INIT_BUILD_SYSTEM + +AC_MSG_CHECKING([for PHP prefix]) +AC_MSG_RESULT([$prefix]) +AC_MSG_CHECKING([for PHP includes]) +AC_MSG_RESULT([$INCLUDES]) +AC_MSG_CHECKING([for PHP extension directory]) +AC_MSG_RESULT([$EXTENSION_DIR]) +AC_MSG_CHECKING([for PHP installed headers prefix]) +AC_MSG_RESULT([$phpincludedir]) + +dnl Checks for PHP_DEBUG / ZEND_DEBUG / ZTS. +AC_MSG_CHECKING([if debug is enabled]) +old_CPPFLAGS=$CPPFLAGS +CPPFLAGS="-I$phpincludedir" +AC_EGREP_CPP(php_debug_is_enabled,[ +#include
+#if ZEND_DEBUG +php_debug_is_enabled +#endif +],[ + PHP_DEBUG=yes +],[ + PHP_DEBUG=no +]) +CPPFLAGS=$old_CPPFLAGS +AC_MSG_RESULT([$PHP_DEBUG]) + +AC_MSG_CHECKING([if zts is enabled]) +old_CPPFLAGS=$CPPFLAGS +CPPFLAGS="-I$phpincludedir" +AC_EGREP_CPP(php_zts_is_enabled,[ +#include
+#if ZTS +php_zts_is_enabled +#endif +],[ + PHP_THREAD_SAFETY=yes +],[ + PHP_THREAD_SAFETY=no +]) +CPPFLAGS=$old_CPPFLAGS +AC_MSG_RESULT([$PHP_THREAD_SAFETY]) + +dnl Discard optimization flags when debugging is enabled. +if test "$PHP_DEBUG" = "yes"; then + PHP_DEBUG=1 + ZEND_DEBUG=yes + changequote({,}) + CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'` + CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'` + changequote([,]) + dnl Add -O0 only if GCC or ICC is used. + if test "$GCC" = "yes" || test "$ICC" = "yes"; then + CFLAGS="$CFLAGS -O0" + CXXFLAGS="$CXXFLAGS -g -O0" + fi + if test "$SUNCC" = "yes"; then + if test -n "$auto_cflags"; then + CFLAGS="-g" + CXXFLAGS="-g" + else + CFLAGS="$CFLAGS -g" + CXXFLAGS="$CFLAGS -g" + fi + fi +else + PHP_DEBUG=0 + ZEND_DEBUG=no +fi + +dnl Always shared. +PHP_BUILD_SHARED + +dnl Required programs. +PHP_PROG_AWK + +sinclude(config.m4) + +enable_static=no +enable_shared=yes + +dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by +dnl PHP_REQUIRE_CXX). Otherwise AC_PROG_LIBTOOL fails if there is no working C++ +dnl compiler. +AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [ + undefine([AC_PROG_CXX]) + AC_DEFUN([AC_PROG_CXX], []) + undefine([AC_PROG_CXXCPP]) + AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled]) +]) +AC_PROG_LIBTOOL + +all_targets='$(PHP_MODULES) $(PHP_ZEND_EX)' +install_targets="install-modules install-headers" +phplibdir="`pwd`/modules" +CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" +CFLAGS_CLEAN='$(CFLAGS) -D_GNU_SOURCE' +CXXFLAGS_CLEAN='$(CXXFLAGS)' + +test "$prefix" = "NONE" && prefix="/usr/local" +test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' + +if test "$cross_compiling" = yes ; then + AC_MSG_CHECKING(for native build C compiler) + AC_CHECK_PROGS(BUILD_CC, [gcc clang c99 c89 cc cl],none) + AC_MSG_RESULT($BUILD_CC) +else + BUILD_CC=$CC +fi + +PHP_SUBST(PHP_MODULES) +PHP_SUBST(PHP_ZEND_EX) + +PHP_SUBST(all_targets) +PHP_SUBST(install_targets) + +PHP_SUBST(prefix) +PHP_SUBST(exec_prefix) +PHP_SUBST(libdir) +PHP_SUBST(prefix) +PHP_SUBST(phplibdir) +PHP_SUBST(phpincludedir) + +PHP_SUBST(CC) +PHP_SUBST(CFLAGS) +PHP_SUBST(CFLAGS_CLEAN) +PHP_SUBST(CPP) +PHP_SUBST(CPPFLAGS) +PHP_SUBST(CXX) +PHP_SUBST(CXXFLAGS) +PHP_SUBST(CXXFLAGS_CLEAN) +PHP_SUBST(EXTENSION_DIR) +PHP_SUBST(PHP_EXECUTABLE) +PHP_SUBST(EXTRA_LDFLAGS) +PHP_SUBST(EXTRA_LIBS) +PHP_SUBST(INCLUDES) +PHP_SUBST(LFLAGS) +PHP_SUBST(LDFLAGS) +PHP_SUBST(SHARED_LIBTOOL) +PHP_SUBST(LIBTOOL) +PHP_SUBST(SHELL) +PHP_SUBST(INSTALL_HEADERS) +PHP_SUBST(BUILD_CC) + +PHP_GEN_BUILD_DIRS +PHP_GEN_GLOBAL_MAKEFILE + +test -d modules || $php_shtool mkdir modules + +AC_CONFIG_HEADERS([config.h]) + +AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([config.h.in])]) + +AC_OUTPUT diff --git a/lib/php/build/pkg.m4 b/lib/php/build/pkg.m4 new file mode 100644 index 0000000..5bf9ba1 --- /dev/null +++ b/lib/php/build/pkg.m4 @@ -0,0 +1,275 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) + +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +dnl 02110-1301, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.2]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])dnl PKG_PROG_PKG_CONFIG + +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurrence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])dnl _PKG_CONFIG + +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])dnl _PKG_SHORT_ERRORS_SUPPORTED + + +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $2]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR diff --git a/lib/php/build/run-tests.php b/lib/php/build/run-tests.php new file mode 100644 index 0000000..880ee29 --- /dev/null +++ b/lib/php/build/run-tests.php @@ -0,0 +1,4266 @@ +#!/usr/bin/env php + | + | Preston L. Bannister | + | Marcus Boerger | + | Derick Rethans | + | Sander Roobol | + | Andrea Faulds | + | (based on version by: Stig Bakken ) | + | (based on the PHP 3 test framework by Rasmus Lerdorf) | + +----------------------------------------------------------------------+ + */ + +/* Temporary variables while this file is being refactored. */ +/** @var ?JUnit */ +$junit = null; + +/* End temporary variables. */ + +/* Let there be no top-level code beyond this point: + * Only functions and classes, thanks! + * + * Minimum required PHP version: 7.4.0 + */ + +function show_usage(): void +{ + echo << Run up to simultaneous testing processes in parallel for + quicker testing on systems with multiple logical processors. + Note that this is experimental feature. + + -l Read the testfiles to be executed from . After the test + has finished all failed tests are written to the same . + If the list is empty and no further test is specified then + all tests are executed (same as: -r -w ). + + -r Read the testfiles to be executed from . + + -w Write a list of all failed tests to . + + -a Same as -w but append rather then truncating . + + -W Write a list of all tests and their result status to . + + -c Look for php.ini in directory or use as ini. + + -n Pass -n option to the php binary (Do not use a php.ini). + + -d foo=bar Pass -d option to the php binary (Define INI entry foo + with value 'bar'). + + -g Comma separated list of groups to show during test run + (possible values: PASS, FAIL, XFAIL, XLEAK, SKIP, BORK, WARN, LEAK, REDIRECT). + + -m Test for memory leaks with Valgrind (equivalent to -M memcheck). + + -M Test for errors with Valgrind tool. + + -p Specify PHP executable to run. + + -P Use PHP_BINARY as PHP executable to run (default). + + -q Quiet, no user interaction (same as environment NO_INTERACTION). + + -s Write output to . + + -x Sets 'SKIP_SLOW_TESTS' environmental variable. + + --offline Sets 'SKIP_ONLINE_TESTS' environmental variable. + + --verbose + -v Verbose mode. + + --help + -h This Help. + + --temp-source --temp-target [--temp-urlbase ] + Write temporary files to by replacing from the + filenames to generate with . In general you want to make + the path to your source files and some patch in + your web page hierarchy with pointing to . + + --keep-[all|php|skip|clean] + Do not delete 'all' files, 'php' test file, 'skip' or 'clean' + file. + + --set-timeout + Set timeout for individual tests, where is the number of + seconds. The default value is 60 seconds, or 300 seconds when + testing for memory leaks. + + --context + Sets the number of lines of surrounding context to print for diffs. + The default value is 3. + + --show-[all|php|skip|clean|exp|diff|out|mem] + Show 'all' files, 'php' test file, 'skip' or 'clean' file. You + can also use this to show the output 'out', the expected result + 'exp', the difference between them 'diff' or the valgrind log + 'mem'. The result types get written independent of the log format, + however 'diff' only exists when a test fails. + + --show-slow + Show all tests that took longer than milliseconds to run. + + --no-clean Do not execute clean section if any. + + --color + --no-color Do/Don't colorize the result type in the test result. + + --progress + --no-progress Do/Don't show the current progress. + + --repeat [n] + Run the tests multiple times in the same process and check the + output of the last execution (CLI SAPI only). + + --bless Bless failed tests using scripts/dev/bless_tests.php. + +HELP; +} + +/** + * One function to rule them all, one function to find them, one function to + * bring them all and in the darkness bind them. + * This is the entry point and exit point überfunction. It contains all the + * code that was previously found at the top level. It could and should be + * refactored to be smaller and more manageable. + */ +function main(): void +{ + /* This list was derived in a naïve mechanical fashion. If a member + * looks like it doesn't belong, it probably doesn't; cull at will. + */ + global $DETAILED, $PHP_FAILED_TESTS, $SHOW_ONLY_GROUPS, $argc, $argv, $cfg, + $cfgfiles, $cfgtypes, $conf_passed, $end_time, $environment, + $exts_skipped, $exts_tested, $exts_to_test, $failed_tests_file, + $ignored_by_ext, $ini_overwrites, $is_switch, $colorize, + $log_format, $matches, $no_clean, $no_file_cache, + $optionals, $pass_option_n, $pass_options, + $pattern_match, $php, $php_cgi, $phpdbg, $preload, $redir_tests, + $repeat, $result_tests_file, $slow_min_ms, $start_time, $switch, + $temp_source, $temp_target, $test_cnt, $test_dirs, + $test_files, $test_idx, $test_list, $test_results, $testfile, + $user_tests, $valgrind, $sum_results, $shuffle, $file_cache, $num_repeats, + $bless, $show_progress; + // Parallel testing + global $workers, $workerID; + global $context_line_count; + + // Temporary for the duration of refactoring + /** @var JUnit */ + global $junit; + + define('IS_WINDOWS', substr(PHP_OS, 0, 3) == "WIN"); + + $workerID = 0; + if (getenv("TEST_PHP_WORKER")) { + $workerID = intval(getenv("TEST_PHP_WORKER")); + run_worker(); + return; + } + + define('INIT_DIR', getcwd()); + + // Change into the PHP source directory. + if (getenv('TEST_PHP_SRCDIR')) { + @chdir(getenv('TEST_PHP_SRCDIR')); + } + + define('TEST_PHP_SRCDIR', getcwd()); + + check_proc_open_function_exists(); + + // If timezone is not set, use UTC. + if (ini_get('date.timezone') == '') { + date_default_timezone_set('UTC'); + } + + // Delete some security related environment variables + putenv('SSH_CLIENT=deleted'); + putenv('SSH_AUTH_SOCK=deleted'); + putenv('SSH_TTY=deleted'); + putenv('SSH_CONNECTION=deleted'); + + set_time_limit(0); + + ini_set('pcre.backtrack_limit', PHP_INT_MAX); + + init_output_buffers(); + + error_reporting(E_ALL); + + $environment = $_ENV ?? []; + + // Some configurations like php.ini-development set variables_order="GPCS" + // not "EGPCS", in which case $_ENV is NOT populated. Detect if the $_ENV + // was empty and handle it by explicitly populating through getenv(). + if (empty($environment)) { + $environment = getenv(); + } + + if (empty($environment['TEMP'])) { + $environment['TEMP'] = sys_get_temp_dir(); + + if (empty($environment['TEMP'])) { + // For example, OpCache on Windows will fail in this case because + // child processes (for tests) will not get a TEMP variable, so + // GetTempPath() will fallback to c:\windows, while GetTempPath() + // will return %TEMP% for parent (likely a different path). The + // parent will initialize the OpCache in that path, and child will + // fail to reattach to the OpCache because it will be using the + // wrong path. + die("TEMP environment is NOT set"); + } + + if (count($environment) == 1) { + // Not having other environment variables, only having TEMP, is + // probably ok, but strange and may make a difference in the + // test pass rate, so warn the user. + echo "WARNING: Only 1 environment variable will be available to tests(TEMP environment variable)" , PHP_EOL; + } + } + + if (IS_WINDOWS && empty($environment["SystemRoot"])) { + $environment["SystemRoot"] = getenv("SystemRoot"); + } + + $php = null; + $php_cgi = null; + $phpdbg = null; + + if (getenv('TEST_PHP_LOG_FORMAT')) { + $log_format = strtoupper(getenv('TEST_PHP_LOG_FORMAT')); + } else { + $log_format = 'LEODS'; + } + + // Check whether a detailed log is wanted. + if (getenv('TEST_PHP_DETAILED')) { + $DETAILED = getenv('TEST_PHP_DETAILED'); + } else { + $DETAILED = 0; + } + + $junit = new JUnit($environment, $workerID); + + if (getenv('SHOW_ONLY_GROUPS')) { + $SHOW_ONLY_GROUPS = explode(",", getenv('SHOW_ONLY_GROUPS')); + } else { + $SHOW_ONLY_GROUPS = []; + } + + // Check whether user test dirs are requested. + if (getenv('TEST_PHP_USER')) { + $user_tests = explode(',', getenv('TEST_PHP_USER')); + } else { + $user_tests = []; + } + + $exts_to_test = []; + $ini_overwrites = [ + 'output_handler=', + 'open_basedir=', + 'disable_functions=', + 'output_buffering=Off', + 'error_reporting=' . E_ALL, + 'display_errors=1', + 'display_startup_errors=1', + 'log_errors=0', + 'html_errors=0', + 'track_errors=0', + 'report_memleaks=1', + 'report_zend_debug=0', + 'docref_root=', + 'docref_ext=.html', + 'error_prepend_string=', + 'error_append_string=', + 'auto_prepend_file=', + 'auto_append_file=', + 'ignore_repeated_errors=0', + 'precision=14', + 'serialize_precision=-1', + 'memory_limit=128M', + 'opcache.fast_shutdown=0', + 'opcache.file_update_protection=0', + 'opcache.revalidate_freq=0', + 'opcache.jit_hot_loop=1', + 'opcache.jit_hot_func=1', + 'opcache.jit_hot_return=1', + 'opcache.jit_hot_side_exit=1', + 'zend.assertions=1', + 'zend.exception_ignore_args=0', + 'zend.exception_string_param_max_len=15', + 'short_open_tag=0', + ]; + + $no_file_cache = '-d opcache.file_cache= -d opcache.file_cache_only=0'; + + define('TRAVIS_CI', (bool) getenv('TRAVIS')); + + // Determine the tests to be run. + + $test_files = []; + $redir_tests = []; + $test_results = []; + $PHP_FAILED_TESTS = [ + 'BORKED' => [], + 'FAILED' => [], + 'WARNED' => [], + 'LEAKED' => [], + 'XFAILED' => [], + 'XLEAKED' => [], + 'SLOW' => [] + ]; + + // If parameters given assume they represent selected tests to run. + $result_tests_file = false; + $failed_tests_file = false; + $pass_option_n = false; + $pass_options = ''; + + $output_file = INIT_DIR . '/php_test_results_' . date('Ymd_Hi') . '.txt'; + + $just_save_results = false; + $valgrind = null; + $temp_source = null; + $temp_target = null; + $conf_passed = null; + $no_clean = false; + $colorize = true; + if (function_exists('sapi_windows_vt100_support') && !sapi_windows_vt100_support(STDOUT, true)) { + $colorize = false; + } + if (array_key_exists('NO_COLOR', $environment)) { + $colorize = false; + } + $selected_tests = false; + $slow_min_ms = INF; + $preload = false; + $file_cache = null; + $shuffle = false; + $bless = false; + $workers = null; + $context_line_count = 3; + $num_repeats = 1; + $show_progress = true; + $ignored_by_ext = []; + + $cfgtypes = ['show', 'keep']; + $cfgfiles = ['skip', 'php', 'clean', 'out', 'diff', 'exp', 'mem']; + $cfg = []; + + foreach ($cfgtypes as $type) { + $cfg[$type] = []; + + foreach ($cfgfiles as $file) { + $cfg[$type][$file] = false; + } + } + + if (!isset($argc, $argv) || !$argc) { + $argv = [__FILE__]; + $argc = 1; + } + + if (getenv('TEST_PHP_ARGS')) { + $argv = array_merge($argv, explode(' ', getenv('TEST_PHP_ARGS'))); + $argc = count($argv); + } + + for ($i = 1; $i < $argc; $i++) { + $is_switch = false; + $switch = substr($argv[$i], 1, 1); + $repeat = substr($argv[$i], 0, 1) == '-'; + + while ($repeat) { + if (!$is_switch) { + $switch = substr($argv[$i], 1, 1); + } + + $is_switch = true; + + if ($repeat) { + foreach ($cfgtypes as $type) { + if (strpos($switch, '--' . $type) === 0) { + foreach ($cfgfiles as $file) { + if ($switch == '--' . $type . '-' . $file) { + $cfg[$type][$file] = true; + $is_switch = false; + break; + } + } + } + } + } + + if (!$is_switch) { + $is_switch = true; + break; + } + + $repeat = false; + + switch ($switch) { + case 'j': + $workers = substr($argv[$i], 2); + if ($workers == 0 || !preg_match('/^\d+$/', $workers)) { + error("'$workers' is not a valid number of workers, try e.g. -j16 for 16 workers"); + } + $workers = intval($workers, 10); + // Don't use parallel testing infrastructure if there is only one worker. + if ($workers === 1) { + $workers = null; + } + break; + case 'r': + case 'l': + $test_list = file($argv[++$i]); + if ($test_list) { + foreach ($test_list as $test) { + $matches = []; + if (preg_match('/^#.*\[(.*)\]\:\s+(.*)$/', $test, $matches)) { + $redir_tests[] = [$matches[1], $matches[2]]; + } elseif (strlen($test)) { + $test_files[] = trim($test); + } + } + } + if ($switch != 'l') { + break; + } + $i--; + // no break + case 'w': + $failed_tests_file = fopen($argv[++$i], 'w+t'); + break; + case 'a': + $failed_tests_file = fopen($argv[++$i], 'a+t'); + break; + case 'W': + $result_tests_file = fopen($argv[++$i], 'w+t'); + break; + case 'c': + $conf_passed = $argv[++$i]; + break; + case 'd': + $ini_overwrites[] = $argv[++$i]; + break; + case 'g': + $SHOW_ONLY_GROUPS = explode(",", $argv[++$i]); + break; + //case 'h' + case '--keep-all': + foreach ($cfgfiles as $file) { + $cfg['keep'][$file] = true; + } + break; + //case 'l' + case 'm': + $valgrind = new RuntestsValgrind($environment); + break; + case 'M': + $valgrind = new RuntestsValgrind($environment, $argv[++$i]); + break; + case 'n': + if (!$pass_option_n) { + $pass_options .= ' -n'; + } + $pass_option_n = true; + break; + case 'e': + $pass_options .= ' -e'; + break; + case '--preload': + $preload = true; + $environment['SKIP_PRELOAD'] = 1; + break; + case '--file-cache-prime': + $file_cache = 'prime'; + break; + case '--file-cache-use': + $file_cache = 'use'; + break; + case '--no-clean': + $no_clean = true; + break; + case '--color': + $colorize = true; + break; + case '--no-color': + $colorize = false; + break; + case 'p': + $php = $argv[++$i]; + putenv("TEST_PHP_EXECUTABLE=$php"); + $environment['TEST_PHP_EXECUTABLE'] = $php; + break; + case 'P': + $php = PHP_BINARY; + putenv("TEST_PHP_EXECUTABLE=$php"); + $environment['TEST_PHP_EXECUTABLE'] = $php; + break; + case 'q': + putenv('NO_INTERACTION=1'); + $environment['NO_INTERACTION'] = 1; + break; + //case 'r' + case 's': + $output_file = $argv[++$i]; + $just_save_results = true; + break; + case '--set-timeout': + $timeout = $argv[++$i] ?? ''; + if (!preg_match('/^\d+$/', $timeout)) { + error("'$timeout' is not a valid number of seconds, try e.g. --set-timeout 60 for 1 minute"); + } + $environment['TEST_TIMEOUT'] = intval($timeout, 10); + break; + case '--context': + $context_line_count = $argv[++$i] ?? ''; + if (!preg_match('/^\d+$/', $context_line_count)) { + error("'$context_line_count' is not a valid number of lines of context, try e.g. --context 3 for 3 lines"); + } + $context_line_count = intval($context_line_count, 10); + break; + case '--show-all': + foreach ($cfgfiles as $file) { + $cfg['show'][$file] = true; + } + break; + case '--show-slow': + $slow_min_ms = $argv[++$i] ?? ''; + if (!preg_match('/^\d+$/', $slow_min_ms)) { + error("'$slow_min_ms' is not a valid number of milliseconds, try e.g. --show-slow 1000 for 1 second"); + } + $slow_min_ms = intval($slow_min_ms, 10); + break; + case '--temp-source': + $temp_source = $argv[++$i]; + break; + case '--temp-target': + $temp_target = $argv[++$i]; + break; + case 'v': + case '--verbose': + $DETAILED = true; + break; + case 'x': + $environment['SKIP_SLOW_TESTS'] = 1; + break; + case '--offline': + $environment['SKIP_ONLINE_TESTS'] = 1; + break; + case '--shuffle': + $shuffle = true; + break; + case '--asan': + case '--msan': + $environment['USE_ZEND_ALLOC'] = 0; + $environment['USE_TRACKED_ALLOC'] = 1; + $environment['SKIP_ASAN'] = 1; + $environment['SKIP_PERF_SENSITIVE'] = 1; + if ($switch === '--msan') { + $environment['SKIP_MSAN'] = 1; + $environment['MSAN_OPTIONS'] = 'intercept_tls_get_addr=0'; + } + + $lsanSuppressions = __DIR__ . '/.github/lsan-suppressions.txt'; + if (file_exists($lsanSuppressions)) { + $environment['LSAN_OPTIONS'] = 'suppressions=' . $lsanSuppressions + . ':print_suppressions=0'; + } + break; + case '--repeat': + $num_repeats = (int) $argv[++$i]; + $environment['SKIP_REPEAT'] = 1; + break; + case '--bless': + $bless = true; + break; + //case 'w' + case '-': + // repeat check with full switch + $switch = $argv[$i]; + if ($switch != '-') { + $repeat = true; + } + break; + case '--progress': + $show_progress = true; + break; + case '--no-progress': + $show_progress = false; + break; + case '--version': + echo '$Id: 71a8fdc80fe5f1e2b35790f564122648735cbcf1 $' . "\n"; + exit(1); + + default: + echo "Illegal switch '$switch' specified!\n"; + // no break + case 'h': + case '-help': + case '--help': + show_usage(); + exit(1); + } + } + + if (!$is_switch) { + $selected_tests = true; + $testfile = realpath($argv[$i]); + + if (!$testfile && strpos($argv[$i], '*') !== false && function_exists('glob')) { + if (substr($argv[$i], -5) == '.phpt') { + $pattern_match = glob($argv[$i]); + } elseif (preg_match("/\*$/", $argv[$i])) { + $pattern_match = glob($argv[$i] . '.phpt'); + } else { + die('Cannot find test file "' . $argv[$i] . '".' . PHP_EOL); + } + + if (is_array($pattern_match)) { + $test_files = array_merge($test_files, $pattern_match); + } + } elseif (is_dir($testfile)) { + find_files($testfile); + } elseif (substr($testfile, -5) == '.phpt') { + $test_files[] = $testfile; + } else { + die('Cannot find test file "' . $argv[$i] . '".' . PHP_EOL); + } + } + } + + if ($selected_tests && count($test_files) === 0) { + echo "No tests found.\n"; + return; + } + + if (!$php) { + $php = getenv('TEST_PHP_EXECUTABLE'); + } + if (!$php) { + $php = PHP_BINARY; + } + + if (!$php_cgi) { + $php_cgi = getenv('TEST_PHP_CGI_EXECUTABLE'); + } + if (!$php_cgi) { + $php_cgi = get_binary($php, 'php-cgi', 'sapi/cgi/php-cgi'); + } + + if (!$phpdbg) { + $phpdbg = getenv('TEST_PHPDBG_EXECUTABLE'); + } + if (!$phpdbg) { + $phpdbg = get_binary($php, 'phpdbg', 'sapi/phpdbg/phpdbg'); + } + + putenv("TEST_PHP_EXECUTABLE=$php"); + $environment['TEST_PHP_EXECUTABLE'] = $php; + putenv("TEST_PHP_EXECUTABLE_ESCAPED=" . escapeshellarg($php)); + $environment['TEST_PHP_EXECUTABLE_ESCAPED'] = escapeshellarg($php); + putenv("TEST_PHP_CGI_EXECUTABLE=$php_cgi"); + $environment['TEST_PHP_CGI_EXECUTABLE'] = $php_cgi; + putenv("TEST_PHP_CGI_EXECUTABLE_ESCAPED=" . escapeshellarg($php_cgi ?? '')); + $environment['TEST_PHP_CGI_EXECUTABLE_ESCAPED'] = escapeshellarg($php_cgi ?? ''); + putenv("TEST_PHPDBG_EXECUTABLE=$phpdbg"); + $environment['TEST_PHPDBG_EXECUTABLE'] = $phpdbg; + putenv("TEST_PHPDBG_EXECUTABLE_ESCAPED=" . escapeshellarg($phpdbg ?? '')); + $environment['TEST_PHPDBG_EXECUTABLE_ESCAPED'] = escapeshellarg($phpdbg ?? ''); + + if ($conf_passed !== null) { + if (IS_WINDOWS) { + $pass_options .= " -c " . escapeshellarg($conf_passed); + } else { + $pass_options .= " -c '" . realpath($conf_passed) . "'"; + } + } + + $test_files = array_unique($test_files); + $test_files = array_merge($test_files, $redir_tests); + + // Run selected tests. + $test_cnt = count($test_files); + + verify_config(); + write_information(); + + if ($test_cnt) { + putenv('NO_INTERACTION=1'); + usort($test_files, "test_sort"); + $start_time = time(); + + echo "Running selected tests.\n"; + + $test_idx = 0; + run_all_tests($test_files, $environment); + $end_time = time(); + + if ($failed_tests_file) { + fclose($failed_tests_file); + } + + if ($result_tests_file) { + fclose($result_tests_file); + } + + if (0 == count($test_results)) { + echo "No tests were run.\n"; + return; + } + + compute_summary(); + echo "====================================================================="; + echo get_summary(false); + + if ($output_file != '' && $just_save_results) { + save_results($output_file, /* prompt_to_save_results: */ false); + } + } else { + // Compile a list of all test files (*.phpt). + $test_files = []; + $exts_tested = $exts_to_test; + $exts_skipped = []; + sort($exts_to_test); + $test_dirs = []; + $optionals = ['Zend', 'tests', 'ext', 'sapi']; + + foreach ($optionals as $dir) { + if (is_dir($dir)) { + $test_dirs[] = $dir; + } + } + + foreach ($test_dirs as $dir) { + find_files(TEST_PHP_SRCDIR . "/{$dir}", $dir == 'ext'); + } + + foreach ($user_tests as $dir) { + find_files($dir, $dir == 'ext'); + } + + $test_files = array_unique($test_files); + usort($test_files, "test_sort"); + + $start_time = time(); + show_start($start_time); + + $test_cnt = count($test_files); + $test_idx = 0; + run_all_tests($test_files, $environment); + $end_time = time(); + + if ($failed_tests_file) { + fclose($failed_tests_file); + } + + if ($result_tests_file) { + fclose($result_tests_file); + } + + // Summarize results + + if (0 == count($test_results)) { + echo "No tests were run.\n"; + return; + } + + compute_summary(); + + show_end($end_time); + show_summary(); + + save_results($output_file, /* prompt_to_save_results: */ true); + } + + $junit->saveXML(); + if ($bless) { + bless_failed_tests($PHP_FAILED_TESTS['FAILED']); + } + if (getenv('REPORT_EXIT_STATUS') !== '0' && getenv('REPORT_EXIT_STATUS') !== 'no' && + ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['LEAKED'])) { + exit(1); + } +} + +if (!function_exists("hrtime")) { + /** + * @return array|float|int + */ + function hrtime(bool $as_num = false) + { + $t = microtime(true); + + if ($as_num) { + return $t * 1000000000; + } + + $s = floor($t); + return [0 => $s, 1 => ($t - $s) * 1000000000]; + } +} + +function verify_config(): void +{ + global $php; + + if (empty($php) || !file_exists($php)) { + error('environment variable TEST_PHP_EXECUTABLE must be set to specify PHP executable!'); + } + + if (!is_executable($php)) { + error("invalid PHP executable specified by TEST_PHP_EXECUTABLE = $php"); + } +} + +function write_information(): void +{ + global $php, $php_cgi, $phpdbg, $php_info, $user_tests, $ini_overwrites, $pass_options, $exts_to_test, $valgrind, $no_file_cache; + $php_escaped = escapeshellarg($php); + + // Get info from php + $info_file = __DIR__ . '/run-test-info.php'; + @unlink($info_file); + $php_info = ''; + save_text($info_file, $php_info); + $info_params = []; + settings2array($ini_overwrites, $info_params); + $info_params = settings2params($info_params); + $php_info = shell_exec("$php_escaped $pass_options $info_params $no_file_cache \"$info_file\""); + define('TESTED_PHP_VERSION', shell_exec("$php_escaped -n -r \"echo PHP_VERSION;\"")); + + if ($php_cgi && $php != $php_cgi) { + $php_cgi_escaped = escapeshellarg($php_cgi); + $php_info_cgi = shell_exec("$php_cgi_escaped $pass_options $info_params $no_file_cache -q \"$info_file\""); + $php_info_sep = "\n---------------------------------------------------------------------"; + $php_cgi_info = "$php_info_sep\nPHP : $php_cgi $php_info_cgi$php_info_sep"; + } else { + $php_cgi_info = ''; + } + + if ($phpdbg) { + $phpdbg_escaped = escapeshellarg($phpdbg); + $phpdbg_info = shell_exec("$phpdbg_escaped $pass_options $info_params $no_file_cache -qrr \"$info_file\""); + $php_info_sep = "\n---------------------------------------------------------------------"; + $phpdbg_info = "$php_info_sep\nPHP : $phpdbg $phpdbg_info$php_info_sep"; + } else { + $phpdbg_info = ''; + } + + if (function_exists('opcache_invalidate')) { + opcache_invalidate($info_file, true); + } + @unlink($info_file); + + // load list of enabled and loadable extensions + save_text($info_file, <<<'PHP' + ['session.auto_start=0'], + 'tidy' => ['tidy.clean_output=0'], + 'zlib' => ['zlib.output_compression=Off'], + 'xdebug' => ['xdebug.mode=off'], + ]; + + foreach ($info_params_ex as $ext => $ini_overwrites_ex) { + if (in_array($ext, $exts_to_test)) { + $ini_overwrites = array_merge($ini_overwrites, $ini_overwrites_ex); + } + } + + if (function_exists('opcache_invalidate')) { + opcache_invalidate($info_file, true); + } + @unlink($info_file); + + // Write test context information. + echo " +===================================================================== +PHP : $php $php_info $php_cgi_info $phpdbg_info +CWD : " . TEST_PHP_SRCDIR . " +Extra dirs : "; + foreach ($user_tests as $test_dir) { + echo "{$test_dir}\n "; + } + echo " +VALGRIND : " . ($valgrind ? $valgrind->getHeader() : 'Not used') . " +===================================================================== +"; +} + +function save_results(string $output_file, bool $prompt_to_save_results): void +{ + global $sum_results, $failed_test_summary, + $PHP_FAILED_TESTS, $php; + + if (getenv('NO_INTERACTION') || TRAVIS_CI) { + return; + } + + if ($prompt_to_save_results) { + /* We got failed Tests, offer the user to save a QA report */ + $fp = fopen("php://stdin", "r+"); + if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED']) { + echo "\nYou may have found a problem in PHP."; + } + echo "\nThis report can be saved and used to open an issue on the bug tracker at\n"; + echo "https://github.com/php/php-src/issues\n"; + echo "This gives us a better understanding of PHP's behavior.\n"; + echo "Do you want to save this report in a file? [Yn]: "; + flush(); + + $user_input = fgets($fp, 10); + fclose($fp); + if (!(strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y')) { + return; + } + } + /** + * Collect information about the host system for our report + * Fetch phpinfo() output so that we can see the PHP environment + * Make an archive of all the failed tests + */ + $failed_tests_data = ''; + $sep = "\n" . str_repeat('=', 80) . "\n"; + $failed_tests_data .= $failed_test_summary . "\n"; + $failed_tests_data .= get_summary(true) . "\n"; + + if ($sum_results['FAILED']) { + foreach ($PHP_FAILED_TESTS['FAILED'] as $test_info) { + $failed_tests_data .= $sep . $test_info['name'] . $test_info['info']; + $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output'])); + $failed_tests_data .= $sep . file_get_contents(realpath($test_info['diff'])); + $failed_tests_data .= $sep . "\n\n"; + } + } + + $failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep; + $failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() . "\n\n"; + $ldd = $autoconf = $sys_libtool = $libtool = $compiler = 'N/A'; + + if (!IS_WINDOWS) { + /* If PHP_AUTOCONF is set, use it; otherwise, use 'autoconf'. */ + if (getenv('PHP_AUTOCONF')) { + $autoconf = shell_exec(getenv('PHP_AUTOCONF') . ' --version'); + } else { + $autoconf = shell_exec('autoconf --version'); + } + + /* Always use the generated libtool - Mac OSX uses 'glibtool' */ + $libtool = shell_exec(INIT_DIR . '/libtool --version'); + + /* Use shtool to find out if there is glibtool present (MacOSX) */ + $sys_libtool_path = shell_exec(__DIR__ . '/build/shtool path glibtool libtool'); + + if ($sys_libtool_path) { + $sys_libtool = shell_exec(str_replace("\n", "", $sys_libtool_path) . ' --version'); + } + + /* Try the most common flags for 'version' */ + $flags = ['-v', '-V', '--version']; + $cc_status = 0; + + foreach ($flags as $flag) { + system(getenv('CC') . " $flag >/dev/null 2>&1", $cc_status); + if ($cc_status == 0) { + $compiler = shell_exec(getenv('CC') . " $flag 2>&1"); + break; + } + } + + $ldd = shell_exec("ldd $php 2>/dev/null"); + } + + $failed_tests_data .= "Autoconf:\n$autoconf\n"; + $failed_tests_data .= "Bundled Libtool:\n$libtool\n"; + $failed_tests_data .= "System Libtool:\n$sys_libtool\n"; + $failed_tests_data .= "Compiler:\n$compiler\n"; + $failed_tests_data .= "Bison:\n" . shell_exec('bison --version 2>/dev/null') . "\n"; + $failed_tests_data .= "Libraries:\n$ldd\n"; + $failed_tests_data .= "\n"; + $failed_tests_data .= $sep . "PHPINFO" . $sep; + $failed_tests_data .= shell_exec($php . ' -ddisplay_errors=stderr -dhtml_errors=0 -i 2> /dev/null'); + + file_put_contents($output_file, $failed_tests_data); + echo "Report saved to: ", $output_file, "\n"; +} + +function get_binary(string $php, string $sapi, string $sapi_path): ?string +{ + $dir = dirname($php); + if (IS_WINDOWS && file_exists("$dir/$sapi.exe")) { + return realpath("$dir/$sapi.exe"); + } + // Sources tree + if (file_exists("$dir/../../$sapi_path")) { + return realpath("$dir/../../$sapi_path"); + } + // Installation tree, preserve command prefix/suffix + $inst = str_replace('php', $sapi, basename($php)); + if (file_exists("$dir/$inst")) { + return realpath("$dir/$inst"); + } + return null; +} + +function find_files(string $dir, bool $is_ext_dir = false, bool $ignore = false): void +{ + global $test_files, $exts_to_test, $ignored_by_ext, $exts_skipped; + + $o = opendir($dir) or error("cannot open directory: $dir"); + + while (($name = readdir($o)) !== false) { + if (is_dir("{$dir}/{$name}") && !in_array($name, ['.', '..', '.svn'])) { + $skip_ext = ($is_ext_dir && !in_array($name, $exts_to_test)); + if ($skip_ext) { + $exts_skipped[] = $name; + } + find_files("{$dir}/{$name}", false, $ignore || $skip_ext); + } + + // Cleanup any left-over tmp files from last run. + if (substr($name, -4) == '.tmp') { + @unlink("$dir/$name"); + continue; + } + + // Otherwise we're only interested in *.phpt files. + // (but not those starting with a dot, which are hidden on + // many platforms) + if (substr($name, -5) == '.phpt' && substr($name, 0, 1) !== '.') { + $testfile = realpath("{$dir}/{$name}"); + if ($ignore) { + $ignored_by_ext[] = $testfile; + } else { + $test_files[] = $testfile; + } + } + } + + closedir($o); +} + +/** + * @param array|string $name + */ +function test_name($name): string +{ + if (is_array($name)) { + return $name[0] . ':' . $name[1]; + } + + return $name; +} +/** + * @param array|string $a + * @param array|string $b + */ +function test_sort($a, $b): int +{ + $a = test_name($a); + $b = test_name($b); + + $ta = strpos($a, TEST_PHP_SRCDIR . "/tests") === 0 ? 1 + (strpos($a, + TEST_PHP_SRCDIR . "/tests/run-test") === 0 ? 1 : 0) : 0; + $tb = strpos($b, TEST_PHP_SRCDIR . "/tests") === 0 ? 1 + (strpos($b, + TEST_PHP_SRCDIR . "/tests/run-test") === 0 ? 1 : 0) : 0; + + if ($ta == $tb) { + return strcmp($a, $b); + } + + return $tb - $ta; +} + +// +// Write the given text to a temporary file, and return the filename. +// + +function save_text(string $filename, string $text, ?string $filename_copy = null): void +{ + global $DETAILED; + + if ($filename_copy && $filename_copy != $filename && file_put_contents($filename_copy, $text) === false) { + error("Cannot open file '" . $filename_copy . "' (save_text)"); + } + + if (file_put_contents($filename, $text) === false) { + error("Cannot open file '" . $filename . "' (save_text)"); + } + + if (1 < $DETAILED) { + echo " +FILE $filename {{{ +$text +}}} +"; + } +} + +// +// Write an error in a format recognizable to Emacs or MSVC. +// + +function error_report(string $testname, string $logname, string $tested): void +{ + $testname = realpath($testname); + $logname = realpath($logname); + + switch (strtoupper(getenv('TEST_PHP_ERROR_STYLE'))) { + case 'MSVC': + echo $testname . "(1) : $tested\n"; + echo $logname . "(1) : $tested\n"; + break; + case 'EMACS': + echo $testname . ":1: $tested\n"; + echo $logname . ":1: $tested\n"; + break; + } +} + +/** + * @return false|string + */ +function system_with_timeout( + string $commandline, + ?array $env = null, + ?string $stdin = null, + bool $captureStdIn = true, + bool $captureStdOut = true, + bool $captureStdErr = true +) { + global $valgrind; + + // when proc_open cmd is passed as a string (without bypass_shell=true option) the cmd goes thru shell + // and on Windows quotes are discarded, this is a fix to honor the quotes and allow values containing + // spaces like '"C:\Program Files\PHP\php.exe"' to be passed as 1 argument correctly + if (IS_WINDOWS) { + $commandline = 'start "" /b /wait ' . $commandline; + } + + $data = ''; + + $bin_env = []; + foreach ((array) $env as $key => $value) { + $bin_env[$key] = $value; + } + + $descriptorspec = []; + if ($captureStdIn) { + $descriptorspec[0] = ['pipe', 'r']; + } + if ($captureStdOut) { + $descriptorspec[1] = ['pipe', 'w']; + } + if ($captureStdErr) { + $descriptorspec[2] = ['pipe', 'w']; + } + $proc = proc_open($commandline, $descriptorspec, $pipes, TEST_PHP_SRCDIR, $bin_env, ['suppress_errors' => true]); + + if (!$proc) { + return false; + } + + if ($captureStdIn) { + if (!is_null($stdin)) { + fwrite($pipes[0], $stdin); + } + fclose($pipes[0]); + unset($pipes[0]); + } + + $timeout = $valgrind ? 300 : ($env['TEST_TIMEOUT'] ?? 60); + /* ASAN can cause a ~2-3x slowdown. */ + if (isset($env['SKIP_ASAN'])) { + $timeout *= 3; + } + + while (true) { + /* hide errors from interrupted syscalls */ + $r = $pipes; + $w = null; + $e = null; + + $n = @stream_select($r, $w, $e, $timeout); + + if ($n === false) { + break; + } + + if ($n === 0) { + /* timed out */ + $data .= "\n ** ERROR: process timed out **\n"; + proc_terminate($proc, 9); + return $data; + } + + if ($n > 0) { + if ($captureStdOut) { + $line = fread($pipes[1], 8192); + } elseif ($captureStdErr) { + $line = fread($pipes[2], 8192); + } else { + $line = ''; + } + if (strlen($line) == 0) { + /* EOF */ + break; + } + $data .= $line; + } + } + + $stat = proc_get_status($proc); + + if ($stat['signaled']) { + $data .= "\nTermsig=" . $stat['stopsig'] . "\n"; + } + if ($stat["exitcode"] > 128 && $stat["exitcode"] < 160) { + $data .= "\nTermsig=" . ($stat["exitcode"] - 128) . "\n"; + } else if (defined('PHP_WINDOWS_VERSION_MAJOR') && (($stat["exitcode"] >> 28) & 0b1111) === 0b1100) { + // https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781 + $data .= "\nTermsig=" . $stat["exitcode"] . "\n"; + } + + proc_close($proc); + return $data; +} + +/** + * @param string|array|null $redir_tested + */ +function run_all_tests(array $test_files, array $env, $redir_tested = null): void +{ + global $test_results, $failed_tests_file, $result_tests_file, $php, $test_idx, $file_cache; + global $preload; + // Parallel testing + global $PHP_FAILED_TESTS, $workers, $workerID, $workerSock; + + if ($file_cache !== null || $preload) { + /* Automatically skip opcache tests in --file-cache and --preload mode, + * because opcache generally expects these to run under a default configuration. */ + $test_files = array_filter($test_files, function($test) use($preload) { + if (!is_string($test)) { + return true; + } + if (false !== strpos($test, 'ext/opcache')) { + return false; + } + if ($preload && false !== strpos($test, 'ext/zend_test/tests/observer')) { + return false; + } + return true; + }); + } + + /* Ignore -jN if there is only one file to analyze. */ + if ($workers !== null && count($test_files) > 1 && !$workerID) { + run_all_tests_parallel($test_files, $env, $redir_tested); + return; + } + + foreach ($test_files as $name) { + if (is_array($name)) { + $index = "# $name[1]: $name[0]"; + + if ($redir_tested) { + $name = $name[0]; + } + } elseif ($redir_tested) { + $index = "# $redir_tested: $name"; + } else { + $index = $name; + } + $test_idx++; + + if ($workerID) { + $PHP_FAILED_TESTS = ['BORKED' => [], 'FAILED' => [], 'WARNED' => [], 'LEAKED' => [], 'XFAILED' => [], 'XLEAKED' => [], 'SLOW' => []]; + ob_start(); + } + + $result = run_test($php, $name, $env); + if ($workerID) { + $resultText = ob_get_clean(); + } + + if (!is_array($name) && $result != 'REDIR') { + if ($workerID) { + send_message($workerSock, [ + "type" => "test_result", + "name" => $name, + "index" => $index, + "result" => $result, + "text" => $resultText, + "PHP_FAILED_TESTS" => $PHP_FAILED_TESTS + ]); + continue; + } + + $test_results[$index] = $result; + if ($failed_tests_file && ($result == 'XFAILED' || $result == 'XLEAKED' || $result == 'FAILED' || $result == 'WARNED' || $result == 'LEAKED')) { + fwrite($failed_tests_file, "$index\n"); + } + if ($result_tests_file) { + fwrite($result_tests_file, "$result\t$index\n"); + } + } + } +} + +/** The heart of parallel testing. + * @param string|array|null $redir_tested + */ +function run_all_tests_parallel(array $test_files, array $env, $redir_tested): void +{ + global $workers, $test_idx, $test_cnt, $test_results, $failed_tests_file, $result_tests_file, $PHP_FAILED_TESTS, $shuffle, $SHOW_ONLY_GROUPS, $valgrind, $show_progress; + + global $junit; + + // The PHP binary running run-tests.php, and run-tests.php itself + // This PHP executable is *not* necessarily the same as the tested version + $thisPHP = PHP_BINARY; + $thisScript = __FILE__; + + $workerProcs = []; + $workerSocks = []; + + // Each test may specify a list of conflict keys. While a test that conflicts with + // key K is running, no other test that conflicts with K may run. Conflict keys are + // specified either in the --CONFLICTS-- section, or CONFLICTS file inside a directory. + $dirConflictsWith = []; + $fileConflictsWith = []; + $sequentialTests = []; + foreach ($test_files as $i => $file) { + $contents = file_get_contents($file); + if (preg_match('/^--CONFLICTS--(.+?)^--/ms', $contents, $matches)) { + $conflicts = parse_conflicts($matches[1]); + } else { + // Cache per-directory conflicts in a separate map, so we compute these only once. + $dir = dirname($file); + if (!isset($dirConflictsWith[$dir])) { + $dirConflicts = []; + if (file_exists($dir . '/CONFLICTS')) { + $contents = file_get_contents($dir . '/CONFLICTS'); + $dirConflicts = parse_conflicts($contents); + } + $dirConflictsWith[$dir] = $dirConflicts; + } + $conflicts = $dirConflictsWith[$dir]; + } + + // For tests conflicting with "all", no other tests may run in parallel. We'll run these + // tests separately at the end, when only one worker is left. + if (in_array('all', $conflicts, true)) { + $sequentialTests[] = $file; + unset($test_files[$i]); + } + + $fileConflictsWith[$file] = $conflicts; + } + + // Some tests assume that they are executed in a certain order. We will be popping from + // $test_files, so reverse its order here. This makes sure that order is preserved at least + // for tests with a common conflict key. + $test_files = array_reverse($test_files); + + // To discover parallelization issues it is useful to randomize the test order. + if ($shuffle) { + shuffle($test_files); + } + + // Don't start more workers than test files. + $workers = max(1, min($workers, count($test_files))); + + echo "Spawning $workers workers... "; + + // We use sockets rather than STDIN/STDOUT for comms because on Windows, + // those can't be non-blocking for some reason. + $listenSock = stream_socket_server("tcp://127.0.0.1:0") or error("Couldn't create socket on localhost."); + $sockName = stream_socket_get_name($listenSock, false); + // PHP is terrible and returns IPv6 addresses not enclosed by [] + $portPos = strrpos($sockName, ":"); + $sockHost = substr($sockName, 0, $portPos); + if (false !== strpos($sockHost, ":")) { + $sockHost = "[$sockHost]"; + } + $sockPort = substr($sockName, $portPos + 1); + $sockUri = "tcp://$sockHost:$sockPort"; + $totalFileCount = count($test_files); + + $startTime = microtime(true); + for ($i = 1; $i <= $workers; $i++) { + $proc = proc_open( + [$thisPHP, $thisScript], + [], // Inherit our stdin, stdout and stderr + $pipes, + null, + $GLOBALS['environment'] + [ + "TEST_PHP_WORKER" => $i, + "TEST_PHP_URI" => $sockUri, + ], + [ + "suppress_errors" => true, + 'create_new_console' => true, + ] + ); + if ($proc === false) { + kill_children($workerProcs); + error("Failed to spawn worker $i"); + } + $workerProcs[$i] = $proc; + } + + for ($i = 1; $i <= $workers; $i++) { + $workerSock = stream_socket_accept($listenSock, 5); + if ($workerSock === false) { + kill_children($workerProcs); + error("Failed to accept connection from worker."); + } + + $greeting = base64_encode(serialize([ + "type" => "hello", + "GLOBALS" => $GLOBALS, + "constants" => [ + "INIT_DIR" => INIT_DIR, + "TEST_PHP_SRCDIR" => TEST_PHP_SRCDIR, + "TRAVIS_CI" => TRAVIS_CI + ] + ])) . "\n"; + + stream_set_timeout($workerSock, 5); + if (fwrite($workerSock, $greeting) === false) { + kill_children($workerProcs); + error("Failed to send greeting to worker."); + } + + $rawReply = fgets($workerSock); + if ($rawReply === false) { + kill_children($workerProcs); + error("Failed to read greeting reply from worker."); + } + + $reply = unserialize(base64_decode($rawReply)); + if (!$reply || $reply["type"] !== "hello_reply") { + kill_children($workerProcs); + error("Greeting reply from worker unexpected or could not be decoded: '$rawReply'"); + } + + stream_set_timeout($workerSock, 0); + stream_set_blocking($workerSock, false); + + $workerID = $reply["workerID"]; + $workerSocks[$workerID] = $workerSock; + } + printf("Done in %.2fs\n", microtime(true) - $startTime); + echo "=====================================================================\n"; + echo "\n"; + + $rawMessageBuffers = []; + $testsInProgress = 0; + + // Map from conflict key to worker ID. + $activeConflicts = []; + // Tests waiting due to conflicts. Map from conflict key to array. + $waitingTests = []; + +escape: + while ($test_files || $sequentialTests || $testsInProgress > 0) { + $toRead = array_values($workerSocks); + $toWrite = null; + $toExcept = null; + if (stream_select($toRead, $toWrite, $toExcept, 10)) { + foreach ($toRead as $workerSock) { + $i = array_search($workerSock, $workerSocks); + if ($i === false) { + kill_children($workerProcs); + error("Could not find worker stdout in array of worker stdouts, THIS SHOULD NOT HAPPEN."); + } + if (feof($workerSock)) { + kill_children($workerProcs); + error("Worker $i died unexpectedly"); + } + while (false !== ($rawMessage = fgets($workerSock))) { + // work around fgets truncating things + if (($rawMessageBuffers[$i] ?? '') !== '') { + $rawMessage = $rawMessageBuffers[$i] . $rawMessage; + $rawMessageBuffers[$i] = ''; + } + if (substr($rawMessage, -1) !== "\n") { + $rawMessageBuffers[$i] = $rawMessage; + continue; + } + + $message = unserialize(base64_decode($rawMessage)); + if (!$message) { + kill_children($workerProcs); + $stuff = fread($workerSock, 65536); + error("Could not decode message from worker $i: '$rawMessage$stuff'"); + } + + switch ($message["type"]) { + case "tests_finished": + $testsInProgress--; + foreach ($activeConflicts as $key => $workerId) { + if ($workerId === $i) { + unset($activeConflicts[$key]); + if (isset($waitingTests[$key])) { + while ($test = array_pop($waitingTests[$key])) { + $test_files[] = $test; + } + unset($waitingTests[$key]); + } + } + } + $junit->mergeResults($message["junit"]); + // no break + case "ready": + // Schedule sequential tests only once we are down to one worker. + if (count($workerProcs) === 1 && $sequentialTests) { + $test_files = array_merge($test_files, $sequentialTests); + $sequentialTests = []; + } + // Batch multiple tests to reduce communication overhead. + // - When valgrind is used, communication overhead is relatively small, + // so just use a batch size of 1. + // - If this is running a small enough number of tests, + // reduce the batch size to give batches to more workers. + $files = []; + $maxBatchSize = $valgrind ? 1 : ($shuffle ? 4 : 32); + $averageFilesPerWorker = max(1, (int) ceil($totalFileCount / count($workerProcs))); + $batchSize = min($maxBatchSize, $averageFilesPerWorker); + while (count($files) <= $batchSize && $file = array_pop($test_files)) { + foreach ($fileConflictsWith[$file] as $conflictKey) { + if (isset($activeConflicts[$conflictKey])) { + $waitingTests[$conflictKey][] = $file; + continue 2; + } + } + $files[] = $file; + } + if ($files) { + foreach ($files as $file) { + foreach ($fileConflictsWith[$file] as $conflictKey) { + $activeConflicts[$conflictKey] = $i; + } + } + $testsInProgress++; + send_message($workerSocks[$i], [ + "type" => "run_tests", + "test_files" => $files, + "env" => $env, + "redir_tested" => $redir_tested + ]); + } else { + proc_terminate($workerProcs[$i]); + unset($workerProcs[$i], $workerSocks[$i]); + goto escape; + } + break; + case "test_result": + list($name, $index, $result, $resultText) = [$message["name"], $message["index"], $message["result"], $message["text"]]; + foreach ($message["PHP_FAILED_TESTS"] as $category => $tests) { + $PHP_FAILED_TESTS[$category] = array_merge($PHP_FAILED_TESTS[$category], $tests); + } + $test_idx++; + + if ($show_progress) { + clear_show_test(); + } + + echo $resultText; + + if ($show_progress) { + show_test($test_idx, count($workerProcs) . "/$workers concurrent test workers running"); + } + + if (!is_array($name) && $result != 'REDIR') { + $test_results[$index] = $result; + + if ($failed_tests_file && ($result == 'XFAILED' || $result == 'XLEAKED' || $result == 'FAILED' || $result == 'WARNED' || $result == 'LEAKED')) { + fwrite($failed_tests_file, "$index\n"); + } + if ($result_tests_file) { + fwrite($result_tests_file, "$result\t$index\n"); + } + } + break; + case "error": + kill_children($workerProcs); + error("Worker $i reported error: $message[msg]"); + break; + case "php_error": + kill_children($workerProcs); + $error_consts = [ + 'E_ERROR', + 'E_WARNING', + 'E_PARSE', + 'E_NOTICE', + 'E_CORE_ERROR', + 'E_CORE_WARNING', + 'E_COMPILE_ERROR', + 'E_COMPILE_WARNING', + 'E_USER_ERROR', + 'E_USER_WARNING', + 'E_USER_NOTICE', + 'E_STRICT', // TODO Cleanup when removed from Zend Engine. + 'E_RECOVERABLE_ERROR', + 'E_DEPRECATED', + 'E_USER_DEPRECATED' + ]; + $error_consts = array_combine(array_map('constant', $error_consts), $error_consts); + error("Worker $i reported unexpected {$error_consts[$message['errno']]}: $message[errstr] in $message[errfile] on line $message[errline]"); + // no break + default: + kill_children($workerProcs); + error("Unrecognised message type '$message[type]' from worker $i"); + } + } + } + } + } + + if ($show_progress) { + clear_show_test(); + } + + kill_children($workerProcs); + + if ($testsInProgress < 0) { + error("$testsInProgress test batches “in progressâ€, which is less than zero. THIS SHOULD NOT HAPPEN."); + } +} + +/** + * Calls fwrite and retries when network writes fail with errors such as "Resource temporarily unavailable" + * + * @param resource $stream the stream to fwrite to + * @param string $data + * @return int|false + */ +function safe_fwrite($stream, string $data) +{ + // safe_fwrite was tested by adding $message['unused'] = str_repeat('a', 20_000_000); in send_message() + // fwrites on tcp sockets can return false or less than strlen if the recipient is busy. + // (e.g. fwrite(): Send of 577 bytes failed with errno=35 Resource temporarily unavailable) + $bytes_written = 0; + while ($bytes_written < strlen($data)) { + $n = @fwrite($stream, substr($data, $bytes_written)); + if ($n === false) { + $write_streams = [$stream]; + $read_streams = []; + $except_streams = []; + /* Wait for up to 10 seconds for the stream to be ready to write again. */ + $result = stream_select($read_streams, $write_streams, $except_streams, 10); + if (!$result) { + echo "ERROR: send_message() stream_select() failed\n"; + return false; + } + $n = @fwrite($stream, substr($data, $bytes_written)); + if ($n === false) { + echo "ERROR: send_message() Failed to write chunk after stream_select: " . error_get_last()['message'] . "\n"; + return false; + } + } + $bytes_written += $n; + } + return $bytes_written; +} + +function send_message($stream, array $message): void +{ + $blocking = stream_get_meta_data($stream)["blocked"]; + stream_set_blocking($stream, true); + safe_fwrite($stream, base64_encode(serialize($message)) . "\n"); + stream_set_blocking($stream, $blocking); +} + +function kill_children(array $children): void +{ + foreach ($children as $child) { + if ($child) { + proc_terminate($child); + } + } +} + +function run_worker(): void +{ + global $workerID, $workerSock; + + global $junit; + + $sockUri = getenv("TEST_PHP_URI"); + + $workerSock = stream_socket_client($sockUri, $_, $_, 5) or error("Couldn't connect to $sockUri"); + + $greeting = fgets($workerSock); + $greeting = unserialize(base64_decode($greeting)) or die("Could not decode greeting\n"); + if ($greeting["type"] !== "hello") { + error("Unexpected greeting of type $greeting[type]"); + } + + set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline) use ($workerSock): bool { + if (error_reporting() & $errno) { + send_message($workerSock, compact('errno', 'errstr', 'errfile', 'errline') + [ + 'type' => 'php_error' + ]); + } + + return true; + }); + + foreach ($greeting["GLOBALS"] as $var => $value) { + if ($var !== "workerID" && $var !== "workerSock" && $var !== "GLOBALS") { + $GLOBALS[$var] = $value; + } + } + foreach ($greeting["constants"] as $const => $value) { + define($const, $value); + } + + send_message($workerSock, [ + "type" => "hello_reply", + "workerID" => $workerID + ]); + + send_message($workerSock, [ + "type" => "ready" + ]); + + while (($command = fgets($workerSock))) { + $command = unserialize(base64_decode($command)); + + switch ($command["type"]) { + case "run_tests": + run_all_tests($command["test_files"], $command["env"], $command["redir_tested"]); + send_message($workerSock, [ + "type" => "tests_finished", + "junit" => $junit->isEnabled() ? $junit : null, + ]); + $junit->clear(); + break; + default: + send_message($workerSock, [ + "type" => "error", + "msg" => "Unrecognised message type: $command[type]" + ]); + break 2; + } + } +} + +// +// Show file or result block +// +function show_file_block(string $file, string $block, ?string $section = null): void +{ + global $cfg; + global $colorize; + + if ($cfg['show'][$file]) { + if (is_null($section)) { + $section = strtoupper($file); + } + if ($section === 'DIFF' && $colorize) { + // '-' is Light Red for removal, '+' is Light Green for addition + $block = preg_replace('/^[0-9]+\-\s.*$/m', "\e[1;31m\\0\e[0m", $block); + $block = preg_replace('/^[0-9]+\+\s.*$/m', "\e[1;32m\\0\e[0m", $block); + } + + echo "\n========" . $section . "========\n"; + echo rtrim($block); + echo "\n========DONE========\n"; + } +} + +function skip_test(string $tested, string $tested_file, string $shortname, string $reason) { + global $junit; + + show_result('SKIP', $tested, $tested_file, "reason: $reason"); + $junit->initSuite($junit->getSuiteName($shortname)); + $junit->markTestAs('SKIP', $shortname, $tested, 0, $reason); + return 'SKIPPED'; +} + +// +// Run an individual test case. +// +/** + * @param string|array $file + */ +function run_test(string $php, $file, array $env): string +{ + global $log_format, $ini_overwrites, $PHP_FAILED_TESTS; + global $pass_options, $DETAILED, $IN_REDIRECT, $test_cnt, $test_idx; + global $valgrind, $temp_source, $temp_target, $cfg, $environment; + global $no_clean; + global $SHOW_ONLY_GROUPS; + global $no_file_cache; + global $slow_min_ms; + global $preload, $file_cache; + global $num_repeats; + // Parallel testing + global $workerID; + global $show_progress; + + // Temporary + /** @var JUnit */ + global $junit; + + static $skipCache; + if (!$skipCache) { + $enableSkipCache = !($env['DISABLE_SKIP_CACHE'] ?? '0'); + $skipCache = new SkipCache($enableSkipCache, $cfg['keep']['skip']); + } + + $orig_php = $php; + $php = escapeshellarg($php); + + $retried = false; +retry: + + $temp_filenames = null; + $org_file = $file; + + $php_cgi = $env['TEST_PHP_CGI_EXECUTABLE'] ?? null; + $phpdbg = $env['TEST_PHPDBG_EXECUTABLE'] ?? null; + + if (is_array($file)) { + $file = $file[0]; + } + + if ($DETAILED) { + echo " +================= +TEST $file +"; + } + + $shortname = str_replace(TEST_PHP_SRCDIR . '/', '', $file); + $tested_file = $shortname; + + try { + $test = new TestFile($file, (bool)$IN_REDIRECT); + } catch (BorkageException $ex) { + show_result("BORK", $ex->getMessage(), $tested_file); + $PHP_FAILED_TESTS['BORKED'][] = [ + 'name' => $file, + 'test_name' => '', + 'output' => '', + 'diff' => '', + 'info' => "{$ex->getMessage()} [$file]", + ]; + + $junit->markTestAs('BORK', $shortname, $tested_file, 0, $ex->getMessage()); + return 'BORKED'; + } + + $tested = $test->getName(); + + if ($test->hasSection('FILE_EXTERNAL')) { + if ($num_repeats > 1) { + return skip_test($tested, $tested_file, $shortname, 'Test with FILE_EXTERNAL might not be repeatable'); + } + } + + if ($test->hasSection('CAPTURE_STDIO')) { + $capture = $test->getSection('CAPTURE_STDIO'); + $captureStdIn = stripos($capture, 'STDIN') !== false; + $captureStdOut = stripos($capture, 'STDOUT') !== false; + $captureStdErr = stripos($capture, 'STDERR') !== false; + } else { + $captureStdIn = true; + $captureStdOut = true; + $captureStdErr = true; + } + if ($captureStdOut && $captureStdErr) { + $cmdRedirect = ' 2>&1'; + } else { + $cmdRedirect = ''; + } + + /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */ + if ($test->isCGI()) { + if (!$php_cgi) { + return skip_test($tested, $tested_file, $shortname, 'CGI not available'); + } + $php = escapeshellarg($php_cgi) . ' -C '; + $uses_cgi = true; + if ($num_repeats > 1) { + return skip_test($tested, $tested_file, $shortname, 'CGI does not support --repeat'); + } + } + + /* For phpdbg tests, check if phpdbg sapi is available and if it is, use it. */ + $extra_options = ''; + if ($test->hasSection('PHPDBG')) { + if (isset($phpdbg)) { + $php = escapeshellarg($phpdbg) . ' -qIb'; + + // Additional phpdbg command line options for sections that need to + // be run straight away. For example, EXTENSIONS, SKIPIF, CLEAN. + $extra_options = '-rr'; + } else { + return skip_test($tested, $tested_file, $shortname, 'phpdbg not available'); + } + if ($num_repeats > 1) { + return skip_test($tested, $tested_file, $shortname, 'phpdbg does not support --repeat'); + } + } + + foreach (['CLEAN', 'STDIN', 'CAPTURE_STDIO'] as $section) { + if ($test->hasSection($section)) { + if ($num_repeats > 1) { + return skip_test($tested, $tested_file, $shortname, "Test with $section might not be repeatable"); + } + } + } + + if ($show_progress && !$workerID) { + show_test($test_idx, $shortname); + } + + if (is_array($IN_REDIRECT)) { + $temp_dir = $test_dir = $IN_REDIRECT['dir']; + } else { + $temp_dir = $test_dir = realpath(dirname($file)); + } + + if ($temp_source && $temp_target) { + $temp_dir = str_replace($temp_source, $temp_target, $temp_dir); + } + + $main_file_name = basename($file, 'phpt'); + + $diff_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'diff'; + $log_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'log'; + $exp_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'exp'; + $output_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'out'; + $memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'mem'; + $sh_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'sh'; + $temp_file = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php'; + $test_file = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php'; + $temp_skipif = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php'; + $test_skipif = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php'; + $temp_clean = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php'; + $test_clean = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php'; + $preload_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'preload.php'; + $tmp_post = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'post'; + $tmp_relative_file = str_replace(__DIR__ . DIRECTORY_SEPARATOR, '', $test_file) . 't'; + + if ($temp_source && $temp_target) { + $temp_skipif .= 's'; + $temp_file .= 's'; + $temp_clean .= 's'; + $copy_file = $temp_dir . DIRECTORY_SEPARATOR . basename(is_array($file) ? $file[1] : $file) . '.phps'; + + if (!is_dir(dirname($copy_file))) { + mkdir(dirname($copy_file), 0777, true) or error("Cannot create output directory - " . dirname($copy_file)); + } + + if ($test->hasSection('FILE')) { + save_text($copy_file, $test->getSection('FILE')); + } + + $temp_filenames = [ + 'file' => $copy_file, + 'diff' => $diff_filename, + 'log' => $log_filename, + 'exp' => $exp_filename, + 'out' => $output_filename, + 'mem' => $memcheck_filename, + 'sh' => $sh_filename, + 'php' => $temp_file, + 'skip' => $temp_skipif, + 'clean' => $temp_clean + ]; + } + + if (is_array($IN_REDIRECT)) { + $tested = $IN_REDIRECT['prefix'] . ' ' . $tested; + $tested_file = $tmp_relative_file; + $shortname = str_replace(TEST_PHP_SRCDIR . '/', '', $tested_file); + } + + // unlink old test results + @unlink($diff_filename); + @unlink($log_filename); + @unlink($exp_filename); + @unlink($output_filename); + @unlink($memcheck_filename); + @unlink($sh_filename); + @unlink($temp_file); + @unlink($test_file); + @unlink($temp_skipif); + @unlink($test_skipif); + @unlink($tmp_post); + @unlink($temp_clean); + @unlink($test_clean); + @unlink($preload_filename); + + // Reset environment from any previous test. + $env['REDIRECT_STATUS'] = ''; + $env['QUERY_STRING'] = ''; + $env['PATH_TRANSLATED'] = ''; + $env['SCRIPT_FILENAME'] = ''; + $env['REQUEST_METHOD'] = ''; + $env['CONTENT_TYPE'] = ''; + $env['CONTENT_LENGTH'] = ''; + $env['TZ'] = ''; + + if ($test->sectionNotEmpty('ENV')) { + $env_str = str_replace('{PWD}', dirname($file), $test->getSection('ENV')); + foreach (explode("\n", $env_str) as $e) { + $e = explode('=', trim($e), 2); + + if (!empty($e[0]) && isset($e[1])) { + $env[$e[0]] = $e[1]; + } + } + } + + // Default ini settings + $ini_settings = $workerID ? ['opcache.cache_id' => "worker$workerID"] : []; + + // Additional required extensions + $extensions = []; + if ($test->hasSection('EXTENSIONS')) { + $extensions = preg_split("/[\n\r]+/", trim($test->getSection('EXTENSIONS'))); + } + if (is_array($IN_REDIRECT) && $IN_REDIRECT['EXTENSIONS'] != []) { + $extensions = array_merge($extensions, $IN_REDIRECT['EXTENSIONS']); + } + + /* Load required extensions */ + if ($extensions != []) { + $ext_params = []; + settings2array($ini_overwrites, $ext_params); + $ext_params = settings2params($ext_params); + [$ext_dir, $loaded] = $skipCache->getExtensions("$orig_php $pass_options $extra_options $ext_params $no_file_cache"); + $ext_prefix = IS_WINDOWS ? "php_" : ""; + $missing = []; + foreach ($extensions as $req_ext) { + if (!in_array($req_ext, $loaded, true)) { + if ($req_ext == 'opcache' || $req_ext == 'xdebug') { + $ext_file = $ext_dir . DIRECTORY_SEPARATOR . $ext_prefix . $req_ext . '.' . PHP_SHLIB_SUFFIX; + $ini_settings['zend_extension'][] = $ext_file; + } else { + $ext_file = $ext_dir . DIRECTORY_SEPARATOR . $ext_prefix . $req_ext . '.' . PHP_SHLIB_SUFFIX; + $ini_settings['extension'][] = $ext_file; + } + if (!is_readable($ext_file)) { + $missing[] = $req_ext; + } + } + } + if ($missing) { + $message = 'Required extension' . (count($missing) > 1 ? 's' : '') + . ' missing: ' . implode(', ', $missing); + return skip_test($tested, $tested_file, $shortname, $message); + } + } + + // additional ini overwrites + //$ini_overwrites[] = 'setting=value'; + settings2array($ini_overwrites, $ini_settings); + + $orig_ini_settings = settings2params($ini_settings); + + if ($file_cache !== null) { + $ini_settings['opcache.file_cache'] = '/tmp'; + // Make sure warnings still show up on the second run. + $ini_settings['opcache.record_warnings'] = '1'; + // File cache is currently incompatible with JIT. + $ini_settings['opcache.jit'] = '0'; + if ($file_cache === 'use') { + // Disable timestamp validation in order to fetch from file cache, + // even though all the files are re-created. + $ini_settings['opcache.validate_timestamps'] = '0'; + } + } else if ($num_repeats > 1) { + // Make sure warnings still show up on the second run. + $ini_settings['opcache.record_warnings'] = '1'; + } + + // Any special ini settings + // these may overwrite the test defaults... + if ($test->hasSection('INI')) { + $ini = str_replace('{PWD}', dirname($file), $test->getSection('INI')); + $ini = str_replace('{TMP}', sys_get_temp_dir(), $ini); + $replacement = IS_WINDOWS ? '"' . PHP_BINARY . ' -r \"while ($in = fgets(STDIN)) echo $in;\" > $1"' : 'tee $1 >/dev/null'; + $ini = preg_replace('/{MAIL:(\S+)}/', $replacement, $ini); + $skip = false; + $ini = preg_replace_callback('/{ENV:(\S+)}/', function ($m) use (&$skip) { + $name = $m[1]; + $value = getenv($name); + if ($value === false) { + $skip = sprintf('Environment variable %s is not set', $name); + return ''; + } + return $value; + }, $ini); + if ($skip !== false) { + return skip_test($tested, $tested_file, $shortname, $skip); + } + settings2array(preg_split("/[\n\r]+/", $ini), $ini_settings); + + if (isset($ini_settings['opcache.opt_debug_level'])) { + if ($num_repeats > 1) { + return skip_test($tested, $tested_file, $shortname, 'opt_debug_level tests are not repeatable'); + } + } + } + + $ini_settings = settings2params($ini_settings); + + $env['TEST_PHP_EXTRA_ARGS'] = $pass_options . ' ' . $ini_settings; + + // Check if test should be skipped. + $info = ''; + $warn = false; + + if ($test->sectionNotEmpty('SKIPIF')) { + show_file_block('skip', $test->getSection('SKIPIF')); + $extra = !IS_WINDOWS ? + "unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;" : ""; + + if ($valgrind) { + $env['USE_ZEND_ALLOC'] = '0'; + $env['ZEND_DONT_UNLOAD_MODULES'] = 1; + } + + $junit->startTimer($shortname); + + $startTime = microtime(true); + $commandLine = "$extra $php $pass_options $extra_options -q $orig_ini_settings $no_file_cache -d display_errors=1 -d display_startup_errors=0"; + $output = $skipCache->checkSkip($commandLine, $test->getSection('SKIPIF'), $test_skipif, $temp_skipif, $env); + + $time = microtime(true) - $startTime; + $junit->stopTimer($shortname); + + if ($time > $slow_min_ms / 1000) { + $PHP_FAILED_TESTS['SLOW'][] = [ + 'name' => $file, + 'test_name' => 'SKIPIF of ' . $tested . " [$tested_file]", + 'output' => '', + 'diff' => '', + 'info' => $time, + ]; + } + + if (!$cfg['keep']['skip']) { + @unlink($test_skipif); + } + + if (!strncasecmp('skip', $output, 4)) { + if (preg_match('/^skip\s*(.+)/i', $output, $m)) { + show_result('SKIP', $tested, $tested_file, "reason: $m[1]", $temp_filenames); + } else { + show_result('SKIP', $tested, $tested_file, '', $temp_filenames); + } + + $message = !empty($m[1]) ? $m[1] : ''; + $junit->markTestAs('SKIP', $shortname, $tested, null, $message); + return 'SKIPPED'; + } + + + if (!strncasecmp('info', $output, 4) && preg_match('/^info\s*(.+)/i', $output, $m)) { + $info = " (info: $m[1])"; + } elseif (!strncasecmp('warn', $output, 4) && preg_match('/^warn\s+(.+)/i', $output, $m)) { + $warn = true; /* only if there is a reason */ + $info = " (warn: $m[1])"; + } elseif (!strncasecmp('xfail', $output, 5)) { + // Pretend we have an XFAIL section + $test->setSection('XFAIL', ltrim(substr($output, 5))); + } elseif (!strncasecmp('xleak', $output, 5)) { + // Pretend we have an XLEAK section + $test->setSection('XLEAK', ltrim(substr($output, 5))); + } elseif ($output !== '') { + show_result("BORK", $output, $tested_file, 'reason: invalid output from SKIPIF', $temp_filenames); + $PHP_FAILED_TESTS['BORKED'][] = [ + 'name' => $file, + 'test_name' => '', + 'output' => '', + 'diff' => '', + 'info' => "$output [$file]", + ]; + + $junit->markTestAs('BORK', $shortname, $tested, null, $output); + return 'BORKED'; + } + } + + if (!extension_loaded("zlib") && $test->hasAnySections("GZIP_POST", "DEFLATE_POST")) { + $message = "ext/zlib required"; + show_result('SKIP', $tested, $tested_file, "reason: $message", $temp_filenames); + $junit->markTestAs('SKIP', $shortname, $tested, null, $message); + return 'SKIPPED'; + } + + if ($test->hasSection('REDIRECTTEST')) { + $test_files = []; + + $IN_REDIRECT = eval($test->getSection('REDIRECTTEST')); + $IN_REDIRECT['via'] = "via [$shortname]\n\t"; + $IN_REDIRECT['dir'] = realpath(dirname($file)); + $IN_REDIRECT['prefix'] = $tested; + $IN_REDIRECT['EXTENSIONS'] = $extensions; + + if (!empty($IN_REDIRECT['TESTS'])) { + if (is_array($org_file)) { + $test_files[] = $org_file[1]; + } else { + $GLOBALS['test_files'] = $test_files; + find_files($IN_REDIRECT['TESTS']); + + foreach ($GLOBALS['test_files'] as $f) { + $test_files[] = [$f, $file]; + } + } + $test_cnt += count($test_files) - 1; + $test_idx--; + + show_redirect_start($IN_REDIRECT['TESTS'], $tested, $tested_file); + + // set up environment + $redirenv = array_merge($environment, $IN_REDIRECT['ENV']); + $redirenv['REDIR_TEST_DIR'] = realpath($IN_REDIRECT['TESTS']) . DIRECTORY_SEPARATOR; + + usort($test_files, "test_sort"); + run_all_tests($test_files, $redirenv, $tested); + + show_redirect_ends($IN_REDIRECT['TESTS'], $tested, $tested_file); + + // a redirected test never fails + $IN_REDIRECT = false; + + $junit->markTestAs('PASS', $shortname, $tested); + return 'REDIR'; + } + + $bork_info = "Redirect info must contain exactly one TEST string to be used as redirect directory."; + show_result("BORK", $bork_info, '', '', $temp_filenames); + $PHP_FAILED_TESTS['BORKED'][] = [ + 'name' => $file, + 'test_name' => '', + 'output' => '', + 'diff' => '', + 'info' => "$bork_info [$file]", + ]; + } + + if (is_array($org_file) || $test->hasSection('REDIRECTTEST')) { + if (is_array($org_file)) { + $file = $org_file[0]; + } + + $bork_info = "Redirected test did not contain redirection info"; + show_result("BORK", $bork_info, '', '', $temp_filenames); + $PHP_FAILED_TESTS['BORKED'][] = [ + 'name' => $file, + 'test_name' => '', + 'output' => '', + 'diff' => '', + 'info' => "$bork_info [$file]", + ]; + + $junit->markTestAs('BORK', $shortname, $tested, null, $bork_info); + + return 'BORKED'; + } + + // We've satisfied the preconditions - run the test! + if ($test->hasSection('FILE')) { + show_file_block('php', $test->getSection('FILE'), 'TEST'); + save_text($test_file, $test->getSection('FILE'), $temp_file); + } else { + $test_file = $temp_file = ""; + } + + if ($test->hasSection('GET')) { + $query_string = trim($test->getSection('GET')); + } else { + $query_string = ''; + } + + $env['REDIRECT_STATUS'] = '1'; + if (empty($env['QUERY_STRING'])) { + $env['QUERY_STRING'] = $query_string; + } + if (empty($env['PATH_TRANSLATED'])) { + $env['PATH_TRANSLATED'] = $test_file; + } + if (empty($env['SCRIPT_FILENAME'])) { + $env['SCRIPT_FILENAME'] = $test_file; + } + + if ($test->hasSection('COOKIE')) { + $env['HTTP_COOKIE'] = trim($test->getSection('COOKIE')); + } else { + $env['HTTP_COOKIE'] = ''; + } + + $args = $test->hasSection('ARGS') ? ' -- ' . $test->getSection('ARGS') : ''; + + if ($preload && !empty($test_file)) { + save_text($preload_filename, "sectionNotEmpty('POST_RAW')) { + $post = trim($test->getSection('POST_RAW')); + $raw_lines = explode("\n", $post); + + $request = ''; + $started = false; + + foreach ($raw_lines as $line) { + if (empty($env['CONTENT_TYPE']) && preg_match('/^Content-Type:(.*)/i', $line, $res)) { + $env['CONTENT_TYPE'] = trim(str_replace("\r", '', $res[1])); + continue; + } + + if ($started) { + $request .= "\n"; + } + + $started = true; + $request .= $line; + } + + $env['CONTENT_LENGTH'] = strlen($request); + $env['REQUEST_METHOD'] = 'POST'; + + if (empty($request)) { + $junit->markTestAs('BORK', $shortname, $tested, null, 'empty $request'); + return 'BORKED'; + } + + save_text($tmp_post, $request); + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; + } elseif ($test->sectionNotEmpty('PUT')) { + $post = trim($test->getSection('PUT')); + $raw_lines = explode("\n", $post); + + $request = ''; + $started = false; + + foreach ($raw_lines as $line) { + if (empty($env['CONTENT_TYPE']) && preg_match('/^Content-Type:(.*)/i', $line, $res)) { + $env['CONTENT_TYPE'] = trim(str_replace("\r", '', $res[1])); + continue; + } + + if ($started) { + $request .= "\n"; + } + + $started = true; + $request .= $line; + } + + $env['CONTENT_LENGTH'] = strlen($request); + $env['REQUEST_METHOD'] = 'PUT'; + + if (empty($request)) { + $junit->markTestAs('BORK', $shortname, $tested, null, 'empty $request'); + return 'BORKED'; + } + + save_text($tmp_post, $request); + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; + } elseif ($test->sectionNotEmpty('POST')) { + $post = trim($test->getSection('POST')); + $content_length = strlen($post); + save_text($tmp_post, $post); + + $env['REQUEST_METHOD'] = 'POST'; + if (empty($env['CONTENT_TYPE'])) { + $env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; + } + + if (empty($env['CONTENT_LENGTH'])) { + $env['CONTENT_LENGTH'] = $content_length; + } + + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; + } elseif ($test->sectionNotEmpty('GZIP_POST')) { + $post = trim($test->getSection('GZIP_POST')); + $post = gzencode($post, 9, FORCE_GZIP); + $env['HTTP_CONTENT_ENCODING'] = 'gzip'; + + save_text($tmp_post, $post); + $content_length = strlen($post); + + $env['REQUEST_METHOD'] = 'POST'; + $env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; + $env['CONTENT_LENGTH'] = $content_length; + + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; + } elseif ($test->sectionNotEmpty('DEFLATE_POST')) { + $post = trim($test->getSection('DEFLATE_POST')); + $post = gzcompress($post, 9); + $env['HTTP_CONTENT_ENCODING'] = 'deflate'; + save_text($tmp_post, $post); + $content_length = strlen($post); + + $env['REQUEST_METHOD'] = 'POST'; + $env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; + $env['CONTENT_LENGTH'] = $content_length; + + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; + } else { + $env['REQUEST_METHOD'] = 'GET'; + $env['CONTENT_TYPE'] = ''; + $env['CONTENT_LENGTH'] = ''; + + $repeat_option = $num_repeats > 1 ? "--repeat $num_repeats" : ""; + $cmd = "$php $pass_options $repeat_option $ini_settings -f \"$test_file\" $args$cmdRedirect"; + } + + $orig_cmd = $cmd; + if ($valgrind) { + $env['USE_ZEND_ALLOC'] = '0'; + $env['ZEND_DONT_UNLOAD_MODULES'] = 1; + + $cmd = $valgrind->wrapCommand($cmd, $memcheck_filename, strpos($test_file, "pcre") !== false); + } + + if ($test->hasSection('XLEAK')) { + $env['ZEND_ALLOC_PRINT_LEAKS'] = '0'; + if (isset($env['SKIP_ASAN'])) { + // $env['LSAN_OPTIONS'] = 'detect_leaks=0'; + /* For unknown reasons, LSAN_OPTIONS=detect_leaks=0 would occasionally not be picked up + * in CI. Skip the test with ASAN, as it's not worth investegating. */ + return skip_test($tested, $tested_file, $shortname, 'xleak does not work with asan'); + } + } + + if ($DETAILED) { + echo " +CONTENT_LENGTH = " . $env['CONTENT_LENGTH'] . " +CONTENT_TYPE = " . $env['CONTENT_TYPE'] . " +PATH_TRANSLATED = " . $env['PATH_TRANSLATED'] . " +QUERY_STRING = " . $env['QUERY_STRING'] . " +REDIRECT_STATUS = " . $env['REDIRECT_STATUS'] . " +REQUEST_METHOD = " . $env['REQUEST_METHOD'] . " +SCRIPT_FILENAME = " . $env['SCRIPT_FILENAME'] . " +HTTP_COOKIE = " . $env['HTTP_COOKIE'] . " +COMMAND $cmd +"; + } + + $junit->startTimer($shortname); + $hrtime = hrtime(); + $startTime = $hrtime[0] * 1000000000 + $hrtime[1]; + + $stdin = $test->hasSection('STDIN') ? $test->getSection('STDIN') : null; + $out = system_with_timeout($cmd, $env, $stdin, $captureStdIn, $captureStdOut, $captureStdErr); + + $junit->stopTimer($shortname); + $hrtime = hrtime(); + $time = $hrtime[0] * 1000000000 + $hrtime[1] - $startTime; + if ($time >= $slow_min_ms * 1000000) { + $PHP_FAILED_TESTS['SLOW'][] = [ + 'name' => $file, + 'test_name' => $tested . " [$tested_file]", + 'output' => '', + 'diff' => '', + 'info' => $time / 1000000000, + ]; + } + + // Remember CLEAN output to report borked test if it otherwise passes. + $clean_output = null; + if ((!$no_clean || $cfg['keep']['clean']) && $test->sectionNotEmpty('CLEAN')) { + show_file_block('clean', $test->getSection('CLEAN')); + save_text($test_clean, trim($test->getSection('CLEAN')), $temp_clean); + + if (!$no_clean) { + $extra = !IS_WINDOWS ? + "unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;" : ""; + $clean_output = system_with_timeout("$extra $orig_php $pass_options -q $orig_ini_settings $no_file_cache \"$test_clean\"", $env); + } + + if (!$cfg['keep']['clean']) { + @unlink($test_clean); + } + } + + $leaked = false; + $passed = false; + + if ($valgrind) { // leak check + $leaked = filesize($memcheck_filename) > 0; + + if (!$leaked) { + @unlink($memcheck_filename); + } + } + + if ($num_repeats > 1) { + // In repeat mode, retain the output before the first execution, + // and of the last execution. Do this early, because the trimming below + // makes the newline handling complicated. + $separator1 = "Executing for the first time...\n"; + $separator1_pos = strpos($out, $separator1); + if ($separator1_pos !== false) { + $separator2 = "Finished execution, repeating...\n"; + $separator2_pos = strrpos($out, $separator2); + if ($separator2_pos !== false) { + $out = substr($out, 0, $separator1_pos) + . substr($out, $separator2_pos + strlen($separator2)); + } else { + $out = substr($out, 0, $separator1_pos) + . substr($out, $separator1_pos + strlen($separator1)); + } + } + } + + // Does the output match what is expected? + $output = preg_replace("/\r\n/", "\n", trim($out)); + + /* when using CGI, strip the headers from the output */ + $headers = []; + + if (!empty($uses_cgi) && preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) { + $output = trim($match[2]); + $rh = preg_split("/[\n\r]+/", $match[1]); + + foreach ($rh as $line) { + if (strpos($line, ':') !== false) { + $line = explode(':', $line, 2); + $headers[trim($line[0])] = trim($line[1]); + } + } + } + + $wanted_headers = null; + $output_headers = null; + $failed_headers = false; + + if ($test->hasSection('EXPECTHEADERS')) { + $want = []; + $wanted_headers = []; + $lines = preg_split("/[\n\r]+/", $test->getSection('EXPECTHEADERS')); + + foreach ($lines as $line) { + if (strpos($line, ':') !== false) { + $line = explode(':', $line, 2); + $want[trim($line[0])] = trim($line[1]); + $wanted_headers[] = trim($line[0]) . ': ' . trim($line[1]); + } + } + + $output_headers = []; + + foreach ($want as $k => $v) { + if (isset($headers[$k])) { + $output_headers[] = $k . ': ' . $headers[$k]; + } + + if (!isset($headers[$k]) || $headers[$k] != $v) { + $failed_headers = true; + } + } + + ksort($wanted_headers); + $wanted_headers = implode("\n", $wanted_headers); + ksort($output_headers); + $output_headers = implode("\n", $output_headers); + } + + show_file_block('out', $output); + + if ($preload) { + $output = trim(preg_replace("/\n?Warning: Can't preload [^\n]*\n?/", "", $output)); + } + + if ($test->hasAnySections('EXPECTF', 'EXPECTREGEX')) { + if ($test->hasSection('EXPECTF')) { + $wanted = trim($test->getSection('EXPECTF')); + } else { + $wanted = trim($test->getSection('EXPECTREGEX')); + } + + show_file_block('exp', $wanted); + $wanted_re = preg_replace('/\r\n/', "\n", $wanted); + + if ($test->hasSection('EXPECTF')) { + $wanted_re = expectf_to_regex($wanted_re); + } + + if (preg_match('/^' . $wanted_re . '$/s', $output)) { + $passed = true; + } + } else { + $wanted = trim($test->getSection('EXPECT')); + $wanted = preg_replace('/\r\n/', "\n", $wanted); + show_file_block('exp', $wanted); + + // compare and leave on success + if (!strcmp($output, $wanted)) { + $passed = true; + } + + $wanted_re = null; + } + if (!$passed && !$retried && error_may_be_retried($test, $output)) { + $retried = true; + goto retry; + } + + if ($passed) { + if (!$cfg['keep']['php'] && !$leaked) { + @unlink($test_file); + @unlink($preload_filename); + } + @unlink($tmp_post); + + if (!$leaked && !$failed_headers) { + // If the test passed and CLEAN produced output, report test as borked. + if ($clean_output) { + show_result("BORK", $output, $tested_file, 'reason: invalid output from CLEAN', $temp_filenames); + $PHP_FAILED_TESTS['BORKED'][] = [ + 'name' => $file, + 'test_name' => '', + 'output' => '', + 'diff' => '', + 'info' => "$clean_output [$file]", + ]; + + $junit->markTestAs('BORK', $shortname, $tested, null, $clean_output); + return 'BORKED'; + } + + if ($test->hasSection('XFAIL')) { + $warn = true; + $info = " (warn: XFAIL section but test passes)"; + } elseif ($test->hasSection('XLEAK') && $valgrind) { + // XLEAK with ASAN completely disables LSAN so the test is expected to pass + $warn = true; + $info = " (warn: XLEAK section but test passes)"; + } elseif ($retried) { + $warn = true; + $info = " (warn: Test passed on retry attempt)"; + } else { + show_result("PASS", $tested, $tested_file, '', $temp_filenames); + $junit->markTestAs('PASS', $shortname, $tested); + return 'PASSED'; + } + } + } + + // Test failed so we need to report details. + if ($failed_headers) { + $passed = false; + $wanted = $wanted_headers . "\n--HEADERS--\n" . $wanted; + $output = $output_headers . "\n--HEADERS--\n" . $output; + + if (isset($wanted_re)) { + $wanted_re = preg_quote($wanted_headers . "\n--HEADERS--\n", '/') . $wanted_re; + } + } + + $restype = []; + + if ($leaked) { + $restype[] = $test->hasSection('XLEAK') ? + 'XLEAK' : 'LEAK'; + } + + if ($warn) { + $restype[] = 'WARN'; + } + + if (!$passed) { + if ($test->hasSection('XFAIL')) { + $restype[] = 'XFAIL'; + $info = ' XFAIL REASON: ' . rtrim($test->getSection('XFAIL')); + } elseif ($test->hasSection('XLEAK') && $valgrind) { + // XLEAK with ASAN completely disables LSAN so the test is expected to pass + $restype[] = 'XLEAK'; + $info = ' XLEAK REASON: ' . rtrim($test->getSection('XLEAK')); + } else { + $restype[] = 'FAIL'; + } + } + + if (!$passed) { + // write .exp + if (strpos($log_format, 'E') !== false && file_put_contents($exp_filename, $wanted) === false) { + error("Cannot create expected test output - $exp_filename"); + } + + // write .out + if (strpos($log_format, 'O') !== false && file_put_contents($output_filename, $output) === false) { + error("Cannot create test output - $output_filename"); + } + + // write .diff + if (!empty($environment['TEST_PHP_DIFF_CMD'])) { + $diff = generate_diff_external($environment['TEST_PHP_DIFF_CMD'], $exp_filename, $output_filename); + } else { + $diff = generate_diff($wanted, $wanted_re, $output); + } + + if (is_array($IN_REDIRECT)) { + $orig_shortname = str_replace(TEST_PHP_SRCDIR . '/', '', $file); + $diff = "# original source file: $orig_shortname\n" . $diff; + } + if (!$SHOW_ONLY_GROUPS || array_intersect($restype, $SHOW_ONLY_GROUPS)) { + show_file_block('diff', $diff); + } + if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, $diff) === false) { + error("Cannot create test diff - $diff_filename"); + } + + // write .log + if (strpos($log_format, 'L') !== false && file_put_contents($log_filename, " +---- EXPECTED OUTPUT +$wanted +---- ACTUAL OUTPUT +$output +---- FAILED +") === false) { + error("Cannot create test log - $log_filename"); + error_report($file, $log_filename, $tested); + } + } + + if (!$passed || $leaked) { + // write .sh + if (strpos($log_format, 'S') !== false) { + $env_lines = []; + foreach ($env as $env_var => $env_val) { + $env_lines[] = "export $env_var=" . escapeshellarg($env_val ?? ""); + } + $exported_environment = $env_lines ? "\n" . implode("\n", $env_lines) . "\n" : ""; + $sh_script = << $file, + 'test_name' => (is_array($IN_REDIRECT) ? $IN_REDIRECT['via'] : '') . $tested . " [$tested_file]", + 'output' => $output_filename, + 'diff' => $diff_filename, + 'info' => $info, + ]; + } + + $diff = empty($diff) ? '' : preg_replace('/\e/', '', $diff); + + $junit->markTestAs($restype, $shortname, $tested, null, $info, $diff); + + return $restype[0] . 'ED'; +} + +function is_flaky(TestFile $test): bool +{ + if ($test->hasSection('FLAKY')) { + return true; + } + if (!$test->hasSection('FILE')) { + return false; + } + $file = $test->getSection('FILE'); + $flaky_functions = [ + 'disk_free_space', + 'hrtime', + 'microtime', + 'sleep', + 'usleep', + ]; + $regex = '(\b(' . implode('|', $flaky_functions) . ')\()i'; + return preg_match($regex, $file) === 1; +} + +function is_flaky_output(string $output): bool +{ + $messages = [ + '404: page not found', + 'address already in use', + 'connection refused', + 'deadlock', + 'mailbox already exists', + 'timed out', + ]; + $regex = '(\b(' . implode('|', $messages) . ')\b)i'; + return preg_match($regex, $output) === 1; +} + +function error_may_be_retried(TestFile $test, string $output): bool +{ + return is_flaky_output($output) + || is_flaky($test); +} + +function expectf_to_regex(?string $wanted): string +{ + $wanted_re = $wanted ?? ''; + + $wanted_re = preg_replace('/\r\n/', "\n", $wanted_re); + + // do preg_quote, but miss out any %r delimited sections + $temp = ""; + $r = "%r"; + $startOffset = 0; + $length = strlen($wanted_re); + while ($startOffset < $length) { + $start = strpos($wanted_re, $r, $startOffset); + if ($start !== false) { + // we have found a start tag + $end = strpos($wanted_re, $r, $start + 2); + if ($end === false) { + // unbalanced tag, ignore it. + $end = $start = $length; + } + } else { + // no more %r sections + $start = $end = $length; + } + // quote a non re portion of the string + $temp .= preg_quote(substr($wanted_re, $startOffset, $start - $startOffset), '/'); + // add the re unquoted. + if ($end > $start) { + $temp .= '(' . substr($wanted_re, $start + 2, $end - $start - 2) . ')'; + } + $startOffset = $end + 2; + } + $wanted_re = $temp; + + return strtr($wanted_re, [ + '%e' => preg_quote(DIRECTORY_SEPARATOR, '/'), + '%s' => '[^\r\n]+', + '%S' => '[^\r\n]*', + '%a' => '.+', + '%A' => '.*', + '%w' => '\s*', + '%i' => '[+-]?\d+', + '%d' => '\d+', + '%x' => '[0-9a-fA-F]+', + '%f' => '[+-]?(?:\d+|(?=\.\d))(?:\.\d+)?(?:[Ee][+-]?\d+)?', + '%c' => '.', + '%0' => '\x00', + ]); +} + +/** + * @return bool|int + */ +function comp_line(string $l1, string $l2, bool $is_reg) +{ + if ($is_reg) { + return preg_match('/^' . $l1 . '$/s', $l2); + } + + return !strcmp($l1, $l2); +} + +/** + * Map "Zend OPcache" to "opcache" and convert all ext names to lowercase. + */ +function remap_loaded_extensions_names(array $names): array +{ + $exts = []; + foreach ($names as $name) { + if ($name === 'Core') { + continue; + } + $exts[] = ['Zend OPcache' => 'opcache'][$name] ?? strtolower($name); + } + + return $exts; +} + +function generate_diff_external(string $diff_cmd, string $exp_file, string $output_file): string +{ + $retval = shell_exec("{$diff_cmd} {$exp_file} {$output_file}"); + + return is_string($retval) ? $retval : 'Could not run external diff tool set through TEST_PHP_DIFF_CMD environment variable'; +} + +function generate_diff(string $wanted, ?string $wanted_re, string $output): string +{ + $w = explode("\n", $wanted); + $o = explode("\n", $output); + $is_regex = $wanted_re !== null; + + $differ = new Differ(function ($expected, $new) use ($is_regex) { + if (!$is_regex) { + return $expected === $new; + } + $regex = '/^' . expectf_to_regex($expected). '$/s'; + return preg_match($regex, $new); + }); + $result = $differ->diff($w, $o); + return $result; +} + +function error(string $message): void +{ + echo "ERROR: {$message}\n"; + exit(1); +} + +function settings2array(array $settings, &$ini_settings): void +{ + foreach ($settings as $setting) { + if (strpos($setting, '=') !== false) { + $setting = explode("=", $setting, 2); + $name = trim($setting[0]); + $value = trim($setting[1]); + + if ($name == 'extension' || $name == 'zend_extension') { + if (!isset($ini_settings[$name])) { + $ini_settings[$name] = []; + } + + $ini_settings[$name][] = $value; + } else { + $ini_settings[$name] = $value; + } + } + } +} + +function settings2params(array $ini_settings): string +{ + $settings = ''; + + foreach ($ini_settings as $name => $value) { + if (is_array($value)) { + foreach ($value as $val) { + $val = addslashes($val); + $settings .= " -d \"$name=$val\""; + } + } else { + if (IS_WINDOWS && !empty($value) && $value[0] == '"') { + $len = strlen($value); + + if ($value[$len - 1] == '"') { + $value[0] = "'"; + $value[$len - 1] = "'"; + } + } else { + $value = addslashes($value); + } + + $settings .= " -d \"$name=$value\""; + } + } + + return $settings; +} + +function compute_summary(): void +{ + global $n_total, $test_results, $ignored_by_ext, $sum_results, $percent_results; + + $n_total = count($test_results); + $n_total += count($ignored_by_ext); + $sum_results = [ + 'PASSED' => 0, + 'WARNED' => 0, + 'SKIPPED' => 0, + 'FAILED' => 0, + 'BORKED' => 0, + 'LEAKED' => 0, + 'XFAILED' => 0, + 'XLEAKED' => 0 + ]; + + foreach ($test_results as $v) { + $sum_results[$v]++; + } + + $sum_results['SKIPPED'] += count($ignored_by_ext); + $percent_results = []; + + foreach ($sum_results as $v => $n) { + $percent_results[$v] = (100.0 * $n) / $n_total; + } +} + +function get_summary(bool $show_ext_summary): string +{ + global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS, $valgrind; + + $x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['BORKED']; + + if ($x_total) { + $x_warned = (100.0 * $sum_results['WARNED']) / $x_total; + $x_failed = (100.0 * $sum_results['FAILED']) / $x_total; + $x_xfailed = (100.0 * $sum_results['XFAILED']) / $x_total; + $x_xleaked = (100.0 * $sum_results['XLEAKED']) / $x_total; + $x_leaked = (100.0 * $sum_results['LEAKED']) / $x_total; + $x_passed = (100.0 * $sum_results['PASSED']) / $x_total; + } else { + $x_warned = $x_failed = $x_passed = $x_leaked = $x_xfailed = $x_xleaked = 0; + } + + $summary = ''; + + if ($show_ext_summary) { + $summary .= ' +===================================================================== +TEST RESULT SUMMARY +--------------------------------------------------------------------- +Exts skipped : ' . sprintf('%5d', count($exts_skipped)) . ($exts_skipped ? ' (' . implode(', ', $exts_skipped) . ')' : '') . ' +Exts tested : ' . sprintf('%5d', count($exts_tested)) . ' +--------------------------------------------------------------------- +'; + } + + $summary .= ' +Number of tests : ' . sprintf('%5d', $n_total) . ' ' . sprintf('%8d', $x_total); + + if ($sum_results['BORKED']) { + $summary .= ' +Tests borked : ' . sprintf('%5d (%5.1f%%)', $sum_results['BORKED'], $percent_results['BORKED']) . ' --------'; + } + + $summary .= ' +Tests skipped : ' . sprintf('%5d (%5.1f%%)', $sum_results['SKIPPED'], $percent_results['SKIPPED']) . ' -------- +Tests warned : ' . sprintf('%5d (%5.1f%%)', $sum_results['WARNED'], $percent_results['WARNED']) . ' ' . sprintf('(%5.1f%%)', $x_warned) . ' +Tests failed : ' . sprintf('%5d (%5.1f%%)', $sum_results['FAILED'], $percent_results['FAILED']) . ' ' . sprintf('(%5.1f%%)', $x_failed); + + if ($sum_results['XFAILED']) { + $summary .= ' +Expected fail : ' . sprintf('%5d (%5.1f%%)', $sum_results['XFAILED'], $percent_results['XFAILED']) . ' ' . sprintf('(%5.1f%%)', $x_xfailed); + } + + if ($valgrind) { + $summary .= ' +Tests leaked : ' . sprintf('%5d (%5.1f%%)', $sum_results['LEAKED'], $percent_results['LEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_leaked); + if ($sum_results['XLEAKED']) { + $summary .= ' +Expected leak : ' . sprintf('%5d (%5.1f%%)', $sum_results['XLEAKED'], $percent_results['XLEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_xleaked); + } + } + + $summary .= ' +Tests passed : ' . sprintf('%5d (%5.1f%%)', $sum_results['PASSED'], $percent_results['PASSED']) . ' ' . sprintf('(%5.1f%%)', $x_passed) . ' +--------------------------------------------------------------------- +Time taken : ' . sprintf('%5d seconds', $end_time - $start_time) . ' +===================================================================== +'; + $failed_test_summary = ''; + + if (count($PHP_FAILED_TESTS['SLOW'])) { + usort($PHP_FAILED_TESTS['SLOW'], function (array $a, array $b): int { + return $a['info'] < $b['info'] ? 1 : -1; + }); + + $failed_test_summary .= ' +===================================================================== +SLOW TEST SUMMARY +--------------------------------------------------------------------- +'; + foreach ($PHP_FAILED_TESTS['SLOW'] as $failed_test_data) { + $failed_test_summary .= sprintf('(%.3f s) ', $failed_test_data['info']) . $failed_test_data['test_name'] . "\n"; + } + $failed_test_summary .= "=====================================================================\n"; + } + + if (count($PHP_FAILED_TESTS['XFAILED'])) { + $failed_test_summary .= ' +===================================================================== +EXPECTED FAILED TEST SUMMARY +--------------------------------------------------------------------- +'; + foreach ($PHP_FAILED_TESTS['XFAILED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + $failed_test_summary .= "=====================================================================\n"; + } + + if (count($PHP_FAILED_TESTS['BORKED'])) { + $failed_test_summary .= ' +===================================================================== +BORKED TEST SUMMARY +--------------------------------------------------------------------- +'; + foreach ($PHP_FAILED_TESTS['BORKED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['info'] . "\n"; + } + + $failed_test_summary .= "=====================================================================\n"; + } + + if (count($PHP_FAILED_TESTS['FAILED'])) { + $failed_test_summary .= ' +===================================================================== +FAILED TEST SUMMARY +--------------------------------------------------------------------- +'; + foreach ($PHP_FAILED_TESTS['FAILED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + $failed_test_summary .= "=====================================================================\n"; + } + if (count($PHP_FAILED_TESTS['WARNED'])) { + $failed_test_summary .= ' +===================================================================== +WARNED TEST SUMMARY +--------------------------------------------------------------------- +'; + foreach ($PHP_FAILED_TESTS['WARNED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + + $failed_test_summary .= "=====================================================================\n"; + } + + if (count($PHP_FAILED_TESTS['LEAKED'])) { + $failed_test_summary .= ' +===================================================================== +LEAKED TEST SUMMARY +--------------------------------------------------------------------- +'; + foreach ($PHP_FAILED_TESTS['LEAKED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + + $failed_test_summary .= "=====================================================================\n"; + } + + if (count($PHP_FAILED_TESTS['XLEAKED'])) { + $failed_test_summary .= ' +===================================================================== +EXPECTED LEAK TEST SUMMARY +--------------------------------------------------------------------- +'; + foreach ($PHP_FAILED_TESTS['XLEAKED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + + $failed_test_summary .= "=====================================================================\n"; + } + + if ($failed_test_summary && !getenv('NO_PHPTEST_SUMMARY')) { + $summary .= $failed_test_summary; + } + + return $summary; +} + +function show_start($start_time): void +{ + echo "TIME START " . date('Y-m-d H:i:s', $start_time) . "\n=====================================================================\n"; +} + +function show_end($end_time): void +{ + echo "=====================================================================\nTIME END " . date('Y-m-d H:i:s', $end_time) . "\n"; +} + +function show_summary(): void +{ + echo get_summary(true); +} + +function show_redirect_start(string $tests, string $tested, string $tested_file): void +{ + global $SHOW_ONLY_GROUPS, $show_progress; + + if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) { + echo "REDIRECT $tests ($tested [$tested_file]) begin\n"; + } elseif ($show_progress) { + clear_show_test(); + } +} + +function show_redirect_ends(string $tests, string $tested, string $tested_file): void +{ + global $SHOW_ONLY_GROUPS, $show_progress; + + if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) { + echo "REDIRECT $tests ($tested [$tested_file]) done\n"; + } elseif ($show_progress) { + clear_show_test(); + } +} + +function show_test(int $test_idx, string $shortname): void +{ + global $test_cnt; + global $line_length; + + $str = "TEST $test_idx/$test_cnt [$shortname]\r"; + $line_length = strlen($str); + echo $str; + flush(); +} + +function clear_show_test(): void +{ + global $line_length; + // Parallel testing + global $workerID; + + if (!$workerID && isset($line_length)) { + // Write over the last line to avoid random trailing chars on next echo + echo str_repeat(" ", $line_length), "\r"; + } +} + +function parse_conflicts(string $text): array +{ + // Strip comments + $text = preg_replace('/#.*/', '', $text); + return array_map('trim', explode("\n", trim($text))); +} + +function show_result( + string $result, + string $tested, + string $tested_file, + string $extra = '', + ?array $temp_filenames = null +): void { + global $SHOW_ONLY_GROUPS, $colorize, $show_progress; + + if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) { + if ($colorize) { + /* Use ANSI escape codes for coloring test result */ + switch ( $result ) { + case 'PASS': // Light Green + $color = "\e[1;32m{$result}\e[0m"; break; + case 'FAIL': + case 'BORK': + case 'LEAK': + case 'LEAK&FAIL': + // Light Red + $color = "\e[1;31m{$result}\e[0m"; break; + default: // Yellow + $color = "\e[1;33m{$result}\e[0m"; break; + } + + echo "$color $tested [$tested_file] $extra\n"; + } else { + echo "$result $tested [$tested_file] $extra\n"; + } + } elseif ($show_progress) { + clear_show_test(); + } +} + +class BorkageException extends Exception +{ +} + +class JUnit +{ + private bool $enabled = true; + private $fp = null; + private array $suites = []; + private array $rootSuite = self::EMPTY_SUITE + ['name' => 'php']; + + private const EMPTY_SUITE = [ + 'test_total' => 0, + 'test_pass' => 0, + 'test_fail' => 0, + 'test_error' => 0, + 'test_skip' => 0, + 'test_warn' => 0, + 'files' => [], + 'execution_time' => 0, + ]; + + /** + * @throws Exception + */ + public function __construct(array $env, int $workerID) + { + // Check whether a junit log is wanted. + $fileName = $env['TEST_PHP_JUNIT'] ?? null; + if (empty($fileName)) { + $this->enabled = false; + return; + } + if (!$workerID && !$this->fp = fopen($fileName, 'w')) { + throw new Exception("Failed to open $fileName for writing."); + } + } + + public function isEnabled(): bool + { + return $this->enabled; + } + + public function clear(): void + { + $this->rootSuite = self::EMPTY_SUITE + ['name' => 'php']; + $this->suites = []; + } + + public function saveXML(): void + { + if (!$this->enabled) { + return; + } + + $xml = '<' . '?' . 'xml version="1.0" encoding="UTF-8"' . '?' . '>' . PHP_EOL; + $xml .= sprintf( + '' . PHP_EOL, + $this->rootSuite['name'], + $this->rootSuite['test_total'], + $this->rootSuite['test_fail'], + $this->rootSuite['test_error'], + $this->rootSuite['test_skip'], + $this->rootSuite['execution_time'] + ); + $xml .= $this->getSuitesXML(); + $xml .= ''; + fwrite($this->fp, $xml); + } + + private function getSuitesXML(string $suite_name = '') + { + // FIXME: $suite_name gets overwritten + $result = ''; + + foreach ($this->suites as $suite_name => $suite) { + $result .= sprintf( + '' . PHP_EOL, + $suite['name'], + $suite['test_total'], + $suite['test_fail'], + $suite['test_error'], + $suite['test_skip'], + $suite['execution_time'] + ); + + if (!empty($suite_name)) { + foreach ($suite['files'] as $file) { + $result .= $this->rootSuite['files'][$file]['xml']; + } + } + + $result .= '' . PHP_EOL; + } + + return $result; + } + + public function markTestAs( + $type, + string $file_name, + string $test_name, + ?int $time = null, + string $message = '', + string $details = '' + ): void { + if (!$this->enabled) { + return; + } + + $suite = $this->getSuiteName($file_name); + + $this->record($suite, 'test_total'); + + $time = $time ?? $this->getTimer($file_name); + $this->record($suite, 'execution_time', $time); + + $escaped_details = htmlspecialchars($details, ENT_QUOTES, 'UTF-8'); + $escaped_details = preg_replace_callback('/[\0-\x08\x0B\x0C\x0E-\x1F]/', function ($c) { + return sprintf('[[0x%02x]]', ord($c[0])); + }, $escaped_details); + $escaped_message = htmlspecialchars($message, ENT_QUOTES, 'UTF-8'); + + $escaped_test_name = htmlspecialchars($file_name . ' (' . $test_name . ')', ENT_QUOTES); + $this->rootSuite['files'][$file_name]['xml'] = "\n"; + + if (is_array($type)) { + $output_type = $type[0] . 'ED'; + $temp = array_intersect(['XFAIL', 'XLEAK', 'FAIL', 'WARN'], $type); + $type = reset($temp); + } else { + $output_type = $type . 'ED'; + } + + if ('PASS' == $type || 'XFAIL' == $type || 'XLEAK' == $type) { + $this->record($suite, 'test_pass'); + } elseif ('BORK' == $type) { + $this->record($suite, 'test_error'); + $this->rootSuite['files'][$file_name]['xml'] .= "\n"; + } elseif ('SKIP' == $type) { + $this->record($suite, 'test_skip'); + $this->rootSuite['files'][$file_name]['xml'] .= "$escaped_message\n"; + } elseif ('WARN' == $type) { + $this->record($suite, 'test_warn'); + $this->rootSuite['files'][$file_name]['xml'] .= "$escaped_message\n"; + } elseif ('FAIL' == $type) { + $this->record($suite, 'test_fail'); + $this->rootSuite['files'][$file_name]['xml'] .= "$escaped_details\n"; + } else { + $this->record($suite, 'test_error'); + $this->rootSuite['files'][$file_name]['xml'] .= "$escaped_details\n"; + } + + $this->rootSuite['files'][$file_name]['xml'] .= "\n"; + } + + private function record(string $suite, string $param, $value = 1): void + { + $this->rootSuite[$param] += $value; + $this->suites[$suite][$param] += $value; + } + + private function getTimer(string $file_name) + { + if (!$this->enabled) { + return 0; + } + + if (isset($this->rootSuite['files'][$file_name]['total'])) { + return number_format($this->rootSuite['files'][$file_name]['total'], 4); + } + + return 0; + } + + public function startTimer(string $file_name): void + { + if (!$this->enabled) { + return; + } + + if (!isset($this->rootSuite['files'][$file_name]['start'])) { + $this->rootSuite['files'][$file_name]['start'] = microtime(true); + + $suite = $this->getSuiteName($file_name); + $this->initSuite($suite); + $this->suites[$suite]['files'][$file_name] = $file_name; + } + } + + public function getSuiteName(string $file_name): string + { + return $this->pathToClassName(dirname($file_name)); + } + + private function pathToClassName(string $file_name): string + { + if (!$this->enabled) { + return ''; + } + + $ret = $this->rootSuite['name']; + $_tmp = []; + + // lookup whether we're in the PHP source checkout + $max = 5; + if (is_file($file_name)) { + $dir = dirname(realpath($file_name)); + } else { + $dir = realpath($file_name); + } + do { + array_unshift($_tmp, basename($dir)); + $chk = $dir . DIRECTORY_SEPARATOR . "main" . DIRECTORY_SEPARATOR . "php_version.h"; + $dir = dirname($dir); + } while (!file_exists($chk) && --$max > 0); + if (file_exists($chk)) { + if ($max) { + array_shift($_tmp); + } + foreach ($_tmp as $p) { + $ret .= "." . preg_replace(",[^a-z0-9]+,i", ".", $p); + } + return $ret; + } + + return $this->rootSuite['name'] . '.' . str_replace([DIRECTORY_SEPARATOR, '-'], '.', $file_name); + } + + public function initSuite(string $suite_name): void + { + if (!$this->enabled) { + return; + } + + if (!empty($this->suites[$suite_name])) { + return; + } + + $this->suites[$suite_name] = self::EMPTY_SUITE + ['name' => $suite_name]; + } + + /** + * @throws Exception + */ + public function stopTimer(string $file_name): void + { + if (!$this->enabled) { + return; + } + + if (!isset($this->rootSuite['files'][$file_name]['start'])) { + throw new Exception("Timer for $file_name was not started!"); + } + + if (!isset($this->rootSuite['files'][$file_name]['total'])) { + $this->rootSuite['files'][$file_name]['total'] = 0; + } + + $start = $this->rootSuite['files'][$file_name]['start']; + $this->rootSuite['files'][$file_name]['total'] += microtime(true) - $start; + unset($this->rootSuite['files'][$file_name]['start']); + } + + public function mergeResults(?JUnit $other): void + { + if (!$this->enabled || !$other) { + return; + } + + $this->mergeSuites($this->rootSuite, $other->rootSuite); + foreach ($other->suites as $name => $suite) { + if (!isset($this->suites[$name])) { + $this->suites[$name] = $suite; + continue; + } + + $this->mergeSuites($this->suites[$name], $suite); + } + } + + private function mergeSuites(array &$dest, array $source): void + { + $dest['test_total'] += $source['test_total']; + $dest['test_pass'] += $source['test_pass']; + $dest['test_fail'] += $source['test_fail']; + $dest['test_error'] += $source['test_error']; + $dest['test_skip'] += $source['test_skip']; + $dest['test_warn'] += $source['test_warn']; + $dest['execution_time'] += $source['execution_time']; + $dest['files'] += $source['files']; + } +} + +class SkipCache +{ + private bool $enable; + private bool $keepFile; + + private array $skips = []; + private array $extensions = []; + + private int $hits = 0; + private int $misses = 0; + private int $extHits = 0; + private int $extMisses = 0; + + public function __construct(bool $enable, bool $keepFile) + { + $this->enable = $enable; + $this->keepFile = $keepFile; + } + + public function checkSkip(string $php, string $code, string $checkFile, string $tempFile, array $env): string + { + // Extension tests frequently use something like $dir"; + + if (isset($this->skips[$key][$code])) { + $this->hits++; + if ($this->keepFile) { + save_text($checkFile, $code, $tempFile); + } + return $this->skips[$key][$code]; + } + + save_text($checkFile, $code, $tempFile); + $result = trim(system_with_timeout("$php \"$checkFile\"", $env)); + if (strpos($result, 'nocache') === 0) { + $result = ''; + } else if ($this->enable) { + $this->skips[$key][$code] = $result; + } + $this->misses++; + + if (!$this->keepFile) { + @unlink($checkFile); + } + + return $result; + } + + public function getExtensions(string $php): array + { + if (isset($this->extensions[$php])) { + $this->extHits++; + return $this->extensions[$php]; + } + + $extDir = shell_exec("$php -d display_errors=0 -r \"echo ini_get('extension_dir');\""); + $extensionsNames = explode(",", shell_exec("$php -d display_errors=0 -r \"echo implode(',', get_loaded_extensions());\"")); + $extensions = remap_loaded_extensions_names($extensionsNames); + + $result = [$extDir, $extensions]; + $this->extensions[$php] = $result; + $this->extMisses++; + + return $result; + } + +// public function __destruct() +// { +// echo "Skips: {$this->hits} hits, {$this->misses} misses.\n"; +// echo "Extensions: {$this->extHits} hits, {$this->extMisses} misses.\n"; +// echo "Cache distribution:\n"; +// +// foreach ($this->skips as $php => $cache) { +// echo "$php: " . count($cache) . "\n"; +// } +// } +} + +class RuntestsValgrind +{ + protected $version = ''; + protected $header = ''; + protected $version_3_8_0 = false; + protected $tool = null; + + public function getVersion(): string + { + return $this->version; + } + + public function getHeader(): string + { + return $this->header; + } + + public function __construct(array $environment, string $tool = 'memcheck') + { + $this->tool = $tool; + $header = system_with_timeout("valgrind --tool={$this->tool} --version", $environment); + if (!$header) { + error("Valgrind returned no version info for {$this->tool}, cannot proceed.\n". + "Please check if Valgrind is installed and the tool is named correctly."); + } + $count = 0; + $version = preg_replace("/valgrind-(\d+)\.(\d+)\.(\d+)([.\w_-]+)?(\s+)/", '$1.$2.$3', $header, 1, $count); + if ($count != 1) { + error("Valgrind returned invalid version info (\"{$header}\") for {$this->tool}, cannot proceed."); + } + $this->version = $version; + $this->header = sprintf( + "%s (%s)", trim($header), $this->tool); + $this->version_3_8_0 = version_compare($version, '3.8.0', '>='); + } + + public function wrapCommand(string $cmd, string $memcheck_filename, bool $check_all): string + { + $vcmd = "valgrind -q --tool={$this->tool} --trace-children=yes"; + if ($check_all) { + $vcmd .= ' --smc-check=all'; + } + + /* --vex-iropt-register-updates=allregs-at-mem-access is necessary for phpdbg watchpoint tests */ + if ($this->version_3_8_0) { + return "$vcmd --vex-iropt-register-updates=allregs-at-mem-access --log-file=$memcheck_filename $cmd"; + } + return "$vcmd --vex-iropt-precise-memory-exns=yes --log-file=$memcheck_filename $cmd"; + } +} + +class TestFile +{ + private string $fileName; + + private array $sections = ['TEST' => '']; + + private const ALLOWED_SECTIONS = [ + 'EXPECT', 'EXPECTF', 'EXPECTREGEX', 'EXPECTREGEX_EXTERNAL', 'EXPECT_EXTERNAL', 'EXPECTF_EXTERNAL', 'EXPECTHEADERS', + 'POST', 'POST_RAW', 'GZIP_POST', 'DEFLATE_POST', 'PUT', 'GET', 'COOKIE', 'ARGS', + 'FILE', 'FILEEOF', 'FILE_EXTERNAL', 'REDIRECTTEST', + 'CAPTURE_STDIO', 'STDIN', 'CGI', 'PHPDBG', + 'INI', 'ENV', 'EXTENSIONS', + 'SKIPIF', 'XFAIL', 'XLEAK', 'CLEAN', + 'CREDITS', 'DESCRIPTION', 'CONFLICTS', 'WHITESPACE_SENSITIVE', + 'FLAKY', + ]; + + /** + * @throws BorkageException + */ + public function __construct(string $fileName, bool $inRedirect) + { + $this->fileName = $fileName; + + $this->readFile(); + $this->validateAndProcess($inRedirect); + } + + public function hasSection(string $name): bool + { + return isset($this->sections[$name]); + } + + public function hasAllSections(string ...$names): bool + { + foreach ($names as $section) { + if (!isset($this->sections[$section])) { + return false; + } + } + + return true; + } + + public function hasAnySections(string ...$names): bool + { + foreach ($names as $section) { + if (isset($this->sections[$section])) { + return true; + } + } + + return false; + } + + public function sectionNotEmpty(string $name): bool + { + return !empty($this->sections[$name]); + } + + /** + * @throws Exception + */ + public function getSection(string $name): string + { + if (!isset($this->sections[$name])) { + throw new Exception("Section $name not found"); + } + return $this->sections[$name]; + } + + public function getName(): string + { + return trim($this->getSection('TEST')); + } + + public function isCGI(): bool + { + return $this->hasSection('CGI') + || $this->sectionNotEmpty('GET') + || $this->sectionNotEmpty('POST') + || $this->sectionNotEmpty('GZIP_POST') + || $this->sectionNotEmpty('DEFLATE_POST') + || $this->sectionNotEmpty('POST_RAW') + || $this->sectionNotEmpty('PUT') + || $this->sectionNotEmpty('COOKIE') + || $this->sectionNotEmpty('EXPECTHEADERS'); + } + + /** + * TODO Refactor to make it not needed + */ + public function setSection(string $name, string $value): void + { + $this->sections[$name] = $value; + } + + /** + * Load the sections of the test file + * @throws BorkageException + */ + private function readFile(): void + { + $fp = fopen($this->fileName, "rb") or error("Cannot open test file: {$this->fileName}"); + + if (!feof($fp)) { + $line = fgets($fp); + + if ($line === false) { + throw new BorkageException("cannot read test"); + } + } else { + throw new BorkageException("empty test [{$this->fileName}]"); + } + if (strncmp('--TEST--', $line, 8)) { + throw new BorkageException("tests must start with --TEST-- [{$this->fileName}]"); + } + + $section = 'TEST'; + $secfile = false; + $secdone = false; + + while (!feof($fp)) { + $line = fgets($fp); + + if ($line === false) { + break; + } + + // Match the beginning of a section. + if (preg_match('/^--([_A-Z]+)--/', $line, $r)) { + $section = (string) $r[1]; + + if (isset($this->sections[$section]) && $this->sections[$section]) { + throw new BorkageException("duplicated $section section"); + } + + // check for unknown sections + if (!in_array($section, self::ALLOWED_SECTIONS)) { + throw new BorkageException('Unknown section "' . $section . '"'); + } + + $this->sections[$section] = ''; + $secfile = $section == 'FILE' || $section == 'FILEEOF' || $section == 'FILE_EXTERNAL'; + $secdone = false; + continue; + } + + // Add to the section text. + if (!$secdone) { + $this->sections[$section] .= $line; + } + + // End of actual test? + if ($secfile && preg_match('/^===DONE===\s*$/', $line)) { + $secdone = true; + } + } + + fclose($fp); + } + + /** + * @throws BorkageException + */ + private function validateAndProcess(bool $inRedirect): void + { + // the redirect section allows a set of tests to be reused outside of + // a given test dir + if ($this->hasSection('REDIRECTTEST')) { + if ($inRedirect) { + throw new BorkageException("Can't redirect a test from within a redirected test"); + } + return; + } + if (!$this->hasSection('PHPDBG') && $this->hasSection('FILE') + $this->hasSection('FILEEOF') + $this->hasSection('FILE_EXTERNAL') != 1) { + throw new BorkageException("missing section --FILE--"); + } + + if ($this->hasSection('FILEEOF')) { + $this->sections['FILE'] = preg_replace("/[\r\n]+$/", '', $this->sections['FILEEOF']); + unset($this->sections['FILEEOF']); + } + + foreach (['FILE', 'EXPECT', 'EXPECTF', 'EXPECTREGEX'] as $prefix) { + // For grepping: FILE_EXTERNAL, EXPECT_EXTERNAL, EXPECTF_EXTERNAL, EXPECTREGEX_EXTERNAL + $key = $prefix . '_EXTERNAL'; + + if ($this->hasSection($key)) { + // don't allow tests to retrieve files from anywhere but this subdirectory + $dir = dirname($this->fileName); + $fileName = $dir . '/' . trim(str_replace('..', '', $this->getSection($key))); + + if (file_exists($fileName)) { + $this->sections[$prefix] = file_get_contents($fileName); + } else { + throw new BorkageException("could not load --" . $key . "-- " . $dir . '/' . trim($fileName)); + } + } + } + + if (($this->hasSection('EXPECT') + $this->hasSection('EXPECTF') + $this->hasSection('EXPECTREGEX')) != 1) { + throw new BorkageException("missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX--"); + } + + if ($this->hasSection('PHPDBG') && !$this->hasSection('STDIN')) { + $this->sections['STDIN'] = $this->sections['PHPDBG'] . "\n"; + } + } +} + +function init_output_buffers(): void +{ + // Delete as much output buffers as possible. + while (@ob_end_clean()) { + } + + if (ob_get_level()) { + echo "Not all buffers were deleted.\n"; + } +} + +function check_proc_open_function_exists(): void +{ + if (!function_exists('proc_open')) { + echo <<outputBuilder = new DiffOutputBuilder; + $this->isEqual = $isEqual; + } + + public function diff(array $from, array $to): string + { + $diff = $this->diffToArray($from, $to); + + return $this->outputBuilder->getDiff($diff); + } + + public function diffToArray(array $from, array $to): array + { + $fromLine = 1; + $toLine = 1; + + [$from, $to, $start, $end] = $this->getArrayDiffParted($from, $to); + + $common = $this->calculateCommonSubsequence(array_values($from), array_values($to)); + $diff = []; + + foreach ($start as $token) { + $diff[] = [$token, self::OLD]; + $fromLine++; + $toLine++; + } + + reset($from); + reset($to); + + foreach ($common as $token) { + while (!empty($from) && !($this->isEqual)(reset($from), $token)) { + $diff[] = [array_shift($from), self::REMOVED, $fromLine++]; + } + + while (!empty($to) && !($this->isEqual)($token, reset($to))) { + $diff[] = [array_shift($to), self::ADDED, $toLine++]; + } + + $diff[] = [$token, self::OLD]; + $fromLine++; + $toLine++; + + array_shift($from); + array_shift($to); + } + + while (($token = array_shift($from)) !== null) { + $diff[] = [$token, self::REMOVED, $fromLine++]; + } + + while (($token = array_shift($to)) !== null) { + $diff[] = [$token, self::ADDED, $toLine++]; + } + + foreach ($end as $token) { + $diff[] = [$token, self::OLD]; + $fromLine++; + $toLine++; + } + + return $diff; + } + + private function getArrayDiffParted(array &$from, array &$to): array + { + $start = []; + $end = []; + + reset($to); + + foreach ($from as $k => $v) { + $toK = key($to); + + if (($this->isEqual)($toK, $k) && ($this->isEqual)($v, $to[$k])) { + $start[$k] = $v; + + unset($from[$k], $to[$k]); + } else { + break; + } + } + + end($from); + end($to); + + do { + $fromK = key($from); + $toK = key($to); + + if (null === $fromK || null === $toK || !($this->isEqual)(current($from), current($to))) { + break; + } + + prev($from); + prev($to); + + $end = [$fromK => $from[$fromK]] + $end; + unset($from[$fromK], $to[$toK]); + } while (true); + + return [$from, $to, $start, $end]; + } + + public function calculateCommonSubsequence(array $from, array $to): array + { + $cFrom = count($from); + $cTo = count($to); + + if ($cFrom === 0) { + return []; + } + + if ($cFrom === 1) { + foreach ($to as $toV) { + if (($this->isEqual)($from[0], $toV)) { + return [$toV]; + } + } + + return []; + } + + $i = (int) ($cFrom / 2); + $fromStart = array_slice($from, 0, $i); + $fromEnd = array_slice($from, $i); + $llB = $this->commonSubsequenceLength($fromStart, $to); + $llE = $this->commonSubsequenceLength(array_reverse($fromEnd), array_reverse($to)); + $jMax = 0; + $max = 0; + + for ($j = 0; $j <= $cTo; $j++) { + $m = $llB[$j] + $llE[$cTo - $j]; + + if ($m >= $max) { + $max = $m; + $jMax = $j; + } + } + + $toStart = array_slice($to, 0, $jMax); + $toEnd = array_slice($to, $jMax); + + return array_merge( + $this->calculateCommonSubsequence($fromStart, $toStart), + $this->calculateCommonSubsequence($fromEnd, $toEnd) + ); + } + + private function commonSubsequenceLength(array $from, array $to): array + { + $current = array_fill(0, count($to) + 1, 0); + $cFrom = count($from); + $cTo = count($to); + + for ($i = 0; $i < $cFrom; $i++) { + $prev = $current; + + for ($j = 0; $j < $cTo; $j++) { + if (($this->isEqual)($from[$i], $to[$j])) { + $current[$j + 1] = $prev[$j] + 1; + } else { + $current[$j + 1] = max($current[$j], $prev[$j + 1]); + } + } + } + + return $current; + } +} + +class DiffOutputBuilder +{ + public function getDiff(array $diffs): string + { + global $context_line_count; + $i = 0; + $string = ''; + $number_len = max(3, strlen((string)count($diffs))); + $line_number_spec = '%0' . $number_len . 'd'; + $buffer = fopen('php://memory', 'r+b'); + while ($i < count($diffs)) { + // Find next difference + $next = $i; + while ($next < count($diffs)) { + if ($diffs[$next][1] !== Differ::OLD) { + break; + } + $next++; + } + // Found no more differenciating rows, we're done + if ($next === count($diffs)) { + if (($i - 1) < count($diffs)) { + fwrite($buffer, "--\n"); + } + break; + } + // Print separator if necessary + if ($i < ($next - $context_line_count)) { + fwrite($buffer, "--\n"); + $i = $next - $context_line_count; + } + // Print leading context + while ($i < $next) { + fwrite($buffer, str_repeat(' ', $number_len + 2)); + fwrite($buffer, $diffs[$i][0]); + fwrite($buffer, "\n"); + $i++; + } + // Print differences + while ($i < count($diffs) && $diffs[$i][1] !== Differ::OLD) { + fwrite($buffer, sprintf($line_number_spec, $diffs[$i][2])); + switch ($diffs[$i][1]) { + case Differ::ADDED: + fwrite($buffer, '+ '); + break; + case Differ::REMOVED: + fwrite($buffer, '- '); + break; + } + fwrite($buffer, $diffs[$i][0]); + fwrite($buffer, "\n"); + $i++; + } + // Print trailing context + $afterContext = min($i + $context_line_count, count($diffs)); + while ($i < $afterContext && $diffs[$i][1] === Differ::OLD) { + fwrite($buffer, str_repeat(' ', $number_len + 2)); + fwrite($buffer, $diffs[$i][0]); + fwrite($buffer, "\n"); + $i++; + } + } + + $diff = stream_get_contents($buffer, -1, 0); + fclose($buffer); + + return $diff; + } +} + +main(); diff --git a/lib/php/build/shtool b/lib/php/build/shtool new file mode 100755 index 0000000..ea1119a --- /dev/null +++ b/lib/php/build/shtool @@ -0,0 +1,1814 @@ +#!/bin/sh +## +## GNU shtool -- The GNU Portable Shell Tool +## Copyright (c) 1994-2008 Ralf S. Engelschall +## +## See http://www.gnu.org/software/shtool/ for more information. +## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. +## +## Version: 2.0.8 (18-Jul-2008) +## Contents: 5/19 available modules +## + +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +## USA, or contact Ralf S. Engelschall . +## +## NOTICE: Given that you include this file verbatim into your own +## source tree, you are justified in saying that it remains separate +## from your package, and that this way you are simply just using GNU +## shtool. So, in this situation, there is no requirement that your +## package itself is licensed under the GNU General Public License in +## order to take advantage of GNU shtool. +## + +## +## Usage: shtool [] [ [] []] +## +## Available commands: +## echo Print string with optional construct expansion +## install Install a program, script or datafile +## mkdir Make one or more directories +## platform Platform Identification Utility +## path Deal with program paths +## +## Not available commands (because module was not built-in): +## mdate Pretty-print modification time of a file or dir +## table Pretty-print a field-separated list as a table +## prop Display progress with a running propeller +## move Move files with simultaneous substitution +## mkln Make link with calculation of relative paths +## mkshadow Make a shadow tree through symbolic links +## fixperm Fix file permissions inside a source tree +## rotate Logfile rotation +## tarball Roll distribution tarballs +## subst Apply sed(1) substitution operations +## arx Extended archive command +## slo Separate linker options by library class +## scpp Sharing C Pre-Processor +## version Maintain a version information file +## + +# maximum Bourne-Shell compatibility +if [ ".$ZSH_VERSION" != . ] && (emulate sh) >/dev/null 2>&1; then + # reconfigure zsh(1) + emulate sh + NULLCMD=: + alias -g '${1+"$@"}'='"$@"' +elif [ ".$BASH_VERSION" != . ] && (set -o posix) >/dev/null 2>&1; then + # reconfigure bash(1) + set -o posix +fi + +# maximum independence of NLS nuisances +for var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $var=C; export $var) 2>&1`"); then + eval $var=C; export $var + else + unset $var + fi +done + +# initial command line handling +if [ $# -eq 0 ]; then + echo "$0:Error: invalid command line" 1>&2 + echo "$0:Hint: run \`$0 -h' for usage" 1>&2 + exit 1 +fi +if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then + echo "This is GNU shtool, version 2.0.8 (18-Jul-2008)" + echo 'Copyright (c) 1994-2008 Ralf S. Engelschall ' + echo 'Report bugs to ' + echo '' + echo 'Usage: shtool [] [ [] []]' + echo '' + echo 'Available global :' + echo ' -v, --version display shtool version information' + echo ' -h, --help display shtool usage help page (this one)' + echo ' -d, --debug display shell trace information' + echo ' -r, --recreate recreate this shtool script via shtoolize' + echo '' + echo 'Available [] []:' + echo ' echo [-n|--newline] [-e|--expand] [ ...]' + echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]' + echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode ]' + echo ' [-o|--owner ] [-g|--group ] [-e|--exec' + echo ' ] [ ...] ' + echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] ' + echo ' [ ...]' + echo ' platform [-F|--format ] [-S|--sep ] [-C|--conc' + echo ' ] [-L|--lower] [-U|--upper] [-v|--verbose]' + echo ' [-c|--concise] [-n|--no-newline] [-t|--type ]' + echo ' [-V|--version] [-h|--help]' + echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]' + echo ' [-m|--magic] [-p|--path ] [ ...]' + echo '' + echo 'Not available (because module was not built-in):' + echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]' + echo ' [-f|--field-sep ] [-o|--order ] ' + echo ' table [-F|--field-sep ] [-w|--width ] [-c|--columns' + echo ' ] [-s|--strip ] ...' + echo ' prop [-p|--prefix ]' + echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]' + echo ' ' + echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] ' + echo ' [ ...] ' + echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] ' + echo ' fixperm [-v|--verbose] [-t|--trace] [ ...]' + echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files' + echo ' ] [-s|--size ] [-c|--copy] [-r|--remove]' + echo ' [-a|--archive-dir ] [-z|--compress [:]]' + echo ' [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] [-M|--migrate' + echo ' ] [-P|--prolog ] [-E|--epilog ] [...]' + echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output ]' + echo ' [-c|--compress ] [-d|--directory ] [-u|--user' + echo ' ] [-g|--group ] [-e|--exclude ]' + echo ' [ ...]' + echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]' + echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup' + echo ' ] [-e|--exec ] [-f|--file ] []' + echo ' [...]' + echo ' arx [-t|--trace] [-C|--command ] [' + echo ' ...]' + echo ' slo [-p|--prefix ] -- -L -l [-L -l' + echo ' ...]' + echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter ]' + echo ' [-o|--output ] [-t|--template ] [-M|--mark' + echo ' ] [-D|--define ] [-C|--class ]' + echo ' [ ...]' + echo ' version [-l|--language ] [-n|--name ] [-p|--prefix' + echo ' ] [-s|--set ] [-e|--edit] [-i|--increase' + echo ' ] [-d|--display ] ' + echo '' + exit 0 +fi +if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then + echo "GNU shtool 2.0.8 (18-Jul-2008)" + exit 0 +fi +if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then + shtoolize -obuild/shtool echo install mkdir platform path + exit 0 +fi +if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then + shift + set -x +fi +name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` +case "$name" in + echo|install|mkdir|platform|path ) + # implicit tool command selection + tool="$name" + ;; + * ) + # explicit tool command selection + tool="$1" + shift + ;; +esac +arg_spec="" +opt_spec="" +gen_tmpfile=no + +## +## DISPATCH INTO SCRIPT PROLOG +## + +case $tool in + echo ) + str_tool="echo" + str_usage="[-n|--newline] [-e|--expand] [ ...]" + arg_spec="0+" + opt_spec="n.e." + opt_alias="n:newline,e:expand" + opt_n=no + opt_e=no + ;; + install ) + str_tool="install" + str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode ] [-o|--owner ] [-g|--group ] [-e|--exec ] [ ...] " + arg_spec="1+" + opt_spec="v.t.d.c.C.s.m:o:g:e+" + opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec" + opt_v=no + opt_t=no + opt_d=no + opt_c=no + opt_C=no + opt_s=no + opt_m="0755" + opt_o="" + opt_g="" + opt_e="" + ;; + mkdir ) + str_tool="mkdir" + str_usage="[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode ] [-o|--owner ] [-g|--group ] [ ...]" + arg_spec="1+" + opt_spec="t.f.p.m:o:g:" + opt_alias="t:trace,f:force,p:parents,m:mode,o:owner,g:group" + opt_t=no + opt_f=no + opt_p=no + opt_m="" + opt_o="" + opt_g="" + ;; + platform ) + str_tool="platform" + str_usage="[-F|--format ] [-S|--sep ] [-C|--conc ] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type ] [-V|--version] [-h|--help]" + arg_spec="0=" + opt_spec="F:S:C:L.U.v.c.n.t:d.V.h." + opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help" + opt_F="%{sp} (%{ap})" + opt_S=" " + opt_C="/" + opt_L=no + opt_U=no + opt_t="" + opt_v=no + opt_c=no + opt_n=no + opt_V=no + opt_h=no + ;; + path ) + str_tool="path" + str_usage="[-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path ] [ ...]" + gen_tmpfile=yes + arg_spec="1+" + opt_spec="s.r.d.b.m.p:" + opt_alias="s:suppress,r:reverse,d:dirname,b:basename,m:magic,p:path" + opt_s=no + opt_r=no + opt_d=no + opt_b=no + opt_m=no + opt_p="$PATH" + ;; + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 + ;; + * ) + echo "$0:Error: unknown command \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 + ;; +esac + +## +## COMMON UTILITY CODE +## + +# commonly used ASCII values +ASC_TAB=" " +ASC_NL=" +" + +# determine name of tool +if [ ".$tool" != . ]; then + # used inside shtool script + toolcmd="$0 $tool" + toolcmdhelp="shtool $tool" + msgprefix="shtool:$tool" +else + # used as standalone script + toolcmd="$0" + toolcmdhelp="sh $0" + msgprefix="$str_tool" +fi + +# parse argument specification string +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` + +# parse option specification string +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` + +# parse option alias string +eval `echo h:help,$opt_alias |\ + sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'` + +# interate over argument line +opt_PREV='' +while [ $# -gt 0 ]; do + # special option stops processing + if [ ".$1" = ".--" ]; then + shift + break + fi + + # determine option and argument + opt_ARG_OK=no + if [ ".$opt_PREV" != . ]; then + # merge previous seen option with argument + opt_OPT="$opt_PREV" + opt_ARG="$1" + opt_ARG_OK=yes + opt_PREV='' + else + # split argument into option and argument + case "$1" in + --[a-zA-Z0-9]*=*) + eval `echo "x$1" |\ + sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + ;; + --[a-zA-Z0-9]*) + opt_OPT=`echo "x$1" | cut -c4-` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + opt_ARG='' + ;; + -[a-zA-Z0-9]*) + eval `echo "x$1" |\ + sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ + -e 's/";\(.*\)$/"; opt_ARG="\1"/'` + ;; + -[a-zA-Z0-9]) + opt_OPT=`echo "x$1" | cut -c3-` + opt_ARG='' + ;; + *) + break + ;; + esac + fi + + # eat up option + shift + + # determine whether option needs an argument + eval "opt_MODE=\$opt_MODE_${opt_OPT}" + if [ ".$opt_ARG" = . ] && [ ".$opt_ARG_OK" != .yes ]; then + if [ ".$opt_MODE" = ".:" ] || [ ".$opt_MODE" = ".+" ]; then + opt_PREV="$opt_OPT" + continue + fi + fi + + # process option + case $opt_MODE in + '.' ) + # boolean option + eval "opt_${opt_OPT}=yes" + ;; + ':' ) + # option with argument (multiple occurrences override) + eval "opt_${opt_OPT}=\"\$opt_ARG\"" + ;; + '+' ) + # option with argument (multiple occurrences append) + eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\"" + ;; + * ) + echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 + exit 1 + ;; + esac +done +if [ ".$opt_PREV" != . ]; then + echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 + exit 1 +fi + +# process help option +if [ ".$opt_h" = .yes ]; then + echo "Usage: $toolcmdhelp $str_usage" + exit 0 +fi + +# complain about incorrect number of arguments +case $arg_MODE in + '=' ) + if [ $# -ne $arg_NUMS ]; then + echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + exit 1 + fi + ;; + '+' ) + if [ $# -lt $arg_NUMS ]; then + echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + exit 1 + fi + ;; +esac + +# establish a temporary file on request +if [ ".$gen_tmpfile" = .yes ]; then + # create (explicitly) secure temporary directory + if [ ".$TMPDIR" != . ]; then + tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" + else + tmpdir="/tmp" + fi + tmpdir="$tmpdir/.shtool.$$" + ( umask 077 + rm -rf "$tmpdir" >/dev/null 2>&1 || true + mkdir "$tmpdir" >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2 + exit 1 + fi + ) + + # create (implicitly) secure temporary file + tmpfile="$tmpdir/shtool.tmp" + touch "$tmpfile" +fi + +# utility function: map string to lower case +util_lower () { + echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' +} + +# utility function: map string to upper case +util_upper () { + echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +} + +# cleanup procedure +shtool_exit () { + rc="$1" + if [ ".$gen_tmpfile" = .yes ]; then + rm -rf "$tmpdir" >/dev/null 2>&1 || true + fi + exit $rc +} + +## +## DISPATCH INTO SCRIPT BODY +## + +case $tool in + +echo ) + ## + ## echo -- Print string with optional construct expansion + ## Copyright (c) 1998-2008 Ralf S. Engelschall + ## + + text="$*" + + # check for broken escape sequence expansion + seo='' + bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` + if [ ".$bytes" != .3 ]; then + bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` + if [ ".$bytes" = .3 ]; then + seo='-E' + fi + fi + + # check for existing -n option (to suppress newline) + minusn='' + bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` + if [ ".$bytes" = .3 ]; then + minusn='-n' + fi + + # determine terminal bold sequence + term_bold='' + term_norm='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[Bb]'`" != . ]; then + case $TERM in + # for the most important terminal types we directly know the sequences + xterm|xterm*|vt220|vt220*) + term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` + term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` + ;; + vt100|vt100*|cygwin) + term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` + term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` + ;; + # for all others, we try to use a possibly existing `tput' or `tcout' utility + * ) + paths=`echo $PATH | sed -e 's/:/ /g'` + for tool in tput tcout; do + for dir in $paths; do + if [ -r "$dir/$tool" ]; then + for seq in bold md smso; do # 'smso' is last + bold="`$dir/$tool $seq 2>/dev/null`" + if [ ".$bold" != . ]; then + term_bold="$bold" + break + fi + done + if [ ".$term_bold" != . ]; then + for seq in sgr0 me rmso init reset; do # 'reset' is last + norm="`$dir/$tool $seq 2>/dev/null`" + if [ ".$norm" != . ]; then + term_norm="$norm" + break + fi + done + fi + break + fi + done + if [ ".$term_bold" != . ] && [ ".$term_norm" != . ]; then + break; + fi + done + ;; + esac + if [ ".$term_bold" = . ] || [ ".$term_norm" = . ]; then + echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 + term_bold='' + term_norm='' + fi + fi + + # determine user name + username='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[uUgG]'`" != . ]; then + username="`(id -un) 2>/dev/null`" + if [ ".$username" = . ]; then + str="`(id) 2>/dev/null`" + if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then + username=`echo $str | sed -e 's/^uid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'` + fi + if [ ".$username" = . ]; then + username="$LOGNAME" + if [ ".$username" = . ]; then + username="$USER" + if [ ".$username" = . ]; then + username="`(whoami) 2>/dev/null |\ + awk '{ printf("%s", $1); }'`" + if [ ".$username" = . ]; then + username="`(who am i) 2>/dev/null |\ + awk '{ printf("%s", $1); }'`" + if [ ".$username" = . ]; then + username='unknown' + fi + fi + fi + fi + fi + fi + fi + + # determine user id + userid='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%U'`" != . ]; then + userid="`(id -u) 2>/dev/null`" + if [ ".$userid" = . ]; then + userid="`(id -u ${username}) 2>/dev/null`" + if [ ".$userid" = . ]; then + str="`(id) 2>/dev/null`" + if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then + userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*$//'` + fi + if [ ".$userid" = . ]; then + userid=`(getent passwd ${username}) 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$userid" = . ]; then + userid=`grep "^${username}:" /etc/passwd 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$userid" = . ]; then + userid=`(ypmatch "${username}" passwd; nismatch "${username}" passwd) 2>/dev/null | \ + sed -e 'q' | sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$userid" = . ]; then + userid=`(nidump passwd . | grep "^${username}:") 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$userid" = . ]; then + userid='?' + fi + fi + fi + fi + fi + fi + fi + fi + + # determine (primary) group id + groupid='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[gG]'`" != . ]; then + groupid="`(id -g ${username}) 2>/dev/null`" + if [ ".$groupid" = . ]; then + str="`(id) 2>/dev/null`" + if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then + groupid=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*//' -e 's/(.*$//'` + fi + if [ ".$groupid" = . ]; then + groupid=`(getent passwd ${username}) 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid=`grep "^${username}:" /etc/passwd 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid=`(ypmatch "${username}" passwd; nismatch "${username}" passwd) 2>/dev/null | \ + sed -e 'q' | sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid=`(nidump passwd . | grep "^${username}:") 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid='?' + fi + fi + fi + fi + fi + fi + fi + + # determine (primary) group name + groupname='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%g'`" != . ]; then + groupname="`(id -gn ${username}) 2>/dev/null`" + if [ ".$groupname" = . ]; then + str="`(id) 2>/dev/null`" + if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then + groupname=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'` + fi + if [ ".$groupname" = . ]; then + groupname=`(getent group) 2>/dev/null | \ + grep "^[^:]*:[^:]*:${groupid}:" | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname=`grep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname=`(ypcat group; niscat group) 2>/dev/null | \ + sed -e 'q' | grep "^[^:]*:[^:]*:${groupid}:" | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname=`(nidump group .) 2>/dev/null | \ + grep "^[^:]*:[^:]*:${groupid}:" | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname='?' + fi + fi + fi + fi + fi + fi + fi + + # determine host and domain name + hostname='' + domainname='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%h'`" != . ]; then + hostname="`(uname -n) 2>/dev/null |\ + awk '{ printf("%s", $1); }'`" + if [ ".$hostname" = . ]; then + hostname="`(hostname) 2>/dev/null |\ + awk '{ printf("%s", $1); }'`" + if [ ".$hostname" = . ]; then + hostname='unknown' + fi + fi + case $hostname in + *.* ) + domainname=".`echo $hostname | cut -d. -f2-`" + hostname="`echo $hostname | cut -d. -f1`" + ;; + esac + fi + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%d'`" != . ]; then + if [ ".$domainname" = . ]; then + if [ -f /etc/resolv.conf ]; then + domainname="`grep '^[ ]*domain' /etc/resolv.conf | sed -e 'q' |\ + sed -e 's/.*domain//' \ + -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ + -e 's/^\.//' -e 's/^/./' |\ + awk '{ printf("%s", $1); }'`" + if [ ".$domainname" = . ]; then + domainname="`grep '^[ ]*search' /etc/resolv.conf | sed -e 'q' |\ + sed -e 's/.*search//' \ + -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ + -e 's/ .*//' -e 's/ .*//' \ + -e 's/^\.//' -e 's/^/./' |\ + awk '{ printf("%s", $1); }'`" + fi + fi + fi + fi + + # determine current time + time_day='' + time_month='' + time_year='' + time_monthname='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[DMYm]'`" != . ]; then + time_day=`date '+%d'` + time_month=`date '+%m'` + time_year=`date '+%Y' 2>/dev/null` + if [ ".$time_year" = . ]; then + time_year=`date '+%y'` + case $time_year in + [5-9][0-9]) time_year="19$time_year" ;; + [0-4][0-9]) time_year="20$time_year" ;; + esac + fi + case $time_month in + 1|01) time_monthname='Jan' ;; + 2|02) time_monthname='Feb' ;; + 3|03) time_monthname='Mar' ;; + 4|04) time_monthname='Apr' ;; + 5|05) time_monthname='May' ;; + 6|06) time_monthname='Jun' ;; + 7|07) time_monthname='Jul' ;; + 8|08) time_monthname='Aug' ;; + 9|09) time_monthname='Sep' ;; + 10) time_monthname='Oct' ;; + 11) time_monthname='Nov' ;; + 12) time_monthname='Dec' ;; + esac + fi + + # expand special ``%x'' constructs + if [ ".$opt_e" = .yes ]; then + text=`echo $seo "$text" |\ + sed -e "s/%B/${term_bold}/g" \ + -e "s/%b/${term_norm}/g" \ + -e "s/%u/${username}/g" \ + -e "s/%U/${userid}/g" \ + -e "s/%g/${groupname}/g" \ + -e "s/%G/${groupid}/g" \ + -e "s/%h/${hostname}/g" \ + -e "s/%d/${domainname}/g" \ + -e "s/%D/${time_day}/g" \ + -e "s/%M/${time_month}/g" \ + -e "s/%Y/${time_year}/g" \ + -e "s/%m/${time_monthname}/g" 2>/dev/null` + fi + + # create output + if [ .$opt_n = .no ]; then + echo $seo "$text" + else + # the harder part: echo -n is best, because + # awk may complain about some \xx sequences. + if [ ".$minusn" != . ]; then + echo $seo $minusn "$text" + else + echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" + fi + fi + + shtool_exit 0 + ;; + +install ) + ## + ## install -- Install a program, script or datafile + ## Copyright (c) 1997-2008 Ralf S. Engelschall + ## + + # special case: "shtool install -d [...]" internally + # maps to "shtool mkdir -f -p -m 755 [...]" + if [ "$opt_d" = yes ]; then + cmd="$0 mkdir -f -p -m 755" + if [ ".$opt_o" != . ]; then + cmd="$cmd -o '$opt_o'" + fi + if [ ".$opt_g" != . ]; then + cmd="$cmd -g '$opt_g'" + fi + if [ ".$opt_v" = .yes ]; then + cmd="$cmd -v" + fi + if [ ".$opt_t" = .yes ]; then + cmd="$cmd -t" + fi + for dir in "$@"; do + eval "$cmd $dir" || shtool_exit $? + done + shtool_exit 0 + fi + + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" + shift + done + dstpath="$1" + + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 + fi + + # consistency check for destination + if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 + shtool_exit 1 + fi + + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath + + # if destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" + fi + + # check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue + fi + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue + fi + + # make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # verbosity + if [ ".$opt_v" = .yes ]; then + echo "$src -> $dst" 1>&2 + fi + + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes + fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 + fi + cp "$src" "$dsttmp" || shtool_exit $? + else + if [ ".$opt_t" = .yes ]; then + echo "mv $src $dsttmp" 1>&2 + fi + mv "$src" "$dsttmp" || shtool_exit $? + fi + + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" + for e + do + sed="$sed -e '$e'" + done + cp "$dsttmp" "$dsttmp.old" + chmod u+w $dsttmp + eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $? + rm -f $dsttmp.old + fi + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 + fi + strip $dsttmp || shtool_exit $? + fi + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 + fi + chown $opt_o $dsttmp || shtool_exit $? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || shtool_exit $? + fi + if [ ".$opt_m" != ".-" ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || shtool_exit $? + fi + + # determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s "$src" "$dst"; then + quick=yes + fi + fi + fi + + # finally, install the file to the real destination + if [ $quick = yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dsttmp" 1>&2 + fi + rm -f $dsttmp + else + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst + fi + done + + shtool_exit 0 + ;; + +mkdir ) + ## + ## mkdir -- Make one or more directories + ## Copyright (c) 1996-2008 Ralf S. Engelschall + ## + + errstatus=0 + for p in ${1+"$@"}; do + # if the directory already exists... + if [ -d "$p" ]; then + if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + echo "$msgprefix:Error: directory already exists: $p" 1>&2 + errstatus=1 + break + else + continue + fi + fi + # if the directory has to be created... + if [ ".$opt_p" = .no ]; then + if [ ".$opt_t" = .yes ]; then + echo "mkdir $p" 1>&2 + fi + mkdir $p || errstatus=$? + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $p" 1>&2 + fi + chown $opt_o $p || errstatus=$? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $p" 1>&2 + fi + chgrp $opt_g $p || errstatus=$? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $p" 1>&2 + fi + chmod $opt_m $p || errstatus=$? + fi + else + # the smart situation + set fnord `echo ":$p" |\ + sed -e 's/^:\//%/' \ + -e 's/^://' \ + -e 's/\// /g' \ + -e 's/^%/\//'` + shift + pathcomp='' + for d in ${1+"$@"}; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp="./$pathcomp" ;; + esac + if [ ! -d "$pathcomp" ]; then + if [ ".$opt_t" = .yes ]; then + echo "mkdir $pathcomp" 1>&2 + fi + # See https://bugs.php.net/51076 + # The fix is from Debian who have sent it + # upstream, too; but upstream seems dead. + mkdir $pathcomp || { + _errstatus=$? + [ -d "$pathcomp" ] || errstatus=${_errstatus} + unset _errstatus + } + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $pathcomp" 1>&2 + fi + chown $opt_o $pathcomp || errstatus=$? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $pathcomp" 1>&2 + fi + chgrp $opt_g $pathcomp || errstatus=$? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $pathcomp" 1>&2 + fi + chmod $opt_m $pathcomp || errstatus=$? + fi + fi + pathcomp="$pathcomp/" + done + fi + done + + shtool_exit $errstatus + ;; + +platform ) + ## + ## platform -- Platform Identification Utility + ## Copyright (c) 2003-2008 Ralf S. Engelschall + ## + + # option post-processing + if [ ".$opt_t" != . ]; then + case "$opt_t" in + binary ) + # binary package id (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + build ) + # build time checking (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + gnu ) + # GNU config.guess style -- + opt_F="%-unknown-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + web ) + # non-whitespace HTTP Server-header id + opt_F="%-%" + opt_S="/" + opt_C="+" + ;; + summary) + # human readable verbose summary information + opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])" + opt_S=" " + opt_C="/" + ;; + all-in-one ) + # full-table all-in-one information + opt_F="" + opt_F="${opt_F}concise architecture class: %\\n" + opt_F="${opt_F}regular architecture class: %{ac}\\n" + opt_F="${opt_F}verbose architecture class: %[ac]\\n" + opt_F="${opt_F}concise architecture product: %\\n" + opt_F="${opt_F}regular architecture product: %{ap}\\n" + opt_F="${opt_F}verbose architecture product: %[ap]\\n" + opt_F="${opt_F}concise architecture technology: %\\n" + opt_F="${opt_F}regular architecture technology: %{at}\\n" + opt_F="${opt_F}verbose architecture technology: %[at]\\n" + opt_F="${opt_F}concise system class: %\\n" + opt_F="${opt_F}regular system class: %{sc}\\n" + opt_F="${opt_F}verbose system class: %[sc]\\n" + opt_F="${opt_F}concise system product: %\\n" + opt_F="${opt_F}regular system product: %{sp}\\n" + opt_F="${opt_F}verbose system product: %[sp]\\n" + opt_F="${opt_F}concise system technology: %\\n" + opt_F="${opt_F}regular system technology: %{st}\\n" + opt_F="${opt_F}verbose system technology: %[st]" + ;; + * ) + echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2 + exit 1 + ;; + esac + fi + + # assemble initial platform information + UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\ + UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\ + UNAME_MACHINE='unknown' + UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\ + UNAME_SYSTEM='unknown' + UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\ + UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\ + UNAME_RELEASE='unknown' + + UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}" + + AC=""; AP=""; AT="" + SC=""; SP=""; ST="" + + # dispatch into platform specific sections + case "${UNAME}" in + + # FreeBSD + *:FreeBSD:* ) + # determine architecture + AC="${UNAME_MACHINE}" + case "${AC}" in + i386 ) AC="iX86" ;; + esac + AP="${AC}" + AT="${AP}" + if [ ".${AT}" = ".iX86" ]; then + case "`(/sbin/sysctl -n hw.model) 2>&1`" in + *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;; + *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;; + *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;; + esac + fi + # determine system + r=`echo "${UNAME_RELEASE}" |\ + sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'` + ST="FreeBSD ${r}" + SP="${ST}" + case "${r}" in + 1.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; + esac + ;; + + # NetBSD + *:NetBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="NetBSD ${r}" + SP="${ST}" + case "${r}" in + 0.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; + esac + ;; + + # OpenBSD + *:OpenBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="OpenBSD ${r}" + SP="${ST}" + SC="4.4BSD" + ;; + + # DragonFly BSD + *:DragonFly:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="DragonFly ${r}" + SP="${ST}" + SC="4.4BSD" + ;; + + # GNU/Linux + *:Linux:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + x86_64 ) AT='AMD64' ;; + parisc ) AT="HPPA32" ;; + parisc64 ) AT="HPPA64" ;; + esac + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP='iX86' ;; + esac + AC="${AP}" + # determine system + v_kern=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` + v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\ + env -i sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null` + ST="GNU/${v_libc}/<${v_kern}>" + if [ -f /etc/lsb-release ]; then + eval `( . /etc/lsb-release + echo "SC=\"LSB${LSB_VERSION}\"" + if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then + echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\"" + fi + ) 2>/dev/null` + fi + if [ ".$SP" = . ]; then + for tagfile in x \ + `cd /etc && \ + /bin/ls *[_-]release *[_-]version 2>/dev/null | env -i sort | \ + sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \ + echo redhat-release lsb-release` + do + [ ".${tagfile}" = .x ] && continue + [ ! -f "/etc/${tagfile}" ] && continue + n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'` + v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$//'` + case "`util_lower ${n}`" in + redhat ) + if [ ".`egrep '(Red Hat Enterprise Linux|CentOS)' /etc/${tagfile}`" != . ]; then + n="ed at nterprise inux" + else + n="ed at inux" + fi + ;; + debian ) n="Debian[ GNU/Linux]" ;; + ubuntu ) n="Ubuntu[ GNU/Linux]" ;; + fedora ) n=" Core[ GNU/Linux]" ;; + suse ) n="[Novell ]SUSE[ Linux]" ;; + mandrake*|mandriva ) n="Mandriva[ Linux]" ;; + gentoo ) n="Gentoo[ GNU/Linux]" ;; + slackware ) n="Slackware[ Linux]" ;; + turbolinux ) n="TurboLinux" ;; + unitedlinux ) n="UnitedLinux" ;; + * ) n="${n}[ GNU/Linux]" ;; + esac + case "$n" in + *"<"*">"* ) SP="$n <$v>" ;; + * ) SP="$n $v" ;; + esac + break + done + fi + [ ".$SP" = . ] && SP="${ST}" + [ ".$SC" = . ] && SC="LSB" + ;; + + # Sun Solaris + *:SunOS:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i86pc ) + AT="iX86" + case "`(/bin/isainfo -k) 2>&1`" in + amd64 ) AT="AMD64" ;; + esac + ;; + esac + AP="${AT}" + case "${AP}" in + sun4[cdm] ) AP="SPARC32" ;; + sun4[uv] ) AP="SPARC64" ;; + sun4* ) AP="SPARC" ;; + esac + AC="${AP}" + case "${AC}" in + SPARC* ) AC="SPARC" ;; + esac + # determine system + ST="[Sun ]SunOS ${UNAME_RELEASE}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's;^4\.;1.;' \ + -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \ + -e 's;^5\.\([0-9][0-9]*\).*;\1;'` + SP="[Sun ]Solaris $v" + case "${UNAME_RELEASE}" in + 4.* ) SC="4.3BSD" ;; + 5.* ) SC="SVR4" ;; + esac + ;; + + # SCO UnixWare + *:UnixWare:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i[3-6]86 | ix86at ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v=`/sbin/uname -v` + ST="[SCO ]UnixWare ${v}" + SP="${ST}" + SC="SVR${UNAME_RELEASE}" + ;; + + # QNX + *:QNX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + x86pc ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v="${UNAME_RELEASE}" + ST="QNX[ Neutrino RTOS] ${v}" + v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'` + SP="QNX[ Neutrino RTOS] ${v}" + SC="QNX" + ;; + + # SGI IRIX + *:IRIX*:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}:${UNAME_SYSTEM}" in + IP*:IRIX64 ) AP="MIPS64" ;; + IP*:* ) AP="MIPS" ;; + esac + AC="${AP}" + # determine system + v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'` + ST="[SGI ]IRIX ${v}" + v="${UNAME_RELEASE}" + SP="[SGI ]IRIX ${v}" + SC="4.2BSD/SVR3" + ;; + + # HP HP-UX + *:HP-UX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + 9000/[34]?? ) AT=M68K ;; + 9000/[678][0-9][0-9]) + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523 ) AT="HPPA1.0" ;; + 528 ) AT="HPPA1.1" ;; + 532 ) AT="HPPA2.0" + case "${sc_kernel_bits}" in + 32 ) AT="${AT}n" ;; + 64 ) AT="${AT}w" ;; + esac + ;; + esac + ;; + esac + AP="${AT}" + case "${AP}" in + HPPA* ) AP="HPPA" ;; + esac + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'` + ST="[HP ]-" + SP="${ST}" + case "${v}" in + 10.* ) SC="SVR4.2" ;; + [7-9]* ) SC="SVR4" ;; + esac + ;; + + # HP Tru64 (OSF1) + *:OSF1:* ) + # determine architecture + AP="${UNAME_MACHINE}" + case "${AP}" in + alpha ) AP="Alpha" ;; + esac + alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\ + sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'` + AT="${AP}${alpha_type}" + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'` + ST="[HP ]Tru64 ${v}" + SP="${ST}" + SC="OSF1" + ;; + + # IBM AIX + *:AIX:* ) + # determine architecture + cpu_arch=RS6000 + if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then + cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then + cpu_arch=PPC + fi + elif [ -d /QOpenSys ]; then + # IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment) + cpu_arch=PPC + fi + if [ -x /usr/bin/oslevel ]; then + os_level=`/usr/bin/oslevel` + else + os_level="`uname -v`.`uname -r`" + fi + os_level=`echo "${os_level}" |\ + sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \ + -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'` + AT="${cpu_arch}" + AP="${AT}" + AC="${AP}" + # determine system + ST="[IBM ]${os_level}" + SP="${ST}" + case "${os_level}" in + [12]* ) SC="SVR2" ;; + * ) SC="SVR4" ;; + esac + ;; + + # Apple Mac OS X (Darwin) + *:Darwin:* ) + # determine architecture + AT="`uname -p`" + case "${AT}" in + powerpc ) AT="PPC" ;; + esac + AP="${AT}" + case "${AP}" in + i?86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + unset v1; unset v2; unset v3 + eval `echo "${UNAME_RELEASE}" |\ + sed -e 's/^/#/' \ + -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \ + -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \ + -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \ + -e 's/^#.*$/v1="0"/'` + ST="[Apple ]<${UNAME_SYSTEM} ${v1}>${v2+.$v2}${v3+[.$v3]}" + SP="$ST" + v="`(sw_vers) 2>/dev/null | grep 'ProductVersion:' | sed -e 's/^ProductVersion:[^0-9]*\([0-9][0-9.]*\).*$/\1/'`" + if [ ".$v" = . ]; then + for name in System Server; do + if [ -f /System/Library/CoreServices/${name}Version.plist ]; then + v=`(defaults read "/System/Library/CoreServices/${name}Version" "ProductVersion") 2>/dev/null` + [ ".$v" != . ] && break + fi + done + fi + if [ ".$v" != . ]; then + unset v1; unset v2; unset v3 + eval `echo "${v}" |\ + sed -e 's/^/#/' \ + -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \ + -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \ + -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \ + -e 's/^#.*$/v1="0"/'` + SP="[Apple ]Mac OS X ${v1}${v2+.$v2}${v3+[.$v3]}" + fi + SC="4.4BSD/Mach3.0" + ;; + + # Windows/Cygwin + *:CYGWIN*:* ) + # determine architecture + AT="`uname -m`" + AP="${AT}" + case "${AP}" in + i?86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + unset v1; unset v2; unset v3 + eval `echo "${UNAME_RELEASE}" |\ + sed -e 's/^/#/' \ + -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \ + -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \ + -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \ + -e 's/^#.*$/v1="0"/'` + ST="Cygwin ${v1}${v2+.$v2}${v3+[.$v3]}" + SP="$ST" + SC="Windows" + v=`echo "${UNAME_SYSTEM}" | sed -e 's/^CYGWIN_NT-//' |\ + sed -e 's/^/#/' -e 's/^#\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' -e 's/^#.*$//'` + case "$v" in + 4.0 ) SC="$SC[ NT]" ;; + 5.0 ) SC="$SC[ 2000]" ;; + 5.1 ) SC="$SC[ XP]" ;; + 6.0 ) SC="$SC[ Vista]" ;; + esac + ;; + + # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO + # *:XXX:* ) + # ... + # ;; + + # ...A STILL UNKNOWN PLATFORM... + * ) + AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"` + AP="${AT}" + AC="${AP}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$/?/'` + ST="${UNAME_SYSTEM} ${v}" + SP="${ST}" + SC="${SP}" + ;; + + esac + + # provide fallback values + [ ".$AT" = . ] && AT="${AP:-${AC}}" + [ ".$AP" = . ] && AP="${AT:-${AC}}" + [ ".$AC" = . ] && AC="${AP:-${AT}}" + [ ".$ST" = . ] && ST="${SP:-${SC}}" + [ ".$SP" = . ] && SP="${ST:-${SC}}" + [ ".$SC" = . ] && SC="${SP:-${ST}}" + + # support explicit enforced verbose/concise output + if [ ".$opt_v" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'` + elif [ ".$opt_c" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'` + fi + + # provide verbose and concise variants + AC_V=""; AC_N=""; AC_C="" + AP_V=""; AP_N=""; AP_C="" + AT_V=""; AT_N=""; AT_C="" + SC_V=""; SC_N=""; SC_C="" + SP_V=""; SP_N=""; SP_C="" + ST_V=""; ST_N=""; ST_C="" + for var_lc in at ap ac st sp sc; do + case "$opt_F" in + *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* ) + var_uc=`util_upper "$var_lc"` + eval "val=\"\$${var_uc}\"" + val_V=""; val_N=""; val_C="" + case "$opt_F" in + *"%[${var_lc}]"* ) + val_V=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];\1;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_V=\"\${val_V}\"" + ;; + esac + case "$opt_F" in + *"%{${var_lc}}"* | *"%${var_lc}"* ) + val_N=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_N=\"\${val_N}\"" + ;; + esac + case "$opt_F" in + *"%<${var_lc}>"* ) + val_C=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_C=\"\${val_C}\"" + ;; + esac + ;; + esac + done + + # create output string + output=`echo ":$opt_F" |\ + sed -e "s/^://" \ + -e "s;%\\[ac\\];${AC_V};g" \ + -e "s;%{ac};${AC_N};g" \ + -e "s;%ac;${AC_N};g" \ + -e "s;%;${AC_C};g" \ + -e "s;%\\[ap\\];${AP_V};g" \ + -e "s;%{ap};${AP_N};g" \ + -e "s;%ap;${AP_N};g" \ + -e "s;%;${AP_C};g" \ + -e "s;%\\[at\\];${AT_V};g" \ + -e "s;%{at};${AT_N};g" \ + -e "s;%at;${AT_N};g" \ + -e "s;%;${AT_C};g" \ + -e "s;%\\[sc\\];${SC_V};g" \ + -e "s;%{sc};${SC_N};g" \ + -e "s;%sc;${SC_N};g" \ + -e "s;%;${SC_C};g" \ + -e "s;%\\[sp\\];${SP_V};g" \ + -e "s;%{sp};${SP_N};g" \ + -e "s;%sp;${SP_N};g" \ + -e "s;%;${SP_C};g" \ + -e "s;%\\[st\\];${ST_V};g" \ + -e "s;%{st};${ST_N};g" \ + -e "s;%st;${ST_N};g" \ + -e "s;%;${ST_C};g" \ + -e 's/\\\\n/^/g' |\ + tr '^' '\012'` + + # support lower/upper-case mapping + if [ ".$opt_L" = .yes ]; then + output=`util_lower "$output"` + elif [ ".$opt_U" = .yes ]; then + output=`util_upper "$output"` + fi + + # display output string + if [ ".$opt_n" = .yes ]; then + echo . | awk '{ printf("%s", output); }' output="$output" + else + echo "$output" + fi + + shtool_exit 0 + ;; + +path ) + ## + ## path -- Deal with program paths + ## Copyright (c) 1998-2008 Ralf S. Engelschall + ## + + namelist="$*" + + # check whether the test command supports the -x option + if [ -x /bin/sh ] 2>/dev/null; then + minusx="-x" + else + minusx="-r" + fi + + # split path string + paths="`echo $opt_p |\ + sed -e 's/^:/.:/' \ + -e 's/::/:.:/g' \ + -e 's/:$/:./' \ + -e 's/:/ /g'`" + + # SPECIAL REQUEST + # translate forward to reverse path + if [ ".$opt_r" = .yes ]; then + if [ "x$namelist" = "x." ]; then + rp='.' + else + rp='' + for pe in `IFS="$IFS/"; echo $namelist`; do + rp="../$rp" + done + fi + echo $rp | sed -e 's:/$::' + shtool_exit 0 + fi + + # SPECIAL REQUEST + # strip out directory or base name + if [ ".$opt_d" = .yes ]; then + echo "$namelist" |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' + shtool_exit 0 + fi + if [ ".$opt_b" = .yes ]; then + echo "$namelist" |\ + sed -e 's;.*/\([^/]*\)$;\1;' + shtool_exit 0 + fi + + # MAGIC SITUATION + # Perl Interpreter (perl) + if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then + rm -f $tmpfile >/dev/null 2>&1 + touch $tmpfile + found=0 + pc=99 + for dir in $paths; do + dir=`echo $dir | sed -e 's;/*$;;'` + nc=99 + for name in perl perl5 miniperl; do + if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then + perl="$dir/$name" + pv=`$perl -e 'printf("%.3f", $]);'` + echo "$pv:$pc:$nc:$perl" >>$tmpfile + found=1 + fi + nc=`expr $nc - 1` + done + pc=`expr $pc - 1` + done + if [ $found = 1 ]; then + perl="`cat $tmpfile | sort -r -u | sed -e 'q' | cut -d: -f4`" + rm -f $tmpfile >/dev/null 2>&1 + echo "$perl" + shtool_exit 0 + fi + rm -f $tmpfile >/dev/null 2>&1 + shtool_exit 1 + fi + + # MAGIC SITUATION + # C pre-processor (cpp) + if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then + echo >$tmpfile.c "#include " + echo >>$tmpfile.c "Syntax Error" + # 1. try the standard cc -E approach + cpp="${CC-cc} -E" + (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out + my_error=`grep -v '^ *+' $tmpfile.out` + if [ ".$my_error" != . ]; then + # 2. try the cc -E approach and GCC's -traditional-ccp option + cpp="${CC-cc} -E -traditional-cpp" + (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out + my_error=`grep -v '^ *+' $tmpfile.out` + if [ ".$my_error" != . ]; then + # 3. try a standalone cpp command in path and lib dirs + for path in $paths /lib /usr/lib /usr/local/lib; do + path=`echo $path | sed -e 's;/*$;;'` + if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then + cpp="$path/cpp" + break + fi + done + if [ ".$cpp" != . ]; then + (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out + my_error=`grep -v '^ *+' $tmpfile.out` + if [ ".$my_error" != . ]; then + # ok, we gave up... + cpp='' + fi + fi + fi + fi + rm -f $tmpfile >/dev/null 2>&1 + rm -f $tmpfile.c $tmpfile.out >/dev/null 2>&1 + if [ ".$cpp" != . ]; then + echo "$cpp" + shtool_exit 0 + fi + shtool_exit 1 + fi + + # STANDARD SITUATION + # iterate over names + for name in $namelist; do + # iterate over paths + for path in $paths; do + path=`echo $path | sed -e 's;/*$;;'` + if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then + if [ ".$opt_s" != .yes ]; then + echo "$path/$name" + fi + shtool_exit 0 + fi + done + done + + shtool_exit 1 + ;; + +esac + +shtool_exit 0 + diff --git a/lib/php/extensions/no-debug-non-zts-20230831/opcache.so b/lib/php/extensions/no-debug-non-zts-20230831/opcache.so new file mode 100755 index 0000000..3467fe7 Binary files /dev/null and b/lib/php/extensions/no-debug-non-zts-20230831/opcache.so differ diff --git a/php/man/man1/phar.1 b/php/man/man1/phar.1 new file mode 100644 index 0000000..d000ceb --- /dev/null +++ b/php/man/man1/phar.1 @@ -0,0 +1,531 @@ +.TH PHAR 1 "2024" "The PHP Group" "User Commands" +.SH NAME +phar, phar.phar \- PHAR (PHP archive) command line tool +.SH SYNOPSIS +.B phar + [options] ... +.LP +.SH DESCRIPTION +The \fBPHAR\fP file format provides a way to put entire PHP applications into a single +file called a "phar" (PHP Archive) for easy distribution and installation. +.P +With the \fBphar\fP command you can create, update or extract PHP archives. +.P +Commands: +add compress delete extract help help-list info list meta-del +meta-get meta-set pack sign stub-get stub-set tree version + +.SH add command +Add entries to a PHAR package. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.TP +.PD +.B ... +Any number of input files and directories. If -i is in +use then ONLY files and matching the given regular +expression are being packed. If -x is given then files +matching that regular expression are NOT being packed. +.P +Optional arguments: +.TP 15 +.PD +.B \-a \fIalias\fP +Provide an \fIalias\fP name for the phar file. +.TP +.PD +.B \-c \fIalgo\fP +Compression algorithm (see +.SM +.B COMPRESSION +) +.TP +.PD +.B \-i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B \-l \fIlevel\fP +Number of preceding subdirectories to strip from file entries +.TP +.PD +.B \-x \fIregex\fP +Regular expression for input files to exclude. + +.SH compress command +Compress or uncompress all files or a selected entry. +.P +Required arguments: +.TP 15 +.PD +.B \-c \fIalgo\fP +Compression algorithm (see +.SM +.B COMPRESSION +) +.TP +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). + +.SH delete command +Delete entry from a PHAR archive +.P +Required arguments: +.TP 15 +.PD +.B \-e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). +.TP +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. + +.SH extract command +Extract a PHAR package to a directory. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B -x \fIregex\fP +Regular expression for input files to exclude. +.TP +.PD +.B ... +Directory to extract to (defaults to '.'). + + +.SH help command +This help or help for a selected command. +.P +Optional arguments: +.TP 15 +.PD +.B ... +Optional command to retrieve help for. + +.SH help-list command +Lists available commands. + +.SH info command +Get information about a PHAR package. +.P +By using -k it is possible to return a single value. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -k \fIindex\fP +Subscription \fIindex\fP to work on. + +.SH list command +List contents of a PHAR archive. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B -x \fIregex\fP +Regular expression for input files to exclude. + + +.SH meta-del command +Delete meta information of a PHAR entry or a PHAR package. +.P +If -k is given then the metadata is expected to be an array and the +given index is being deleted. +.P +If something was deleted the return value is 0 otherwise it is 1. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). +.TP +.PD +.B -k \fIindex\fP +Subscription \fIindex\fP to work on. + +.SH meta-get command +Get meta information of a PHAR entry or a PHAR package in serialized from. If +no output file is specified for meta data then stdout is being used. +You can also specify a particular index using -k. In that case the +metadata is expected to be an array and the value of the given index +is returned using echo rather than using serialize. If that index does +not exist or no meta data is present then the return value is 1. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B -e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). +.TP +.PD +.B -k \fIindex\fP +Subscription \fIindex\fP to work on. + +.SH meta-set command +Set meta data of a PHAR entry or a PHAR package using serialized input. If no +input file is specified for meta data then stdin is being used. You can +also specify a particular index using -k. In that case the metadata is +expected to be an array and the value of the given index is being set. +If the metadata is not present or empty a new array will be created. +If the metadata is present and a flat value then the return value is +1. Also using -k the input is been taken directly rather then being +serialized. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.TP +.PD +.B -m \fImeta\fP +Meta data to store with entry (serialized php data). +.P +Optional arguments: +.TP 15 +.PD +.B -e \fIentry\fP +Name of \fIentry\fP to work on (must include PHAR internal +directory name if any). +.TP +.PD +.B -k \fIindex\fP +Subscription \fIindex\fP to work on. + +.SH pack command +Pack files into a PHAR archive. +.P +When using -s , then the stub file is being excluded from the +list of input files/dirs.To create an archive that contains PEAR class +PHP_Archive then point -p argument to PHP/Archive.php. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.TP +.PD +.B ... +Any number of input files and directories. If -i is in +use then ONLY files and matching the given regular +expression are being packed. If -x is given then files +matching that regular expression are NOT being packed. +.P +Optional arguments: +.TP 15 +.PD +.B \-a \fIalias\fP +Provide an \fIalias\fP name for the phar file. +.TP +.PD +.B \-b \fIbang\fP +Hash-bang line to start the archive (e.g. #!/usr/bin/php). +The hash mark itself '#!' and the newline character are optional. +.TP +.PD +.B \-c \fIalgo\fP +Compression algorithm (see +.SM +.B COMPRESSION +) +.TP +.PD +.B \-h \fIhash\fP +Selects the \fIhash\fP algorithm (see +.SM +.B HASH +) +.TP +.PD +.B \-i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B \-l \fIlevel\fP +Number of preceding subdirectories to strip from file entries +.TP +.PD +.B \-p \fIloader\fP +Location of PHP_Archive class file (pear list-files +PHP_Archive).You can use '0' or '1' to locate it +automatically using the mentioned pear command. When +using '0' the command does not error out when the class +file cannot be located. This switch also adds some code +around the stub so that class PHP_Archive gets +registered as phar:// stream wrapper if necessary. And +finally this switch will add the file phar.inc from +this package and load it to ensure class Phar is +present. +.TP +.PD +.B \-s \fIstub\fP +Select the \fIstub\fP file. +.TP +.PD +.B \-x \fIregex\fP +Regular expression for input files to exclude. +.TP +.PD +.B \-y \fIkey\fP +Private \fIkey\fP for OpenSSL signing. + +.SH sign command +Set signature hash algorithm. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.TP +.PD +.B \-h \fIhash\fP +Selects the \fIhash\fP algorithm (see +.SM +.B HASH +) +.P +Optional arguments: +.TP 15 +.PD +.B \-y \fIkey\fP +Private \fIkey\fP for OpenSSL signing. + +.SH stub-get command +Get the stub of a PHAR file. If no output file is specified as stub then stdout +is being used. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B \-s \fIstub\fP +Select the \fIstub\fP file. + +.SH stub-set command +Set the stub of a PHAR file. If no input file is specified as stub then stdin +is being used. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B \-b \fIbang\fP +Hash-bang line to start the archive (e.g. #!/usr/bin/php). +The hash mark itself '#!' and the newline character are optional. +.TP +.PD +.B \-p \fIloader\fP +Location of PHP_Archive class file (pear list-files +PHP_Archive).You can use '0' or '1' to locate it +automatically using the mentioned pear command. When +using '0' the command does not error out when the class +file cannot be located. This switch also adds some code +around the stub so that class PHP_Archive gets +registered as phar:// stream wrapper if necessary. And +finally this switch will add the file phar.inc from +this package and load it to ensure class Phar is +present. +.TP +.PD +.B \-s \fIstub\fP +Select the \fIstub\fP file. + + +.SH tree command +Get a directory tree for a PHAR archive. +.P +Required arguments: +.TP 15 +.PD +.B -f \fIfile\fP +Specifies the phar \fIfile\fP to work on. +.P +Optional arguments: +.TP 15 +.PD +.B \-i \fIregex\fP +Specifies a regular expression for input files. +.TP +.PD +.B \-x \fIregex\fP +Regular expression for input files to exclude. + +.SH version command +Get information about the PHAR environment and the tool version. + + +.SH COMPRESSION +Algorithms: +.TP 15 +.PD +.B 0 +No compression +.TP +.PD +.B none +No compression +.TP +.PD +.B auto +Automatically select compression algorithm +.TP +.PD +.B gz +GZip compression +.TP +.PD +.B gzip +GZip compression +.TP +.PD +.B bz2 +BZip2 compression +.TP +.PD +.B bzip2 +BZip2 compression + +.SH HASH +Algorithms: +.TP 15 +.PD +.TP +.PD +.B md5 +MD5 +.TP +.PD +.B sha1 +SHA1 +.TP +.PD +.B sha256 +SHA256 +.TP +.PD +.B sha512 +SHA512 +.TP +.PD +.B openssl +OpenSSL using SHA-1 +.TP +.PD +.B openssl_sha256 +OpenSSL using SHA-256 +.TP +.PD +.B openssl_sha512 +OpenSSL using SHA-512 + +.SH SEE ALSO +For a more or less complete description of PHAR look here: +.PD 0 +.P +.B http://php.net/phar +.PD 1 +.P +.SH BUGS +You can view the list of known bugs or report any new bug you +found at: +.PD 0 +.P +.B https://github.com/php/php-src/issues +.PD 1 +.SH AUTHORS +The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski. +.P +Work for the PHP archive was done by Gregory Beaver, Marcus Boerger. +.P +A List of active developers can be found here: +.PD 0 +.P +.B http://www.php.net/credits.php +.PD 1 +.P +And last but not least PHP was developed with the help of a huge amount of +contributors all around the world. +.SH VERSION INFORMATION +This manpage describes \fBphar\fP, version 8.3.3-dev. +.SH COPYRIGHT +Copyright \(co The PHP Group +.LP +This source file is subject to version 3.01 of the PHP license, +that is bundled with this package in the file LICENSE, and is +available through the world-wide-web at the following url: +.PD 0 +.P +.B https://www.php.net/license/3_01.txt +.PD 1 +.P +If you did not receive a copy of the PHP license and are unable to +obtain it through the world-wide-web, please send a note to +.B license@php.net +so we can mail you a copy immediately. diff --git a/php/man/man1/phar.phar.1 b/php/man/man1/phar.phar.1 new file mode 100644 index 0000000..b5eecbf --- /dev/null +++ b/php/man/man1/phar.phar.1 @@ -0,0 +1 @@ +.so man1/phar.1 diff --git a/php/man/man1/php-cgi.1 b/php/man/man1/php-cgi.1 new file mode 100644 index 0000000..340e6c5 --- /dev/null +++ b/php/man/man1/php-cgi.1 @@ -0,0 +1 @@ +.so man1/php.1 diff --git a/php/man/man1/php-config.1 b/php/man/man1/php-config.1 new file mode 100644 index 0000000..982fb6e --- /dev/null +++ b/php/man/man1/php-config.1 @@ -0,0 +1,81 @@ +.TH php\-config 1 "2024" "The PHP Group" "Scripting Language" +.SH NAME +php\-config \- get information about PHP configuration and compile options +.SH SYNOPSIS +.B php\-config +[options] +.LP +.SH DESCRIPTION +.B php\-config +is a simple shell script for obtaining information about installed PHP configuration. +.SH OPTIONS +.TP 15 +.PD 0 +.B \-\-prefix +Directory prefix where PHP is installed, e.g. /usr/local +.TP +.PD 0 +.B \-\-includes +List of \-I options with all include files +.TP +.PD 0 +.B \-\-ldflags +LD Flags which PHP was compiled with +.TP +.PD 0 +.B \-\-libs +Extra libraries which PHP was compiled with +.TP +.PD 0 +.B \-\-man-dir +The directory prefix where the manpages is installed +.TP +.PD 0 +.B \-\-extension-dir +Directory where extensions are searched by default +.TP +.PD 0 +.B \-\-include-dir +Directory prefix where header files are installed by default +.TP +.PD 0 +.B \-\-php-binary +Full path to php CLI or CGI binary +.TP +.PD 0 +.B \-\-php-sapis +Show all SAPI modules available +.TP +.PD 0 +.B \-\-configure-options +Configure options to recreate configuration of current PHP installation +.TP +.PD 0 +.B \-\-version +PHP version +.TP +.PD 0 +.B \-\-vernum +PHP version as integer +.RS +.PD 1 +.P +.SH SEE ALSO +.BR php (1) +.SH VERSION INFORMATION +This manpage describes \fBphp\fP, version 8.3.3-dev. +.SH COPYRIGHT +Copyright \(co The PHP Group +.LP +This source file is subject to version 3.01 of the PHP license, +that is bundled with this package in the file LICENSE, and is +available through the world-wide-web at the following url: +.PD 0 +.P +.B https://www.php.net/license/3_01.txt +.PD 1 +.P +If you did not receive a copy of the PHP license and are unable to +obtain it through the world-wide-web, please send a note to +.B license@php.net +so we can mail you a copy immediately. diff --git a/php/man/man1/php.1 b/php/man/man1/php.1 new file mode 100644 index 0000000..86165ab --- /dev/null +++ b/php/man/man1/php.1 @@ -0,0 +1,479 @@ +.TH php 1 "2024" "The PHP Group" "Scripting Language" +.SH NAME +php \- PHP Command Line Interface 'CLI' +.P +php-cgi \- PHP Common Gateway Interface 'CGI' command +.SH SYNOPSIS +.B php +[options] [ +.B \-f\fP ] +.IR file +[[\-\-] +.IR args.\|.\|. ] +.LP +.B php +[options] +.B \-r +.IR code +[[\-\-] +.IR args.\|.\|. ] +.LP +.B php +[options] [\-B +.IR begin_code ] +.B \-R +.IR code +[\-E +.IR end_code ] +[[\-\-] +.IR args.\|.\|. ] +.LP +.B php +[options] [\-B +.IR begin_code ] +.B \-F +.IR file +[\-E +.IR end_code ] +[[\-\-] +.IR args.\|.\|. ] +.LP +.B php +[options] \-\- [ +.IR args.\|.\|. ] +.LP +\fBphp \fP[options] \fB\-a\fP +.LP +.B php +[options] \-S +.IR addr:port +[\-t +.IR docroot ] +.LP +.SH DESCRIPTION +\fBPHP\fP is a widely\-used general\-purpose scripting language that is especially suited for +Web development and can be embedded into HTML. This is the command line interface +that enables you to do the following: +.P +You can parse and execute files by using parameter \-f followed by the name of the +.IR file +to be executed. +.LP +Using parameter \-r you can directly execute PHP +.IR code +simply as you would do inside a +.B \.php +file when using the +.B eval() +function. +.LP +It is also possible to process the standard input line by line using either +the parameter \-R or \-F. In this mode each separate input line causes the +.IR code +specified by \-R or the +.IR file +specified by \-F to be executed. +You can access the input line by \fB$argn\fP. While processing the input lines +.B $argi +contains the number of the actual line being processed. Further more +the parameters \-B and \-E can be used to execute +.IR code +(see \-r) before and +after all input lines have been processed respectively. Notice that the +input is read from +.B STDIN +and therefore reading from +.B STDIN +explicitly changes the next input line or skips input lines. +.LP +PHP also contains an built-in web server for application development purpose. By using the \-S option where +.B addr:port +point to a local address and port PHP will listen to HTTP requests on that address and port and serve files from the current working directory or the +.B docroot +passed by the \-t option. +.LP +If a PHP file is provided to the command line when the +built-in web server is used, it will be used as the router script. This script +will be started at each HTTP request. The script output is returned to the +browser, unless the router script returns the +.B false +value. If so, the built-in server falls back to the default behaviour, returning +the requested resource as-is by looking up the files relative to the document +root specified by the \-t option, if provided. +.LP +If none of \-r \-f \-B \-R \-F \-E or \-S is present but a single parameter is given +then this parameter is taken as the filename to parse and execute (same as +with \-f). If no parameter is present then the standard input is read and +executed. +.SH OPTIONS +.TP 15 +.PD 0 +.B \-\-interactive +.TP +.PD 1 +.B \-a +Run PHP interactively. This lets you enter snippets of PHP code that directly +get executed. When readline support is enabled you can edit the lines and also +have history support. +.TP +.PD 0 +.B \-\-bindpath \fIaddress:port\fP|\fIport\fP +.TP +.PD 1 +.B \-b \fIaddress:port\fP|\fIport\fP +Bind Path for external FASTCGI Server mode (CGI only). +.TP +.PD 0 +.B \-\-no\-chdir +.TP +.PD 1 +.B \-C +Do not chdir to the script's directory (CGI only). +.TP +.PD 0 +.B \-\-no\-header +.TP +.PD 1 +.B \-q +Quiet-mode. Suppress HTTP header output (CGI only). +.TP +.PD 0 +.B \-\-timing \fIcount\fP +.TP +.PD 1 +.B \-T \fIcount\fP +Measure execution time of script repeated count times (CGI only). +.TP +.PD 0 +.B \-\-php\-ini \fIpath\fP|\fIfile\fP +.TP +.PD 1 +.B \-c \fIpath\fP|\fIfile\fP +Look for +.B php.ini +file in the directory +.IR path +or use the specified +.IR file +.TP +.PD 0 +.B \-\-no\-php\-ini +.TP +.PD 1 +.B \-n +No +.B php.ini +file will be used +.TP +.PD 0 +.B \-\-define \fIfoo\fP[=\fIbar\fP] +.TP +.PD 1 +.B \-d \fIfoo\fP[=\fIbar\fP] +Define INI entry +.IR foo +with value +.IR bar +.TP +.B \-e +Generate extended information for debugger/profiler +.TP +.PD 0 +.B \-\-file \fIfile\fP +.TP +.PD 1 +.B \-f \fIfile\fP +Parse and execute +.IR file +.TP +.PD 0 +.B \-\-help +.TP +.PD 1 +.B \-h +This help +.TP +.PD 0 +.B \-\-hide\-args +.TP +.PD 1 +.B \-H +Hide script name (\fIfile\fP) and parameters (\fIargs\.\.\.\fP) from external +tools. For example you may want to use this when a php script is started as +a daemon and the command line contains sensitive data such as passwords. +.TP +.PD 0 +.B \-\-info +.TP +.PD 1 +.B \-i +PHP information and configuration +.TP +.PD 0 +.B \-\-syntax\-check +.TP +.PD 1 +.B \-l +Syntax check only (lint) +.TP +.PD 0 +.B \-\-modules +.TP +.PD 1 +.B \-m +Show compiled in modules +.TP +.PD 0 +.B \-\-run \fIcode\fP +.TP +.PD 1 +.B \-r \fIcode\fP +Run PHP +.IR code +without using script tags +.B '' +.TP +.PD 0 +.B \-\-process\-begin \fIcode\fP +.TP +.PD 1 +.B \-B \fIbegin_code\fP +Run PHP +.IR begin_code +before processing input lines +.TP +.PD 0 +.B \-\-process\-code \fIcode\fP +.TP +.PD 1 +.B \-R \fIcode\fP +Run PHP +.IR code +for every input line +.TP +.PD 0 +.B \-\-process\-file \fIfile\fP +.TP +.PD 1 +.B \-F \fIfile\fP +Parse and execute +.IR file +for every input line +.TP +.PD 0 +.B \-\-process\-end \fIcode\fP +.TP +.PD 1 +.B \-E \fIend_code\fP +Run PHP +.IR end_code +after processing all input lines +.TP +.PD 0 +.B \-\-syntax\-highlight +.TP +.PD 1 +.B \-s +Output HTML syntax highlighted source +.TP +.PD 0 +.B \-\-server \fIaddr:port\fP +.TP +.PD 1 +.B \-S \fIaddr:port\fP +Start built-in web server on the given local address and port +.TP +.PD 0 +.B \-\-docroot \fIdocroot\fP +.TP +.PD 1 +.B \-t \fIdocroot\fP +Specify the document root to be used by the built-in web server +.TP +.PD 0 +.B \-\-version +.TP +.PD 1 +.B \-v +Version number +.TP +.PD 0 +.B \-\-strip +.TP +.PD 1 +.B \-w +Output source with stripped comments and whitespace +.TP +.PD 0 +.B \-\-zend\-extension \fIfile\fP +.TP +.PD 1 +.B \-z \fIfile\fP +Load Zend extension +.IR file +.TP +.IR args.\|.\|. +Arguments passed to script. Use +.B '\-\-' +.IR args +when first argument starts with +.B '\-' +or script is read from stdin +.TP +.PD 0 +.B \-\-rfunction +.IR name +.TP +.PD 1 +.B \-\-rf +.IR name +Shows information about function +.B name +.TP +.PD 0 +.B \-\-rclass +.IR name +.TP +.PD 1 +.B \-\-rc +.IR name +Shows information about class +.B name +.TP +.PD 0 +.B \-\-rextension +.IR name +.TP +.PD 1 +.B \-\-re +.IR name +Shows information about extension +.B name +.TP +.PD 0 +.B \-\-rzendextension +.IR name +.TP +.PD 1 +.B \-\-rz +.IR name +Shows information about Zend extension +.B name +.TP +.PD 0 +.B \-\-rextinfo +.IR name +.TP +.PD 1 +.B \-\-ri +.IR name +Shows configuration for extension +.B name +.TP +.B \-\-ini +Show configuration file names +.SH FILES +.TP 15 +.B php\-cli.ini +The configuration file for the CLI version of PHP. +.TP +.B php.ini +The standard configuration file will only be used when +.B php\-cli.ini +cannot be found. +.SH EXAMPLES +.TP 5 +\fIphp \-r 'echo "Hello World\\n";'\fP +This command simply writes the text "Hello World" to standard out. +.TP +\fIphp \-r 'print_r(gd_info());'\fP +This shows the configuration of your gd extension. You can use this +to easily check which image formats you can use. If you have any +dynamic modules you may want to use the same ini file that php uses +when executed from your webserver. There are more extensions which +have such a function. For dba use: +.RS +\fIphp \-r 'print_r(dba_handlers(1));'\fP +.RE +.TP +\fIphp \-R 'echo strip_tags($argn)."\\n";'\fP +This PHP command strips off the HTML tags line by line and outputs the +result. To see how it works you can first look at the following PHP command +\'\fIphp \-d html_errors=1 \-i\fP\' which uses PHP to output HTML formatted +configuration information. If you then combine those two +\'\fIphp \.\.\.|php \.\.\.\fP\' you'll see what happens. +.TP +\fIphp \-E 'echo "Lines: $argi\\n";'\fP +Using this PHP command you can count the lines being input. +.TP +\fIphp \-R '@$l+=count(file($argn));' \-E 'echo "Lines:$l\\n";'\fP +In this example PHP expects each input line being a file. It counts all lines +of the files specified by each input line and shows the summarized result. +You may combine this with tools like find and change the php scriptlet. +.TP +\fIphp \-R 'echo "$argn\\n"; fgets(STDIN);'\fP +Since you have access to STDIN from within \-B \-R \-F and \-E you can skip +certain input lines with your code. But note that in such cases $argi only +counts the lines being processed by php itself. Having read this you will +guess what the above program does: skipping every second input line. +.SH TIPS +You can use a shebang line to automatically invoke php +from scripts. Only the CLI version of PHP will ignore +such a first line as shown below: +.P +.PD 0 +.RS +#!/bin/php +.P + +.RE +.PD 1 +.P +.SH SEE ALSO +For a more or less complete description of PHP look here: +.PD 0 +.P +.B http://www.php.net/manual/ +.PD 1 +.P +.SH BUGS +You can view the list of known bugs or report any new bug you +found at: +.PD 0 +.P +.B https://github.com/php/php-src/issues +.PD 1 +.SH AUTHORS +The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski. +.P +Additional work for the CLI sapi was done by Edin Kadribasic, Marcus Boerger and Johannes Schlueter. +.P +A List of active developers can be found here: +.PD 0 +.P +.B http://www.php.net/credits.php +.PD 1 +.P +And last but not least PHP was developed with the help of a huge amount of +contributors all around the world. +.SH VERSION INFORMATION +This manpage describes \fBphp\fP, version 8.3.3-dev. +.SH COPYRIGHT +Copyright \(co The PHP Group +.LP +This source file is subject to version 3.01 of the PHP license, +that is bundled with this package in the file LICENSE, and is +available through the world-wide-web at the following url: +.PD 0 +.P +.B https://www.php.net/license/3_01.txt +.PD 1 +.P +If you did not receive a copy of the PHP license and are unable to +obtain it through the world-wide-web, please send a note to +.B license@php.net +so we can mail you a copy immediately. diff --git a/php/man/man1/phpdbg.1 b/php/man/man1/phpdbg.1 new file mode 100644 index 0000000..b8807cc --- /dev/null +++ b/php/man/man1/phpdbg.1 @@ -0,0 +1,137 @@ +.TH phpdbg 1 "2024" "The PHP Group" "Scripting Language" +.SH NAME +phpdbg \- The interactive PHP debugger +.SH SYNOPSIS +.B phpdbg +[options] +[\fIfile\fP] +[\fIargs...\fP] +.SH DESCRIPTION +.B phpdbg +is a lightweight, powerful, easy to use debugging platform for PHP. +.SH OPTIONS +.TP 15 +.B \-c \fIpath\fB|\fIfile\fR +Look for +.B php.ini +file in the directory +.IR path +or use the specified +.IR file +.TP +.B \-d \fIfoo\fP[=\fIbar\fP] +Define INI entry +.IR foo +with value +.IR bar +.TP +.B \-n +No +.B php.ini +file will be used +.TP +.B \-z \fIfile\fR +Load Zend extension +.IR file +.TP +.BR \-q +Do not print banner on startup +.TP +.B \-v +Enable oplog output +.TP +.B \-b +Disables use of color on the console +.TP +.B \-i \fIpath\fB|\fIfile\fR +Override .phpgdbinit location (implies -I) +.TP +.B \-I +Ignore .phpdbginit (default init file) +.TP +.B \-r +Jump straight to run +.TP +.B -e +Generate extended information for debugger/profiler +.TP +.B \-E +Enable step through eval() +.TP +.B \-s \fIdelimiter\fP +Read code to execute from stdin with an optional +.IR delimiter +.TP +.B \-S \fIsapi_name\fP +Override SAPI name +.TP +.B \-p \fIopcode\fP +Output opcodes and quit +.TP +.B \-h +Print the help overview +.TP +.B \-V +Version number +.TP +.IR args.\|.\|. +Arguments passed to script. Use +.B '\-\-' +.IR args +when first argument starts with +.B '\-' +or script is read from stdin +.SH NOTES +Passing +.B \-rr +will cause +.B phpdbg +to quit after execution, rather than returning to the console +.SH FILES +.TP 15 +.B php.ini +The standard configuration file +.TP +.B .phpdbginit +The init file +.SH SEE ALSO +The online manual can be found at +.PD 0 +.P +.B http://php.net/manual/book.phpdbg.php +.PD 1 +.SH BUGS +You can view the list of known bugs or report any new bug you +found at +.PD 0 +.P +.B https://github.com/php/php-src/issues +.PD 1 +.SH AUTHORS +Written by Felipe Pena, Joe Watkins and Bob Weinand, formatted by OndÅ™ej Surý for Debian project. +.P +A List of active developers can be found at +.PD 0 +.P +.B http://www.php.net/credits.php +.PD 1 +.P +And last but not least PHP was developed with the help of a huge amount of +contributors all around the world. +.SH VERSION INFORMATION +This manpage describes \fBphpdbg\fP, for PHP version 8.3.3-dev. +.SH COPYRIGHT +Copyright \(co The PHP Group +.LP +This source file is subject to version 3.01 of the PHP license, +that is bundled with this package in the file LICENSE, and is +available through the world-wide-web at the following url: +.PD 0 +.P +.B https://www.php.net/license/3_01.txt +.PD 1 +.P +If you did not receive a copy of the PHP license and are unable to +obtain it through the world-wide-web, please send a note to +.B license@php.net +so we can mail you a copy immediately. diff --git a/php/man/man1/phpize.1 b/php/man/man1/phpize.1 new file mode 100644 index 0000000..93ae725 --- /dev/null +++ b/php/man/man1/phpize.1 @@ -0,0 +1,48 @@ +.TH phpize 1 "2024" "The PHP Group" "Scripting Language" +.SH NAME +phpize \- prepare a PHP extension for compiling +.SH SYNOPSIS +.B phpize +[options] +.LP +.SH DESCRIPTION +.B phpize +is a shell script to prepare PHP extension for compiling. +.SH OPTIONS +.TP 15 +.PD 0 +.B \-\-clean +Remove all created files +.TP +.PD 0 +.B \-\-help +Prints usage information +.TP +.PD 0 +.B \-\-version +.TP +.PD 1 +.B \-v +Prints API version information +.RS +.PD 1 +.P +.SH SEE ALSO +.BR php (1) +.SH VERSION INFORMATION +This manpage describes \fBphp\fP, version 8.3.3-dev. +.SH COPYRIGHT +Copyright \(co The PHP Group +.LP +This source file is subject to version 3.01 of the PHP license, +that is bundled with this package in the file LICENSE, and is +available through the world-wide-web at the following url: +.PD 0 +.P +.B https://www.php.net/license/3_01.txt +.PD 1 +.P +If you did not receive a copy of the PHP license and are unable to +obtain it through the world-wide-web, please send a note to +.B license@php.net +so we can mail you a copy immediately.