GIF89a; EcchiShell v1.0
//opt/remi/php70/root/usr/include/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_destroy(void); ZEND_API void* zend_vm_stack_extend(size_t size); 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, zend_class_entry *called_scope, zend_object *object) { 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_SET_CALL_INFO(call, call_info | ZEND_CALL_ALLOCATED); } else { EG(vm_stack_top) = (zval*)((char*)call + used_stack); ZEND_SET_CALL_INFO(call, call_info); } ZEND_ASSERT_VM_STACK_GLOBAL; call->func = func; Z_OBJ(call->This) = object; ZEND_CALL_NUM_ARGS(call) = num_args; call->called_scope = 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; if (EXPECTED(ZEND_USER_CODE(func->type))) { used_stack += func->op_array.last_var + func->op_array.T - 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, zend_class_entry *called_scope, zend_object *object) { 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, called_scope, object); } 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)) { zval *end = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T); zval *p = end + (ZEND_CALL_NUM_ARGS(call) - call->func->op_array.num_args); do { p--; if (Z_REFCOUNTED_P(p)) { if (!Z_DELREF_P(p)) { zend_refcounted *r = Z_COUNTED_P(p); ZVAL_NULL(p); zval_dtor_func_for_ptr(r); } else { GC_ZVAL_CHECK_POSSIBLE_ROOT(p); } } } while (p != end); } } 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 *end = ZEND_CALL_ARG(call, 1); zval *p = end + num_args; do { p--; if (Z_REFCOUNTED_P(p)) { if (!Z_DELREF_P(p)) { zend_refcounted *r = Z_COUNTED_P(p); ZVAL_NULL(p); zval_dtor_func_for_ptr(r); } } } while (p != end); } } 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; 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); } /* 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 *zend_get_executed_filename(void); ZEND_API zend_string *zend_get_executed_filename_ex(void); ZEND_API uint zend_get_executed_lineno(void); ZEND_API zend_bool zend_is_executing(void); ZEND_API void zend_set_timeout(zend_long seconds, int reset_signals); ZEND_API void zend_unset_timeout(void); ZEND_API void zend_timeout(int dummy); ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type); ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type); void zend_verify_abstract_class(zend_class_entry *ce); ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim); ZEND_API void zend_fetch_dimension_by_zval_is(zval *result, zval *container, zval *dim, int dim_type); ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var); #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 int zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler); ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode); /* former zend_execute_locks.h */ typedef zval* zend_free_op; ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type); ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table); void zend_free_compiled_variables(zend_execute_data *execute_data); void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num); #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 SKIP_EXT_OPLINE(opline) do { \ while (UNEXPECTED((opline)->opcode >= ZEND_EXT_STMT \ && (opline)->opcode <= ZEND_TICKS)) { \ (opline)--; \ } \ } while (0) END_EXTERN_C() #endif /* ZEND_EXECUTE_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: t * End: */