PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - Zend - zend_execute.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 629 719 87.5 %
Date: 2014-10-14 Functions: 29 37 78.4 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | Zend Engine                                                          |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
       6             :    +----------------------------------------------------------------------+
       7             :    | This source file is subject to version 2.00 of the Zend license,     |
       8             :    | that is bundled with this package in the file LICENSE, and is        |
       9             :    | available through the world-wide-web at the following url:           |
      10             :    | http://www.zend.com/license/2_00.txt.                                |
      11             :    | If you did not receive a copy of the Zend license and are unable to  |
      12             :    | obtain it through the world-wide-web, please send a note to          |
      13             :    | license@zend.com so we can mail you a copy immediately.              |
      14             :    +----------------------------------------------------------------------+
      15             :    | Authors: Andi Gutmans <andi@zend.com>                                |
      16             :    |          Zeev Suraski <zeev@zend.com>                                |
      17             :    +----------------------------------------------------------------------+
      18             : */
      19             : 
      20             : /* $Id$ */
      21             : 
      22             : #define ZEND_INTENSIVE_DEBUGGING 0
      23             : 
      24             : #include <stdio.h>
      25             : #include <signal.h>
      26             : 
      27             : #include "zend.h"
      28             : #include "zend_compile.h"
      29             : #include "zend_execute.h"
      30             : #include "zend_API.h"
      31             : #include "zend_ptr_stack.h"
      32             : #include "zend_constants.h"
      33             : #include "zend_extensions.h"
      34             : #include "zend_ini.h"
      35             : #include "zend_exceptions.h"
      36             : #include "zend_interfaces.h"
      37             : #include "zend_closures.h"
      38             : #include "zend_generators.h"
      39             : #include "zend_vm.h"
      40             : #include "zend_dtrace.h"
      41             : #include "zend_inheritance.h"
      42             : 
      43             : /* Virtual current working directory support */
      44             : #include "zend_virtual_cwd.h"
      45             : 
      46             : #define _CONST_CODE  0
      47             : #define _TMP_CODE    1
      48             : #define _VAR_CODE    2
      49             : #define _UNUSED_CODE 3
      50             : #define _CV_CODE     4
      51             : 
      52             : typedef int (*incdec_t)(zval *);
      53             : 
      54             : #define get_zval_ptr(op_type, node, ex, should_free, type) _get_zval_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
      55             : #define get_zval_ptr_deref(op_type, node, ex, should_free, type) _get_zval_ptr_deref(op_type, node, ex, should_free, type TSRMLS_CC)
      56             : #define get_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
      57             : #define get_zval_ptr_ptr_undef(op_type, node, ex, should_free, type) _get_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
      58             : #define get_obj_zval_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
      59             : #define get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
      60             : 
      61             : /* Prototypes */
      62             : static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
      63             : static void zend_extension_fcall_begin_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
      64             : static void zend_extension_fcall_end_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
      65             : 
      66             : #define RETURN_VALUE_USED(opline) (!((opline)->result_type & EXT_TYPE_UNUSED))
      67             : 
      68          71 : static ZEND_FUNCTION(pass)
      69             : {
      70          71 : }
      71             : 
      72             : static const zend_internal_function zend_pass_function = {
      73             :         ZEND_INTERNAL_FUNCTION, /* type              */
      74             :         0,                      /* fn_flags          */
      75             :         NULL,                   /* name              */
      76             :         NULL,                   /* scope             */
      77             :         NULL,                   /* prototype         */
      78             :         0,                      /* num_args          */
      79             :         0,                      /* required_num_args */
      80             :         NULL,                   /* arg_info          */
      81             :         ZEND_FN(pass),          /* handler           */
      82             :         NULL                    /* module            */
      83             : };
      84             : 
      85             : #undef zval_ptr_dtor
      86             : #define zval_ptr_dtor(zv) i_zval_ptr_dtor(zv ZEND_FILE_LINE_CC TSRMLS_CC)
      87             : 
      88             : #define PZVAL_LOCK(z) if (Z_REFCOUNTED_P(z)) Z_ADDREF_P((z))
      89             : #define SELECTIVE_PZVAL_LOCK(pzv, opline)       if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(pzv); }
      90             : 
      91             : #define READY_TO_DESTROY(zv) \
      92             :         (zv && Z_REFCOUNTED_P(zv) && Z_REFCOUNT_P(zv) == 1)
      93             : 
      94             : #define EXTRACT_ZVAL_PTR(zv) do {                                               \
      95             :                 zval *__zv = (zv);                                                              \
      96             :                 if (Z_TYPE_P(__zv) == IS_INDIRECT) {                    \
      97             :                         ZVAL_COPY(__zv, Z_INDIRECT_P(__zv));            \
      98             :                 }                                                                                               \
      99             :         } while (0)
     100             : 
     101             : #define FREE_OP(should_free) \
     102             :         if (should_free.var) { \
     103             :                 zval_ptr_dtor_nogc(should_free.var); \
     104             :         }
     105             : 
     106             : #define FREE_OP_VAR_PTR(should_free) \
     107             :         if (should_free.var) { \
     108             :                 zval_ptr_dtor_nogc(should_free.var); \
     109             :         }
     110             : 
     111             : /* End of zend_execute_locks.h */
     112             : 
     113             : #define CV_DEF_OF(i) (EX(func)->op_array.vars[i])
     114             : 
     115             : #define CTOR_CALL_BIT    0x1
     116             : #define CTOR_USED_BIT    0x2
     117             : 
     118             : #define IS_CTOR_CALL(ce) (((zend_uintptr_t)(ce)) & CTOR_CALL_BIT)
     119             : #define IS_CTOR_USED(ce) (((zend_uintptr_t)(ce)) & CTOR_USED_BIT)
     120             : 
     121             : #define ENCODE_CTOR(ce, used) \
     122             :         ((zend_class_entry*)(((zend_uintptr_t)(ce)) | CTOR_CALL_BIT | ((used) ? CTOR_USED_BIT : 0)))
     123             : #define DECODE_CTOR(ce) \
     124             :         ((zend_class_entry*)(((zend_uintptr_t)(ce)) & ~(CTOR_CALL_BIT|CTOR_USED_BIT)))
     125             : 
     126             : #define ZEND_VM_STACK_PAGE_SLOTS (16 * 1024) /* should be a power of 2 */
     127             : 
     128             : #define ZEND_VM_STACK_PAGE_SIZE  (ZEND_VM_STACK_PAGE_SLOTS * sizeof(zval))
     129             : 
     130             : #define ZEND_VM_STACK_FREE_PAGE_SIZE \
     131             :         ((ZEND_VM_STACK_PAGE_SLOTS - ZEND_VM_STACK_HEADER_SLOTS) * sizeof(zval))
     132             : 
     133             : #define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size) \
     134             :         (((size) + (ZEND_VM_STACK_FREE_PAGE_SIZE - 1)) & ~ZEND_VM_STACK_PAGE_SIZE)
     135             : 
     136             : static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
     137       20447 :         zend_vm_stack page = (zend_vm_stack)emalloc(size);
     138             : 
     139       20447 :         page->top = ZEND_VM_STACK_ELEMETS(page);
     140       20447 :         page->end = (zval*)((char*)page + size);
     141       20447 :         page->prev = prev;
     142       20447 :         return page;
     143             : }
     144             : 
     145       20358 : ZEND_API void zend_vm_stack_init(TSRMLS_D)
     146             : {
     147       20358 :         EG(vm_stack) = zend_vm_stack_new_page(ZEND_VM_STACK_PAGE_SIZE, NULL);
     148       20358 :         EG(vm_stack)->top++;
     149       20358 :         EG(vm_stack_top) = EG(vm_stack)->top;
     150       20358 :         EG(vm_stack_end) = EG(vm_stack)->end;
     151       20358 : }
     152             : 
     153       20394 : ZEND_API void zend_vm_stack_destroy(TSRMLS_D)
     154             : {
     155       20394 :         zend_vm_stack stack = EG(vm_stack);
     156             : 
     157       61182 :         while (stack != NULL) {
     158       20394 :                 zend_vm_stack p = stack->prev;
     159       20394 :                 efree(stack);
     160       20394 :                 stack = p;
     161             :         }
     162       20394 : }
     163             : 
     164           7 : ZEND_API void* zend_vm_stack_extend(size_t size TSRMLS_DC)
     165             : {
     166             :     zend_vm_stack stack;
     167             :     void *ptr;
     168             : 
     169           7 :     stack = EG(vm_stack);
     170           7 :     stack->top = EG(vm_stack_top);
     171          20 :         EG(vm_stack) = stack = zend_vm_stack_new_page(
     172           7 :                 EXPECTED(size < ZEND_VM_STACK_FREE_PAGE_SIZE) ?
     173           6 :                         ZEND_VM_STACK_PAGE_SIZE : ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size), 
     174             :                 stack);
     175           7 :         ptr = stack->top;
     176           7 :         EG(vm_stack_top) = (void*)(((char*)ptr) + size);
     177           7 :         EG(vm_stack_end) = stack->end;
     178           7 :         return ptr;
     179             : }
     180             : 
     181           0 : ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data, uint32_t var)
     182             : {
     183           0 :         return EX_VAR(var);
     184             : }
     185             : 
     186             : static zend_always_inline zval *_get_zval_ptr_tmp(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
     187             : {
     188    32802012 :         zval *ret = EX_VAR(var);
     189    32802012 :         should_free->var = ret;
     190             : 
     191             :         ZEND_ASSERT(Z_TYPE_P(ret) != IS_REFERENCE);
     192             : 
     193    32802012 :         return ret;
     194             : }
     195             : 
     196             : static zend_always_inline zval *_get_zval_ptr_var(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
     197             : {
     198     9634148 :         zval *ret = EX_VAR(var);
     199             : 
     200     9634148 :         should_free->var = ret;
     201     9634148 :         return ret;
     202             : }
     203             : 
     204             : static zend_always_inline zval *_get_zval_ptr_var_deref(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
     205             : {
     206    15271449 :         zval *ret = EX_VAR(var);
     207             : 
     208    15271449 :         should_free->var = ret;
     209    15271449 :         ZVAL_DEREF(ret);
     210    15271449 :         return ret;
     211             : }
     212             : 
     213          10 : static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type, const zend_execute_data *execute_data TSRMLS_DC)
     214             : {
     215             :         zend_string *cv;
     216             : 
     217          10 :         switch (type) {
     218             :                 case BP_VAR_R:
     219             :                 case BP_VAR_UNSET:
     220          10 :                         cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
     221          10 :                         zend_error(E_NOTICE, "Undefined variable: %s", cv->val);
     222             :                         /* break missing intentionally */
     223             :                 case BP_VAR_IS:
     224          10 :                         ptr = &EG(uninitialized_zval);
     225          10 :                         break;
     226             :                 case BP_VAR_RW:
     227           0 :                         cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
     228           0 :                         zend_error(E_NOTICE, "Undefined variable: %s", cv->val);
     229             :                         /* break missing intentionally */
     230             :                 case BP_VAR_W:
     231           0 :                         ZVAL_NULL(ptr);
     232             :                         break;
     233             :         }
     234          10 :         return ptr;
     235             : }
     236             : 
     237             : static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
     238             : {
     239         612 :         zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
     240             : 
     241         612 :         zend_error(E_NOTICE, "Undefined variable: %s", cv->val);
     242         612 :         return &EG(uninitialized_zval);
     243             : }
     244             : 
     245             : static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
     246             : {
     247           0 :         zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
     248             : 
     249           0 :         zend_error(E_NOTICE, "Undefined variable: %s", cv->val);
     250           0 :         return &EG(uninitialized_zval);
     251             : }
     252             : 
     253             : static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
     254             : {
     255           3 :         zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
     256             : 
     257           3 :         ZVAL_NULL(ptr);
     258           3 :         zend_error(E_NOTICE, "Undefined variable: %s", cv->val);
     259           3 :         return ptr;
     260             : }
     261             : 
     262             : static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_W(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
     263             : {
     264       38524 :         ZVAL_NULL(ptr);
     265       38524 :         return ptr;
     266             : }
     267             : 
     268             : static zend_always_inline zval *_get_zval_ptr_cv(const zend_execute_data *execute_data, uint32_t var, int type TSRMLS_DC)
     269             : {
     270     1080449 :         zval *ret = EX_VAR(var);
     271             : 
     272     1080449 :         if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
     273           9 :                 return _get_zval_cv_lookup(ret, var, type, execute_data TSRMLS_CC);
     274             :         }
     275     1080440 :         return ret;
     276             : }
     277             : 
     278             : static zend_always_inline zval *_get_zval_ptr_cv_deref(const zend_execute_data *execute_data, uint32_t var, int type TSRMLS_DC)
     279             : {
     280     1999904 :         zval *ret = EX_VAR(var);
     281             : 
     282     1999904 :         if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
     283           1 :                 return _get_zval_cv_lookup(ret, var, type, execute_data TSRMLS_CC);
     284             :         }
     285     1999903 :         ZVAL_DEREF(ret);
     286     1999903 :         return ret;
     287             : }
     288             : 
     289             : static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     290             : {
     291    37570025 :         zval *ret = EX_VAR(var);
     292             : 
     293    37570025 :         if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
     294         567 :                 return _get_zval_cv_lookup_BP_VAR_R(ret, var, execute_data TSRMLS_CC);
     295             :         }
     296    37569458 :         return ret;
     297             : }
     298             : 
     299             : static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_R(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     300             : {
     301    16230676 :         zval *ret = EX_VAR(var);
     302             : 
     303    16230676 :         if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
     304          45 :                 return _get_zval_cv_lookup_BP_VAR_R(ret, var, execute_data TSRMLS_CC);
     305             :         }
     306    16230631 :         ZVAL_DEREF(ret);
     307    16230631 :         return ret;
     308             : }
     309             : 
     310             : static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     311             : {
     312       21492 :         zval *ret = EX_VAR(var);
     313             : 
     314       21492 :         if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
     315           0 :                 return _get_zval_cv_lookup_BP_VAR_UNSET(ret, var, execute_data TSRMLS_CC);
     316             :         }
     317       21492 :         return ret;
     318             : }
     319             : 
     320             : static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_UNSET(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     321             : {
     322             :         zval *ret = EX_VAR(var);
     323             : 
     324             :         if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
     325             :                 return _get_zval_cv_lookup_BP_VAR_UNSET(ret, var, execute_data TSRMLS_CC);
     326             :         }
     327             :         ZVAL_DEREF(ret);
     328             :         return ret;
     329             : }
     330             : 
     331             : static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     332             : {
     333         848 :         zval *ret = EX_VAR(var);
     334             : 
     335         848 :         return ret;
     336             : }
     337             : 
     338             : static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     339             : {
     340      454593 :         zval *ret = EX_VAR(var);
     341             : 
     342      454593 :         ZVAL_DEREF(ret);
     343      454593 :         return ret;
     344             : }
     345             : 
     346             : static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     347             : {
     348     9629585 :         zval *ret = EX_VAR(var);
     349             : 
     350     9629585 :         if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
     351           3 :                 return _get_zval_cv_lookup_BP_VAR_RW(ret, var, execute_data TSRMLS_CC);
     352             :         }
     353     9629582 :         return ret;
     354             : }
     355             : 
     356             : static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_RW(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     357             : {
     358             :         zval *ret = EX_VAR(var);
     359             : 
     360             :         if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
     361             :                 return _get_zval_cv_lookup_BP_VAR_RW(ret, var, execute_data TSRMLS_CC);
     362             :         }
     363             :         ZVAL_DEREF(ret);
     364             :         return ret;
     365             : }
     366             : 
     367             : static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     368             : {
     369     7047004 :         zval *ret = EX_VAR(var);
     370             : 
     371     7047004 :         if (Z_TYPE_P(ret) == IS_UNDEF) {
     372       38524 :                 return _get_zval_cv_lookup_BP_VAR_W(ret, var, execute_data TSRMLS_CC);
     373             :         }
     374     7008480 :         return ret;
     375             : }
     376             : 
     377             : static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     378             : {
     379    17825103 :         return EX_VAR(var);
     380             : }
     381             : 
     382             : static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
     383             : {
     384             :         zval *ret = EX_VAR(var);
     385             : 
     386             :         if (Z_TYPE_P(ret) == IS_UNDEF) {
     387             :                 return _get_zval_cv_lookup_BP_VAR_W(ret, var, execute_data TSRMLS_CC);
     388             :         }
     389             :         ZVAL_DEREF(ret);
     390             :         return ret;
     391             : }
     392             : 
     393     1182990 : static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
     394             : {
     395             :         zval *ret;
     396             : 
     397     1182990 :         switch (op_type) {
     398             :                 case IS_CONST:
     399      100418 :                         should_free->var = NULL;
     400      100418 :                         return node->zv;
     401             :                         break;
     402             :                 case IS_TMP_VAR:
     403        1643 :                         ret = EX_VAR(node->var);
     404        1643 :                         should_free->var = ret;
     405        1643 :                         return ret;
     406             :                         break;
     407             :                 case IS_VAR:
     408         960 :                         return _get_zval_ptr_var(node->var, execute_data, should_free TSRMLS_CC);
     409             :                         break;
     410             :                 case IS_UNUSED:
     411           0 :                         should_free->var = NULL;
     412           0 :                         return NULL;
     413             :                         break;
     414             :                 case IS_CV:
     415             :                 default:
     416     1080449 :                         should_free->var = NULL;
     417     2160898 :                         return _get_zval_ptr_cv(execute_data, node->var, type TSRMLS_CC);
     418             :                         break;
     419             :         }
     420             :         return NULL;
     421             : }
     422             : 
     423     2876938 : static inline zval *_get_zval_ptr_deref(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
     424             : {
     425             :         zval *ret;
     426             : 
     427     2876938 :         switch (op_type) {
     428             :                 case IS_CONST:
     429      561923 :                         should_free->var = NULL;
     430      561923 :                         return node->zv;
     431             :                         break;
     432             :                 case IS_TMP_VAR:
     433      106540 :                         ret = EX_VAR(node->var);
     434      106540 :                         should_free->var = ret;
     435      106540 :                         return ret;
     436             :                         break;
     437             :                 case IS_VAR:
     438      417142 :                         return _get_zval_ptr_var_deref(node->var, execute_data, should_free TSRMLS_CC);
     439             :                         break;
     440             :                 case IS_UNUSED:
     441           0 :                         should_free->var = NULL;
     442           0 :                         return NULL;
     443             :                         break;
     444             :                 case IS_CV:
     445             :                 default:
     446     1999904 :                         should_free->var = NULL;
     447     3999808 :                         return _get_zval_ptr_cv_deref(execute_data, node->var, type TSRMLS_CC);
     448             :                         break;
     449             :         }
     450             :         return NULL;
     451             : }
     452             : 
     453             : static zend_always_inline zval *_get_zval_ptr_ptr_var(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
     454             : {
     455     4642019 :         zval *ret = EX_VAR(var);
     456             : 
     457     4642019 :         if (EXPECTED(Z_TYPE_P(ret) == IS_INDIRECT)) {
     458     4640829 :                 should_free->var = NULL;
     459     4640829 :                 return Z_INDIRECT_P(ret);
     460        2309 :         } else if (!Z_REFCOUNTED_P(ret) || Z_REFCOUNT_P(ret) == 1) {
     461         192 :                 should_free->var = ret;
     462         192 :                 return ret;
     463             :         } else {
     464             :                 Z_DELREF_P(ret);
     465         998 :                 should_free->var = NULL;
     466         998 :                 return ret;
     467             :         }
     468             : }
     469             : 
     470             : static inline zval *_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
     471             : {
     472             :         if (op_type == IS_CV) {
     473             :                 should_free->var = NULL;
     474             :                 return _get_zval_ptr_cv(execute_data, node->var, type TSRMLS_CC);
     475             :         } else /* if (op_type == IS_VAR) */ {
     476             :                 ZEND_ASSERT(op_type == IS_VAR);
     477             :                 return _get_zval_ptr_ptr_var(node->var, execute_data, should_free TSRMLS_CC);
     478             :         }
     479             : }
     480             : 
     481             : static zend_always_inline zval *_get_obj_zval_ptr_unused(zend_execute_data *execute_data TSRMLS_DC)
     482             : {
     483      225565 :         if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
     484      225561 :                 return &EX(This);
     485             :         } else {
     486           4 :                 zend_error_noreturn(E_ERROR, "Using $this when not in object context");
     487             :                 return NULL;
     488             :         }
     489             : }
     490             : 
     491             : static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
     492             : {
     493             :         if (op_type == IS_UNUSED) {
     494             :                 if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
     495             :                         should_free->var = NULL;
     496             :                         return &EX(This);
     497             :                 } else {
     498             :                         zend_error_noreturn(E_ERROR, "Using $this when not in object context");
     499             :                 }
     500             :         }
     501             :         return get_zval_ptr(op_type, op, execute_data, should_free, type);
     502             : }
     503             : 
     504             : static inline zval *_get_obj_zval_ptr_ptr(int op_type, const znode_op *node, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
     505             : {
     506             :         if (op_type == IS_UNUSED) {
     507             :                 if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
     508             :                         should_free->var = NULL;
     509             :                         return &EX(This);
     510             :                 } else {
     511             :                         zend_error_noreturn(E_ERROR, "Using $this when not in object context");
     512             :                 }
     513             :         }
     514             :         return get_zval_ptr_ptr(op_type, node, execute_data, should_free, type);
     515             : }
     516             : 
     517      969174 : static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *value_ptr TSRMLS_DC)
     518             : {
     519      969174 :         if (EXPECTED(variable_ptr != value_ptr)) {
     520             :                 zend_reference *ref;
     521     1937194 :                 ZVAL_MAKE_REF(value_ptr);
     522             :                 Z_ADDREF_P(value_ptr);
     523      968597 :                 ref = Z_REF_P(value_ptr);
     524             : 
     525             :                 zval_ptr_dtor(variable_ptr);
     526      968597 :                 ZVAL_REF(variable_ptr, ref);
     527             :         } else {
     528        1154 :                 ZVAL_MAKE_REF(variable_ptr);
     529             :         }
     530      969174 : }
     531             : 
     532             : /* this should modify object only if it's empty */
     533          63 : static inline zval* make_real_object(zval *object_ptr TSRMLS_DC)
     534             : {
     535          63 :         zval *object = object_ptr;
     536             : 
     537          63 :         ZVAL_DEREF(object);
     538          63 :         if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
     539          42 :                 if (Z_TYPE_P(object) == IS_NULL
     540             :                         || Z_TYPE_P(object) == IS_FALSE
     541           4 :                         || (Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0)) {
     542             :                         zval_ptr_dtor_nogc(object);
     543          11 :                         object_init(object);
     544          11 :                         zend_error(E_WARNING, "Creating default object from empty value");
     545             :                 }
     546             :         }
     547          63 :         return object;
     548             : }
     549             : 
     550       89050 : ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, zend_ulong fetch_type, char **class_name, zend_class_entry **pce TSRMLS_DC)
     551             : {
     552             :         zend_string *key;
     553             :         ALLOCA_FLAG(use_heap);
     554             : 
     555       89050 :         STR_ALLOCA_INIT(key, cur_arg_info->class_name, cur_arg_info->class_name_len, use_heap);
     556       89050 :         *pce = zend_fetch_class(key, (fetch_type | ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD) TSRMLS_CC);
     557       89050 :         STR_ALLOCA_FREE(key, use_heap);
     558             : 
     559       89050 :         *class_name = (*pce) ? (*pce)->name->val : (char*)cur_arg_info->class_name;
     560       89050 :         if (*pce && (*pce)->ce_flags & ZEND_ACC_INTERFACE) {
     561         638 :                 return "implement interface ";
     562             :         } else {
     563       88412 :                 return "be an instance of ";
     564             :         }
     565             : }
     566             : 
     567         224 : ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC)
     568             : {
     569         224 :         zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
     570         224 :         const char *fname = zf->common.function_name->val;
     571             :         const char *fsep;
     572             :         const char *fclass;
     573             :         zval old_arg;
     574             : 
     575         224 :         if (zf->common.scope) {
     576          30 :                 fsep =  "::";
     577          30 :                 fclass = zf->common.scope->name->val;
     578             :         } else {
     579         194 :                 fsep =  "";
     580         194 :                 fclass = "";
     581             :         }
     582             : 
     583         224 :         if (arg && zf->common.type == ZEND_USER_FUNCTION) {
     584          24 :                 ZVAL_COPY_VALUE(&old_arg, arg);
     585          24 :                 ZVAL_UNDEF(arg);
     586             :         }
     587             : 
     588         233 :         if (zf->common.type == ZEND_USER_FUNCTION && ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
     589          27 :                 zend_error(error_type, "Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr->func->op_array.filename->val, ptr->opline->lineno);
     590             :         } else {
     591         197 :                 zend_error(error_type, "Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
     592             :         }
     593             : 
     594         163 :         if (arg && zf->common.type == ZEND_USER_FUNCTION) {
     595           8 :                 ZVAL_COPY_VALUE(arg, &old_arg);
     596             :         }
     597         163 : }
     598             : 
     599       90471 : static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zend_ulong fetch_type TSRMLS_DC)
     600             : {
     601             :         zend_arg_info *cur_arg_info;
     602             :         char *need_msg;
     603             :         zend_class_entry *ce;
     604             : 
     605       90471 :         if (UNEXPECTED(!zf->common.arg_info)) {
     606           0 :                 return;
     607             :         }
     608             : 
     609       90471 :         if (EXPECTED(arg_num <= zf->common.num_args)) {
     610       90432 :                 cur_arg_info = &zf->common.arg_info[arg_num-1];
     611          39 :         } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) {
     612           6 :                 cur_arg_info = &zf->common.arg_info[zf->common.num_args-1];
     613             :         } else {
     614          33 :                 return;
     615             :         }
     616             : 
     617       90438 :         if (cur_arg_info->class_name) {
     618             :                 char *class_name;
     619             : 
     620       89088 :                 ZVAL_DEREF(arg);
     621       89088 :                 if (Z_TYPE_P(arg) == IS_OBJECT) {
     622       88923 :                         need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC);
     623       88923 :                         if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
     624          82 :                                 zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name->val, arg TSRMLS_CC);
     625             :                         }
     626         165 :                 } else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
     627         125 :                         need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC);
     628         125 :                         zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "", arg TSRMLS_CC);
     629             :                 }
     630        1350 :         } else if (cur_arg_info->type_hint) {
     631         486 :                 if (cur_arg_info->type_hint == IS_ARRAY) {
     632         478 :                         ZVAL_DEREF(arg);
     633         506 :                         if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
     634          12 :                                 zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
     635             :                         }
     636           8 :                 } else if (cur_arg_info->type_hint == IS_CALLABLE) {
     637           8 :                         if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
     638           0 :                                 zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
     639             :                         }
     640             : #if ZEND_DEBUG
     641             :                 } else {
     642             :                         zend_error(E_ERROR, "Unknown typehint");
     643             : #endif
     644             :                 }
     645             :         }
     646             : }
     647             : 
     648           5 : static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_num, zend_ulong fetch_type TSRMLS_DC)
     649             : {
     650             :         zend_arg_info *cur_arg_info;
     651             :         char *need_msg;
     652             :         zend_class_entry *ce;
     653             : 
     654           5 :         if (UNEXPECTED(!zf->common.arg_info)) {
     655           0 :                 return 1;
     656             :         }
     657             : 
     658           5 :         if (EXPECTED(arg_num <= zf->common.num_args)) {
     659           5 :                 cur_arg_info = &zf->common.arg_info[arg_num-1];
     660           0 :         } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) {
     661           0 :                 cur_arg_info = &zf->common.arg_info[zf->common.num_args-1];
     662             :         } else {
     663           0 :                 return 1;
     664             :         }
     665             : 
     666           5 :         if (cur_arg_info->class_name) {
     667             :                 char *class_name;
     668             : 
     669           2 :                 need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC);
     670           2 :                 zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "none", "", NULL TSRMLS_CC);
     671           0 :                 return 0;
     672           3 :         } else if (cur_arg_info->type_hint) {
     673           3 :                 if (cur_arg_info->type_hint == IS_ARRAY) {
     674           2 :                         zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "", NULL TSRMLS_CC);
     675           1 :                 } else if (cur_arg_info->type_hint == IS_CALLABLE) {
     676           1 :                         zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "", NULL TSRMLS_CC);
     677             : #if ZEND_DEBUG
     678             :                 } else {
     679             :                         zend_error(E_ERROR, "Unknown typehint");
     680             : #endif
     681             :                 }
     682           1 :                 return 0;
     683             :         }
     684           0 :         return 1;
     685             : }
     686             : 
     687          75 : static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num TSRMLS_DC)
     688             : {
     689          76 :         if (EXPECTED(!(EX(func)->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) ||
     690           5 :             zend_verify_missing_arg_type(EX(func), arg_num, EX(opline)->extended_value TSRMLS_CC)) {
     691          70 :                 const char *class_name = EX(func)->common.scope ? EX(func)->common.scope->name->val : "";
     692          70 :                 const char *space = EX(func)->common.scope ? "::" : "";
     693          70 :                 const char *func_name = EX(func)->common.function_name ? EX(func)->common.function_name->val : "main";
     694          70 :                 zend_execute_data *ptr = EX(prev_execute_data);
     695             : 
     696          85 :                 if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
     697          15 :                         zend_error(E_WARNING, "Missing argument %u for %s%s%s(), called in %s on line %d and defined", arg_num, class_name, space, func_name, ptr->func->op_array.filename->val, ptr->opline->lineno);
     698             :                 } else {
     699          55 :                         zend_error(E_WARNING, "Missing argument %u for %s%s%s()", arg_num, class_name, space, func_name);
     700             :                 }
     701             :         }
     702          71 : }
     703             : 
     704             : static zend_always_inline void zend_assign_to_object(zval *retval, zval *object, uint32_t object_op_type, zval *property_name, int value_type, const znode_op *value_op, const zend_execute_data *execute_data, int opcode, void **cache_slot TSRMLS_DC)
     705             : {
     706             :         zend_free_op free_value;
     707      114839 :         zval *value = get_zval_ptr(value_type, value_op, execute_data, &free_value, BP_VAR_R);
     708             :         zval tmp;
     709             : 
     710      114839 :         if (object_op_type != IS_UNUSED) {
     711       12947 :                 ZVAL_DEREF(object);
     712       12947 :                 if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
     713          28 :                         if (UNEXPECTED(object == &EG(error_zval))) {
     714           0 :                                 if (retval) {
     715           0 :                                         ZVAL_NULL(retval);
     716             :                                 }
     717           0 :                                 FREE_OP(free_value);
     718             :                                 return;
     719             :                         }
     720          39 :                         if (EXPECTED(Z_TYPE_P(object) == IS_NULL ||
     721             :                             Z_TYPE_P(object) == IS_FALSE ||
     722             :                             (Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
     723             :                                 zend_object *obj;
     724             : 
     725             :                                 zval_ptr_dtor(object);
     726          24 :                                 object_init(object);
     727             :                                 Z_ADDREF_P(object);
     728          24 :                                 obj = Z_OBJ_P(object);
     729          24 :                                 zend_error(E_WARNING, "Creating default object from empty value");
     730          24 :                                 if (GC_REFCOUNT(obj) == 1) {
     731             :                                         /* the enclosing container was deleted, obj is unreferenced */
     732           1 :                                         if (retval) {
     733           1 :                                                 ZVAL_NULL(retval);
     734             :                                         }
     735           1 :                                         FREE_OP(free_value);
     736             :                                         OBJ_RELEASE(obj);
     737             :                                         return;
     738             :                                 }
     739             :                                 Z_DELREF_P(object);
     740             :                         } else {
     741           4 :                                 zend_error(E_WARNING, "Attempt to assign property of non-object");
     742           4 :                                 if (retval) {
     743           0 :                                         ZVAL_NULL(retval);
     744             :                                 }
     745           4 :                                 FREE_OP(free_value);
     746             :                                 return;
     747             :                         }
     748             :                 }
     749             :         }
     750             : 
     751             :         /* separate our value if necessary */
     752      114834 :         if (value_type == IS_TMP_VAR) {
     753         549 :                 ZVAL_COPY_VALUE(&tmp, value);
     754         549 :                 value = &tmp;
     755      114285 :         } else if (value_type == IS_CONST) {
     756      100335 :                 if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
     757          70 :                         ZVAL_COPY_VALUE(&tmp, value);
     758          70 :                         zval_copy_ctor_func(&tmp);
     759          70 :                         value = &tmp;
     760             :                 }
     761       13950 :         } else if (Z_REFCOUNTED_P(value)) {
     762             :                 Z_ADDREF_P(value);
     763             :         }
     764             : 
     765      114834 :         if (opcode == ZEND_ASSIGN_OBJ) {
     766      113279 :                 if (!Z_OBJ_HT_P(object)->write_property) {
     767           0 :                         zend_error(E_WARNING, "Attempt to assign property of non-object");
     768           0 :                         if (retval) {
     769           0 :                                 ZVAL_NULL(retval);
     770             :                         }
     771           0 :                         if (value_type == IS_CONST) {
     772             :                                 zval_ptr_dtor(value);
     773             :                         }
     774           0 :                         FREE_OP(free_value);
     775             :                         return;
     776             :                 }
     777      113279 :                 Z_OBJ_HT_P(object)->write_property(object, property_name, value, cache_slot TSRMLS_CC);
     778             :         } else {
     779             :                 /* Note:  property_name in this case is really the array index! */
     780        1555 :                 if (!Z_OBJ_HT_P(object)->write_dimension) {
     781           0 :                         zend_error_noreturn(E_ERROR, "Cannot use object as array");
     782             :                 }
     783        1555 :                 Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
     784             :         }
     785             : 
     786      114824 :         if (retval && !EG(exception)) {
     787          30 :                 ZVAL_COPY(retval, value);
     788             :         }
     789             :         zval_ptr_dtor(value);
     790      114824 :         if (value_type == IS_VAR) {
     791         453 :                 FREE_OP(free_value);
     792             :         }
     793             : }
     794             : 
     795         145 : static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *value, zval *result TSRMLS_DC)
     796             : {
     797             :         zend_string *old_str;
     798             : 
     799         145 :         if (offset < 0) {
     800           1 :                 zend_error(E_WARNING, "Illegal string offset:  " ZEND_LONG_FMT, offset);
     801           1 :                 zend_string_release(Z_STR_P(str));
     802           1 :                 if (result) {
     803           0 :                         ZVAL_NULL(result);
     804             :                 }
     805           1 :                 return;
     806             :         }
     807             : 
     808         144 :         old_str = Z_STR_P(str);
     809         144 :         if ((size_t)offset >= Z_STRLEN_P(str)) {
     810           3 :                 zend_long old_len = Z_STRLEN_P(str);
     811           6 :                 Z_STR_P(str) = zend_string_realloc(Z_STR_P(str), offset + 1, 0);
     812           3 :                 Z_TYPE_INFO_P(str) = IS_STRING_EX;
     813           3 :                 memset(Z_STRVAL_P(str) + old_len, ' ', offset - old_len);
     814           3 :                 Z_STRVAL_P(str)[offset+1] = 0;
     815         141 :         } else if (!Z_REFCOUNTED_P(str)) {
     816          16 :                 Z_STR_P(str) = zend_string_init(Z_STRVAL_P(str), Z_STRLEN_P(str), 0);
     817           8 :                 Z_TYPE_INFO_P(str) = IS_STRING_EX;
     818             :         }
     819             : 
     820         144 :         if (Z_TYPE_P(value) != IS_STRING) {
     821          11 :                 zend_string *tmp = zval_get_string(value);
     822             : 
     823          11 :                 Z_STRVAL_P(str)[offset] = tmp->val[0];
     824             :                 zend_string_release(tmp);
     825             :         } else {
     826         133 :                 Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0];
     827             :         }
     828             :         /*
     829             :          * the value of an assignment to a string offset is undefined
     830             :         T(result->u.var).var = &T->str_offset.str;
     831             :         */
     832             : 
     833             :         zend_string_release(old_str);
     834         144 :         if (result) {
     835          12 :                 zend_uchar c = (zend_uchar)Z_STRVAL_P(str)[offset];
     836             : 
     837          12 :                 if (CG(one_char_string)[c]) {
     838           0 :                         ZVAL_INTERNED_STR(result, CG(one_char_string)[c]);
     839             :                 } else {
     840          24 :                         ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(str) + offset, 1, 0));
     841             :                 }
     842             :         }
     843             : }
     844             : 
     845             : static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type TSRMLS_DC)
     846             : {
     847             :         do {
     848    19686641 :                 if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) { 
     849             :                         zend_refcounted *garbage;
     850             : 
     851    12193201 :                         if (Z_ISREF_P(variable_ptr)) {
     852     2777917 :                                 variable_ptr = Z_REFVAL_P(variable_ptr);
     853     2777917 :                                 if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
     854             :                                         break;
     855             :                                 }
     856             :                         }
     857    11222161 :                         if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
     858      805189 :                         UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
     859           0 :                                 Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
     860           0 :                                 return variable_ptr;
     861             :                         }
     862    10416972 :                         if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) {
     863         120 :                                 return variable_ptr;
     864             :                         }
     865    10416852 :                         garbage = Z_COUNTED_P(variable_ptr);
     866    10416852 :                         if (--GC_REFCOUNT(garbage) == 0) {
     867     5378088 :                                 ZVAL_COPY_VALUE(variable_ptr, value);
     868     5378088 :                                 if (value_type == IS_CONST) {
     869             :                                         /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
     870       22464 :                                         if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
     871       13734 :                                                 zval_copy_ctor_func(variable_ptr);
     872             :                                         }
     873     5355624 :                                 } else if (value_type != IS_TMP_VAR) {
     874     5275328 :                                         if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
     875             :                                                 Z_ADDREF_P(variable_ptr);
     876             :                                         }
     877             :                                 }
     878     5378088 :                                 _zval_dtor_func_for_ptr(garbage ZEND_FILE_LINE_CC);
     879     5378084 :                                 return variable_ptr;
     880             :                         } else { /* we need to split */
     881             :                                 /* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
     882     5266104 :                                 if ((Z_COLLECTABLE_P(variable_ptr)) &&
     883      227340 :                                 UNEXPECTED(!GC_INFO(garbage))) {
     884       18212 :                                         gc_possible_root(garbage TSRMLS_CC);
     885             :                                 }
     886             :                         }
     887             :                 }
     888             :         } while (0);
     889             : 
     890    14308433 :         ZVAL_COPY_VALUE(variable_ptr, value);
     891    14308433 :         if (value_type == IS_CONST) {
     892             :                 /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
     893     3087565 :                 if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
     894      203205 :                         zval_copy_ctor_func(variable_ptr);
     895             :                 }
     896    11220868 :         } else if (value_type != IS_TMP_VAR) {
     897     8398315 :                 if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
     898             :                         Z_ADDREF_P(variable_ptr);
     899             :                 }
     900             :         }
     901    14308433 :         return variable_ptr;
     902             : }
     903             : 
     904             : /* Utility Functions for Extensions */
     905           0 : static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
     906             : {
     907           0 :         if (extension->statement_handler) {
     908           0 :                 extension->statement_handler(op_array);
     909             :         }
     910           0 : }
     911             : 
     912             : 
     913           0 : static void zend_extension_fcall_begin_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
     914             : {
     915           0 :         if (extension->fcall_begin_handler) {
     916           0 :                 extension->fcall_begin_handler(op_array);
     917             :         }
     918           0 : }
     919             : 
     920             : 
     921           0 : static void zend_extension_fcall_end_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
     922             : {
     923           0 :         if (extension->fcall_end_handler) {
     924           0 :                 extension->fcall_end_handler(op_array);
     925             :         }
     926           0 : }
     927             : 
     928             : 
     929             : static zend_always_inline HashTable *zend_get_target_symbol_table(zend_execute_data *execute_data, int fetch_type TSRMLS_DC)
     930             : {
     931             :         HashTable *ht;
     932             : 
     933      214574 :         if (EXPECTED(fetch_type == ZEND_FETCH_GLOBAL_LOCK) || 
     934      107287 :             EXPECTED(fetch_type == ZEND_FETCH_GLOBAL)) {
     935       13374 :                 ht = &EG(symbol_table).ht;
     936       93913 :         } else if (EXPECTED(fetch_type == ZEND_FETCH_STATIC)) {
     937             :                 ZEND_ASSERT(EX(func)->op_array.static_variables != NULL);
     938        1431 :                 ht = EX(func)->op_array.static_variables;
     939             :         } else {
     940             :                 ZEND_ASSERT(fetch_type == ZEND_FETCH_LOCAL);
     941       92482 :                 if (!EX(symbol_table)) {
     942       87388 :                         zend_rebuild_symbol_table(TSRMLS_C);
     943             :                 }
     944       92482 :                 ht = &EX(symbol_table)->ht;
     945             :         }
     946      107287 :         return ht;
     947             : }
     948             : 
     949             : static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht, const zval *dim, int dim_type, int type TSRMLS_DC)
     950             : {
     951             :         zval *retval;
     952             :         zend_string *offset_key;
     953             :         zend_ulong hval;
     954             : 
     955     8752047 :         if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) {
     956     5094006 :                 hval = Z_LVAL_P(dim);
     957             : num_index:
     958     5274149 :                 retval = zend_hash_index_find(ht, hval);
     959     5274149 :                 if (retval == NULL) {
     960      396270 :                         switch (type) {
     961             :                                 case BP_VAR_R:
     962          16 :                                         zend_error(E_NOTICE,"Undefined offset: " ZEND_ULONG_FMT, hval);
     963             :                                         /* break missing intentionally */
     964             :                                 case BP_VAR_UNSET:
     965             :                                 case BP_VAR_IS:
     966          19 :                                         retval = &EG(uninitialized_zval);
     967             :                                         break;
     968             :                                 case BP_VAR_RW:
     969           6 :                                         zend_error(E_NOTICE,"Undefined offset: " ZEND_ULONG_FMT, hval);
     970             :                                         /* break missing intentionally */
     971             :                                 case BP_VAR_W:
     972      396251 :                                         retval = zend_hash_index_add_new(ht, hval, &EG(uninitialized_zval));
     973             :                                         break;
     974             :                         }
     975             :                 }
     976     3658041 :         } else if (EXPECTED(Z_TYPE_P(dim) == IS_STRING)) {
     977     3657966 :                 offset_key = Z_STR_P(dim);
     978     3657966 :                 if (dim_type != IS_CONST) {
     979     5986476 :                         if (ZEND_HANDLE_NUMERIC(offset_key, hval)) {
     980             :                                 goto num_index;
     981             :                         }
     982             :                 }
     983             : str_index:
     984     3477892 :                 retval = zend_hash_find(ht, offset_key);
     985     3477892 :                 if (retval) {
     986             :                         /* support for $GLOBALS[...] */
     987     1565733 :                         if (UNEXPECTED(Z_TYPE_P(retval) == IS_INDIRECT)) {
     988        7808 :                                 retval = Z_INDIRECT_P(retval);
     989        7808 :                                 if (UNEXPECTED(Z_TYPE_P(retval) == IS_UNDEF)) {
     990          21 :                                         switch (type) {
     991             :                                                 case BP_VAR_R:
     992           1 :                                                         zend_error(E_NOTICE, "Undefined index: %s", offset_key->val);
     993             :                                                         /* break missing intentionally */
     994             :                                                 case BP_VAR_UNSET:
     995             :                                                 case BP_VAR_IS:
     996           1 :                                                         retval = &EG(uninitialized_zval);
     997             :                                                         break;
     998             :                                                 case BP_VAR_RW:
     999           0 :                                                         zend_error(E_NOTICE,"Undefined index: %s", offset_key->val);
    1000             :                                                         /* break missing intentionally */
    1001             :                                                 case BP_VAR_W:
    1002          20 :                                                         ZVAL_NULL(retval);
    1003             :                                                         break;
    1004             :                                         }
    1005             :                                 }
    1006             :                         }
    1007             :                 } else { 
    1008     1912159 :                         switch (type) {
    1009             :                                 case BP_VAR_R:
    1010      156649 :                                         zend_error(E_NOTICE, "Undefined index: %s", offset_key->val);
    1011             :                                         /* break missing intentionally */
    1012             :                                 case BP_VAR_UNSET:
    1013             :                                 case BP_VAR_IS:
    1014      156649 :                                         retval = &EG(uninitialized_zval);
    1015             :                                         break;
    1016             :                                 case BP_VAR_RW:
    1017           1 :                                         zend_error(E_NOTICE,"Undefined index: %s", offset_key->val);
    1018             :                                         /* break missing intentionally */
    1019             :                                 case BP_VAR_W:
    1020     1755510 :                                         retval = zend_hash_add_new(ht, offset_key, &EG(uninitialized_zval));
    1021             :                                         break;
    1022             :                         }
    1023             :                 }
    1024             :         } else {
    1025          75 :                 switch (Z_TYPE_P(dim)) {
    1026             :                         case IS_NULL:
    1027          11 :                                 offset_key = STR_EMPTY_ALLOC();
    1028             :                                 goto str_index;
    1029             :                         case IS_DOUBLE:
    1030          92 :                                 hval = zend_dval_to_lval(Z_DVAL_P(dim));
    1031             :                                 goto num_index;
    1032             :                         case IS_RESOURCE:
    1033           3 :                                 zend_error(E_STRICT, "Resource ID#%pd used as offset, casting to integer (%pd)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim));
    1034           3 :                                 hval = Z_RES_HANDLE_P(dim);
    1035             :                                 goto num_index;
    1036             :                         case IS_FALSE:
    1037           6 :                                 hval = 0;
    1038             :                                 goto num_index;
    1039             :                         case IS_TRUE:
    1040           3 :                                 hval = 1;
    1041             :                                 goto num_index;
    1042             :                         default:
    1043           6 :                                 zend_error(E_WARNING, "Illegal offset type");
    1044           6 :                                 retval = (type == BP_VAR_W || type == BP_VAR_RW) ?
    1045             :                                         &EG(error_zval) : &EG(uninitialized_zval);
    1046             :                 }
    1047             :         }
    1048     8752047 :         return retval;
    1049             : }
    1050             : 
    1051             : static zend_always_inline zval *zend_fetch_dimension_address(zval *result, zval *container_ptr, zval *dim, int dim_type, int type, int is_ref, int allow_str_offset TSRMLS_DC)
    1052             : {
    1053             :     zval *retval;
    1054     4461843 :     zval *container = container_ptr;
    1055             : 
    1056     4461843 :         ZVAL_DEREF(container);
    1057     4461843 :         if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
    1058     9021940 :                 SEPARATE_ARRAY(container);
    1059             : fetch_from_array:
    1060     4461618 :                 if (dim == NULL) {
    1061      564371 :                         retval = zend_hash_next_index_insert(Z_ARRVAL_P(container), &EG(uninitialized_zval));
    1062      564371 :                         if (UNEXPECTED(retval == NULL)) {
    1063           1 :                                 zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
    1064           1 :                                 retval = &EG(error_zval);
    1065             :                         }
    1066             :                 } else {
    1067     7794494 :                         retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC);
    1068             :                 }
    1069     4461618 :                 if (is_ref) {
    1070      179860 :                         ZVAL_MAKE_REF(retval);
    1071             :                 }
    1072     4461618 :                 ZVAL_INDIRECT(result, retval);
    1073        1337 :         } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) {
    1074             :                 zend_long offset;
    1075             : 
    1076         156 :                 if (type != BP_VAR_UNSET && UNEXPECTED(Z_STRLEN_P(container) == 0)) {
    1077             :                         zval_ptr_dtor_nogc(container);
    1078             : convert_to_array:
    1079        1112 :                         ZVAL_NEW_ARR(container);
    1080        1112 :                         zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
    1081             :                         goto fetch_from_array;
    1082             :                 }
    1083             : 
    1084         152 :                 if (dim == NULL) {
    1085           0 :                         zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
    1086             :                 }
    1087             : 
    1088         152 :                 if (UNEXPECTED(Z_TYPE_P(dim) != IS_LONG)) {
    1089          15 :                         switch(Z_TYPE_P(dim)) {
    1090             :                                 case IS_STRING:
    1091          30 :                                         if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) {
    1092             :                                                 break;
    1093             :                                         }
    1094          15 :                                         if (type != BP_VAR_UNSET) {
    1095          14 :                                                 zend_error(E_WARNING, "Illegal string offset '%s'", Z_STRVAL_P(dim));
    1096             :                                         }
    1097             :                                         break;
    1098             :                                 case IS_DOUBLE:
    1099             :                                 case IS_NULL:
    1100             :                                 case IS_FALSE:
    1101             :                                 case IS_TRUE:
    1102           0 :                                         zend_error(E_NOTICE, "String offset cast occurred");
    1103             :                                         break;
    1104             :                                 default:
    1105           0 :                                         zend_error(E_WARNING, "Illegal offset type");
    1106             :                                         break;
    1107             :                         }
    1108             : 
    1109          15 :                         offset = zval_get_long(dim);
    1110             :                 } else {
    1111         137 :                         offset = Z_LVAL_P(dim);
    1112             :                 }
    1113             : 
    1114         152 :                 if (allow_str_offset) {
    1115         145 :                         if (Z_REFCOUNTED_P(container)) {
    1116         136 :                                 if (Z_REFCOUNT_P(container) > 1) {
    1117             :                                         Z_DELREF_P(container);
    1118           6 :                                         zval_copy_ctor_func(container);
    1119             :                                 }
    1120             :                                 Z_ADDREF_P(container);
    1121             :                         }
    1122         145 :                         ZVAL_LONG(result, offset);
    1123         145 :                         return container; /* assignment to string offset */
    1124             :                 } else {
    1125           7 :                         ZVAL_INDIRECT(result, NULL); /* wrong string offset */
    1126             :                 }
    1127        1181 :         } else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
    1128          52 :                 if (!Z_OBJ_HT_P(container)->read_dimension) {
    1129           0 :                         zend_error_noreturn(E_ERROR, "Cannot use object as array");
    1130             :                 } else {
    1131          52 :                         retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result TSRMLS_CC);
    1132             : 
    1133          52 :                         if (UNEXPECTED(retval == &EG(uninitialized_zval))) {
    1134           2 :                                 zend_class_entry *ce = Z_OBJCE_P(container);
    1135             : 
    1136           2 :                                 ZVAL_NULL(result);
    1137           2 :                                 zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name->val);
    1138          96 :                         } else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) {
    1139          46 :                                 if (!Z_ISREF_P(retval)) {
    1140          76 :                                         if (Z_REFCOUNTED_P(retval) &&
    1141             :                                             Z_REFCOUNT_P(retval) > 1) {
    1142           7 :                                                 if (Z_TYPE_P(retval) != IS_OBJECT) {
    1143             :                                                         Z_DELREF_P(retval);
    1144           5 :                                                         ZVAL_DUP(result, retval);
    1145           5 :                                                         retval = result;
    1146             :                                                 } else {
    1147           2 :                                                         ZVAL_COPY(result, retval);
    1148           2 :                                                         retval = result;
    1149             :                                                 }
    1150             :                                         }
    1151          40 :                                         if (Z_TYPE_P(retval) != IS_OBJECT) {
    1152           9 :                                                 zend_class_entry *ce = Z_OBJCE_P(container);
    1153           9 :                                                 zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name->val);
    1154             :                                         }
    1155             :                                 }
    1156          46 :                                 if (result != retval) {
    1157           5 :                                         if (is_ref) {
    1158           0 :                                                 ZVAL_MAKE_REF(retval);
    1159             :                                         }
    1160           5 :                                         ZVAL_INDIRECT(result, retval);
    1161             :                                 }
    1162             :                         } else {
    1163           4 :                                 ZVAL_INDIRECT(result, &EG(error_zval));
    1164             :                         }
    1165             :                 }
    1166        1129 :         } else if (EXPECTED(Z_TYPE_P(container) == IS_NULL)) {
    1167        1106 :                 if (UNEXPECTED(container == &EG(error_zval))) {
    1168           2 :                         ZVAL_INDIRECT(result, &EG(error_zval));
    1169        1104 :                 } else if (type != BP_VAR_UNSET) {
    1170             :                         goto convert_to_array;
    1171             :                 } else {
    1172             :                         /* for read-mode only */
    1173           0 :                         ZVAL_NULL(result);
    1174             :                 }
    1175             :         } else {
    1176          46 :                 if (type != BP_VAR_UNSET &&
    1177             :                     Z_TYPE_P(container) == IS_FALSE) {
    1178             :                         goto convert_to_array;
    1179             :                 }
    1180          19 :                 if (type == BP_VAR_UNSET) {
    1181           0 :                         zend_error(E_WARNING, "Cannot unset offset in a non-array variable");
    1182           0 :                         ZVAL_NULL(result);
    1183             :                 } else {
    1184          19 :                         zend_error(E_WARNING, "Cannot use a scalar value as an array");
    1185          19 :                         ZVAL_INDIRECT(result, &EG(error_zval));
    1186             :                 }
    1187             :         }
    1188     4461698 :         return NULL; /* not an assignment to string offset */
    1189             : }
    1190             : 
    1191      232507 : static zend_never_inline void zend_fetch_dimension_address_W(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
    1192             : {
    1193             :         zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W, 0, 0 TSRMLS_CC);
    1194      232507 : }
    1195             : 
    1196     2876775 : static zend_never_inline zval *zend_fetch_dimension_address_W_str(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
    1197             : {
    1198     2876775 :         return zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W, 0, 1 TSRMLS_CC);
    1199             : }
    1200             : 
    1201       89932 : static zend_never_inline void zend_fetch_dimension_address_W_ref(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
    1202             : {
    1203             :         zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W, 1, 0 TSRMLS_CC);
    1204       89932 : }
    1205             : 
    1206     1262609 : static zend_never_inline void zend_fetch_dimension_address_RW(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
    1207             : {
    1208             :         zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_RW, 0, 0 TSRMLS_CC);
    1209     1262609 : }
    1210             : 
    1211          20 : static zend_never_inline void zend_fetch_dimension_address_UNSET(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
    1212             : {
    1213             :         zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_UNSET, 0, 0 TSRMLS_CC);
    1214          20 : }
    1215             : 
    1216             : static zend_always_inline void zend_fetch_dimension_address_read(zval *result, zval *container, zval *dim, int dim_type, int type TSRMLS_DC)
    1217             : {
    1218             :         zval *retval;
    1219             : 
    1220     4680808 :         ZVAL_DEREF(container);
    1221     4680808 :         if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
    1222     9295548 :                 retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC);
    1223     4647774 :                 ZVAL_COPY(result, retval);
    1224       33034 :         } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) {
    1225             :                 zend_long offset;
    1226             : 
    1227       32151 :                 if (UNEXPECTED(Z_TYPE_P(dim) != IS_LONG)) {
    1228          46 :                         switch(Z_TYPE_P(dim)) {
    1229             :                                 /* case IS_LONG: */
    1230             :                                 case IS_STRING:
    1231          60 :                                         if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) {
    1232             :                                                 break;
    1233             :                                         }
    1234          29 :                                         if (type != BP_VAR_IS) {
    1235          21 :                                                 zend_error(E_WARNING, "Illegal string offset '%s'", Z_STRVAL_P(dim));
    1236             :                                         }
    1237             :                                         break;
    1238             :                                 case IS_DOUBLE:
    1239             :                                 case IS_NULL:
    1240             :                                 case IS_FALSE:
    1241             :                                 case IS_TRUE:
    1242          13 :                                         if (type != BP_VAR_IS) {
    1243          11 :                                                 zend_error(E_NOTICE, "String offset cast occurred");
    1244             :                                         }
    1245             :                                         break;
    1246             :                                 default:
    1247           3 :                                         zend_error(E_WARNING, "Illegal offset type");
    1248             :                                         break;
    1249             :                         }
    1250             : 
    1251          46 :                         offset = zval_get_long(dim);
    1252             :                 } else {
    1253       32105 :                         offset = Z_LVAL_P(dim);
    1254             :                 }
    1255             : 
    1256       32151 :                 if (UNEXPECTED(offset < 0) || UNEXPECTED(Z_STRLEN_P(container) <= (size_t)offset)) {
    1257          37 :                         if (type != BP_VAR_IS) {
    1258          33 :                                 zend_error(E_NOTICE, "Uninitialized string offset: %pd", offset);
    1259             :                         }
    1260          37 :                         ZVAL_EMPTY_STRING(result);
    1261             :                 } else {
    1262       32114 :                         zend_uchar c = (zend_uchar)Z_STRVAL_P(container)[offset];
    1263             : 
    1264       32114 :                         if (CG(one_char_string)[c]) {
    1265           0 :                                 ZVAL_INTERNED_STR(result, CG(one_char_string)[c]);
    1266             :                         } else {
    1267       64228 :                                 ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(container) + offset, 1, 0));
    1268             :                         }
    1269             :                 }
    1270         883 :         } else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
    1271         759 :                 if (!Z_OBJ_HT_P(container)->read_dimension) {
    1272           0 :                         zend_error_noreturn(E_ERROR, "Cannot use object as array");
    1273             :                 } else {
    1274         759 :                         retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result TSRMLS_CC);
    1275             : 
    1276             :                         ZEND_ASSERT(result != NULL);
    1277         756 :                         if (retval) {
    1278         748 :                                 if (result != retval) {
    1279         121 :                                         ZVAL_COPY(result, retval);
    1280             :                                 }
    1281             :                         } else {
    1282           8 :                                 ZVAL_NULL(result);
    1283             :                         }
    1284             :                 }
    1285             :         } else {
    1286         124 :                 ZVAL_NULL(result);
    1287             :         }
    1288             : }
    1289             : 
    1290     4679928 : static zend_never_inline void zend_fetch_dimension_address_read_R(zval *result, zval *container, zval *dim, int dim_type TSRMLS_DC)
    1291             : {
    1292             :         zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_R TSRMLS_CC);
    1293     4679925 : }
    1294             : 
    1295         880 : static zend_never_inline void zend_fetch_dimension_address_read_IS(zval *result, zval *container, zval *dim, int dim_type TSRMLS_DC)
    1296             : {
    1297             :         zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS TSRMLS_CC);
    1298         880 : }
    1299             : 
    1300          11 : ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim TSRMLS_DC)
    1301             : {
    1302          11 :         zend_fetch_dimension_address_read_R(result, container, dim, IS_TMP_VAR TSRMLS_CC);
    1303          11 : }
    1304             : 
    1305             : static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, void **cache_slot, int type, int is_ref TSRMLS_DC)
    1306             : {
    1307      175485 :     if (container_op_type != IS_UNUSED) {
    1308       87661 :                 ZVAL_DEREF(container);
    1309       87661 :                 if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
    1310          44 :                         if (UNEXPECTED(container == &EG(error_zval))) {
    1311           1 :                                 ZVAL_INDIRECT(result, &EG(error_zval));
    1312             :                                 return;
    1313             :                         }
    1314             : 
    1315             :                         /* this should modify object only if it's empty */
    1316         101 :                         if (type != BP_VAR_UNSET &&
    1317           3 :                             EXPECTED((Z_TYPE_P(container) == IS_NULL ||
    1318             :                               Z_TYPE_P(container) == IS_FALSE ||
    1319             :                               (Z_TYPE_P(container) == IS_STRING && Z_STRLEN_P(container)==0)))) {
    1320             :                                 zval_ptr_dtor_nogc(container);
    1321          37 :                                 object_init(container);
    1322             :                         } else {
    1323           6 :                                 zend_error(E_WARNING, "Attempt to modify property of non-object");
    1324           6 :                                 ZVAL_INDIRECT(result, &EG(error_zval));
    1325             :                                 return;
    1326             :                         }
    1327             :                 }
    1328             :         }
    1329      175478 :         if (EXPECTED(Z_OBJ_HT_P(container)->get_property_ptr_ptr)) {
    1330      175478 :                 zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot TSRMLS_CC);
    1331      175477 :                 if (NULL == ptr) {
    1332         112 :                         if (Z_OBJ_HT_P(container)->read_property &&
    1333          56 :                                 (ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result TSRMLS_CC)) != NULL) {
    1334          56 :                                 if (ptr != result) {
    1335           3 :                                         if (is_ref && ptr != &EG(uninitialized_zval)) {
    1336           0 :                                                 ZVAL_MAKE_REF(ptr);
    1337             :                                         }
    1338           3 :                                         ZVAL_INDIRECT(result, ptr);
    1339             :                                 }
    1340             :                         } else {
    1341           0 :                                 zend_error_noreturn(E_ERROR, "Cannot access undefined property for object with overloaded property access");
    1342             :                         }
    1343             :                 } else {
    1344      175421 :                         if (is_ref) {
    1345         150 :                                 ZVAL_MAKE_REF(ptr);
    1346             :                         }
    1347      175421 :                         ZVAL_INDIRECT(result, ptr);
    1348             :                 }
    1349           0 :         } else if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) {
    1350           0 :                 zval *ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result TSRMLS_CC);
    1351           0 :                 if (ptr != result) {
    1352           0 :                         if (is_ref && ptr != &EG(uninitialized_zval)) {
    1353           0 :                                 ZVAL_MAKE_REF(ptr);
    1354             :                         }
    1355           0 :                         ZVAL_INDIRECT(result, ptr);
    1356             :                 }
    1357             :         } else {
    1358           0 :                 zend_error(E_WARNING, "This object doesn't support property references");
    1359           0 :                 ZVAL_INDIRECT(result, &EG(error_zval));
    1360             :         }
    1361             : }
    1362             : 
    1363       78313 : static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, const zend_op_array *op_array, const zend_execute_data *execute_data TSRMLS_DC)
    1364             : {
    1365       78313 :         int original_nest_levels = nest_levels;
    1366             :         zend_brk_cont_element *jmp_to;
    1367             : 
    1368             :         do {
    1369       78471 :                 if (array_offset==-1) {
    1370           1 :                         zend_error_noreturn(E_ERROR, "Cannot break/continue %d level%s", original_nest_levels, (original_nest_levels == 1) ? "" : "s");
    1371             :                 }
    1372       78470 :                 jmp_to = &op_array->brk_cont_array[array_offset];
    1373       78470 :                 if (nest_levels>1) {
    1374         158 :                         zend_op *brk_opline = &op_array->opcodes[jmp_to->brk];
    1375             : 
    1376         158 :                         if (brk_opline->opcode == ZEND_FREE) {
    1377           3 :                                 if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
    1378           1 :                                         zval_ptr_dtor_nogc(EX_VAR(brk_opline->op1.var));
    1379             :                                 }
    1380             :                         }
    1381             :                 }
    1382       78470 :                 array_offset = jmp_to->parent;
    1383       78470 :         } while (--nest_levels > 0);
    1384       78312 :         return jmp_to;
    1385             : }
    1386             : 
    1387             : #if ZEND_INTENSIVE_DEBUGGING
    1388             : 
    1389             : #define CHECK_SYMBOL_TABLES()                                                                                                   \
    1390             :         zend_hash_apply(&EG(symbol_table), zend_check_symbol TSRMLS_CC);                    \
    1391             :         if (&EG(symbol_table)!=EX(symbol_table)) {                                                  \
    1392             :                 zend_hash_apply(EX(symbol_table), zend_check_symbol TSRMLS_CC); \
    1393             :         }
    1394             : 
    1395             : static int zend_check_symbol(zval *pz TSRMLS_DC)
    1396             : {
    1397             :         if (Z_TYPE_P(pz) == IS_INDIRECT) {
    1398             :                 pz = Z_INDIRECT_P(pz);
    1399             :         }
    1400             :         if (Z_TYPE_P(pz) > 10) {
    1401             :                 fprintf(stderr, "Warning!  %x has invalid type!\n", *pz);
    1402             : /* See http://support.microsoft.com/kb/190351 */
    1403             : #ifdef PHP_WIN32
    1404             :                 fflush(stderr);
    1405             : #endif
    1406             :         } else if (Z_TYPE_P(pz) == IS_ARRAY) {
    1407             :                 zend_hash_apply(Z_ARRVAL_P(pz), zend_check_symbol TSRMLS_CC);
    1408             :         } else if (Z_TYPE_P(pz) == IS_OBJECT) {
    1409             :                 /* OBJ-TBI - doesn't support new object model! */
    1410             :                 zend_hash_apply(Z_OBJPROP_P(pz), zend_check_symbol TSRMLS_CC);
    1411             :         }
    1412             : 
    1413             :         return 0;
    1414             : }
    1415             : 
    1416             : 
    1417             : #else
    1418             : #define CHECK_SYMBOL_TABLES()
    1419             : #endif
    1420             : 
    1421             : ZEND_API opcode_handler_t *zend_opcode_handlers;
    1422             : 
    1423           0 : ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC)
    1424             : {
    1425           0 :         execute_data->func->internal_function.handler(execute_data, return_value TSRMLS_CC);
    1426           0 : }
    1427             : 
    1428       87828 : ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC) /* {{{ */
    1429             : {
    1430       87828 :         if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) {
    1431           0 :                 zend_hash_destroy(&symbol_table->ht);
    1432           0 :                 efree_size(symbol_table, sizeof(zend_array));
    1433             :         } else {
    1434             :                 /* clean before putting into the cache, since clean
    1435             :                    could call dtors, which could use cached hash */
    1436       87828 :                 zend_hash_clean(&symbol_table->ht);
    1437       87828 :                 *(++EG(symtable_cache_ptr)) = symbol_table;
    1438             :         }
    1439       87828 : }
    1440             : /* }}} */
    1441             : 
    1442             : static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
    1443             : {
    1444     2061765 :         if (EXPECTED(EX(func)->op_array.last_var > 0)) {
    1445     1857034 :                 zval *cv = EX_VAR_NUM(0);
    1446     1857034 :                 zval *end = cv + EX(func)->op_array.last_var;
    1447             :                 do {
    1448             :                         zval_ptr_dtor(cv);
    1449     9954392 :                         cv++;
    1450     9954392 :                 } while (cv != end);
    1451             :         }
    1452             : }
    1453             : /* }}} */
    1454             : 
    1455          82 : void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
    1456             : {
    1457             :         i_free_compiled_variables(execute_data TSRMLS_CC);
    1458          82 : }
    1459             : /* }}} */
    1460             : 
    1461             : /*
    1462             :  * Stack Frame Layout (the whole stack frame is allocated at once)
    1463             :  * ==================
    1464             :  *
    1465             :  *                             +========================================+
    1466             :  * EG(current_execute_data) -> | zend_execute_data                      |
    1467             :  *                             +----------------------------------------+
    1468             :  *     EX_CV_NUM(0) ---------> | VAR[0] = ARG[1]                        |
    1469             :  *                             | ...                                    |
    1470             :  *                             | VAR[op_array->num_args-1] = ARG[N]     |
    1471             :  *                             | ...                                    |
    1472             :  *                             | VAR[op_array->last_var-1]              |
    1473             :  *                             | VAR[op_array->last_var] = TMP[0]       |
    1474             :  *                             | ...                                    |
    1475             :  *                             | VAR[op_array->last_var+op_array->T-1]  |
    1476             :  *                             | ARG[N+1] (extra_args)                  |
    1477             :  *                             | ...                                    |
    1478             :  *                             +----------------------------------------+
    1479             :  */
    1480             : 
    1481             : static zend_always_inline void i_init_func_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
    1482             : {
    1483             :         uint32_t first_extra_arg, num_args;
    1484             :         ZEND_ASSERT(EX(func) == (zend_function*)op_array);
    1485             :         ZEND_ASSERT(EX(scope) == EG(scope));
    1486             : 
    1487     1591266 :         EX(opline) = op_array->opcodes;
    1488     1591266 :         EX(call) = NULL;
    1489     1591266 :         EX(return_value) = return_value;
    1490     1591266 :         EX(delayed_exception) = NULL;
    1491     1591266 :         EX(silence_op_num) = -1;
    1492             : 
    1493             :         /* Handle arguments */
    1494     1591266 :         first_extra_arg = op_array->num_args;
    1495     1591266 :         if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {
    1496          45 :                 first_extra_arg--;
    1497             :         }
    1498     1591266 :         num_args = EX(num_args);
    1499     1591266 :         if (UNEXPECTED(num_args > first_extra_arg)) {
    1500             :                 zval *end, *src, *dst;
    1501             : 
    1502          97 :                 if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
    1503             :                         /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
    1504          94 :                         EX(opline) += first_extra_arg;
    1505             :                 }
    1506             : 
    1507             :                 /* move extra args into separate array after all CV and TMP vars */
    1508          97 :                 end = EX_VAR_NUM(first_extra_arg - 1);
    1509          97 :                 src = end + (num_args - first_extra_arg);
    1510          97 :                 dst = src + (op_array->last_var + op_array->T - first_extra_arg);
    1511          97 :                 if (EXPECTED(src != dst)) {
    1512             :                         do {
    1513       20173 :                                 ZVAL_COPY_VALUE(dst, src);
    1514       20173 :                                 ZVAL_UNDEF(src);
    1515       20173 :                                 src--;
    1516       20173 :                                 dst--;
    1517       20173 :                         } while (src != end);
    1518             :                 }
    1519     1591169 :         } else if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
    1520             :                 /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
    1521     1503162 :                 EX(opline) += num_args;
    1522             :         }
    1523             : 
    1524             :         /* Initialize CV variables (skip arguments) */
    1525     1591266 :         if (EXPECTED(num_args < op_array->last_var)) {
    1526      768957 :                 zval *var = EX_VAR_NUM(num_args);
    1527      768957 :                 zval *end = EX_VAR_NUM(op_array->last_var);
    1528             : 
    1529             :                 do {
    1530     4327934 :                         ZVAL_UNDEF(var);
    1531     4327934 :                         var++;
    1532     4327934 :                 } while (var != end);
    1533             :         }
    1534             : 
    1535     1591266 :         if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
    1536       97804 :                 ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
    1537       97804 :                 GC_REFCOUNT(Z_OBJ(EX(This)))++;
    1538             :         }
    1539             : 
    1540     1591266 :         if (!op_array->run_time_cache && op_array->last_cache_slot) {
    1541       13790 :                 op_array->run_time_cache = zend_arena_calloc(&CG(arena), op_array->last_cache_slot, sizeof(void*));
    1542             :         }
    1543     1591266 :         EX(run_time_cache) = op_array->run_time_cache;
    1544             : 
    1545     1591266 :         EG(current_execute_data) = execute_data;
    1546             : }
    1547             : /* }}} */
    1548             : 
    1549             : static zend_always_inline void i_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
    1550             : {
    1551             :         ZEND_ASSERT(EX(func) == (zend_function*)op_array);
    1552             : 
    1553        8971 :         EX(opline) = op_array->opcodes;
    1554        8971 :         EX(call) = NULL;
    1555        8971 :         EX(return_value) = return_value;
    1556        8971 :         EX(scope) = EG(scope);
    1557        8971 :         EX(delayed_exception) = NULL;
    1558        8971 :         EX(silence_op_num) = -1;
    1559             : 
    1560        8971 :         zend_attach_symbol_table(execute_data);
    1561             : 
    1562        8971 :         if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
    1563           1 :                 ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
    1564           1 :                 GC_REFCOUNT(Z_OBJ(EX(This)))++;
    1565             :         }
    1566             : 
    1567        8971 :         if (!op_array->run_time_cache && op_array->last_cache_slot) {
    1568        7855 :                 op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*));
    1569             :         }
    1570        8971 :         EX(run_time_cache) = op_array->run_time_cache;
    1571             : 
    1572        8971 :         EG(current_execute_data) = execute_data;
    1573             : }
    1574             : /* }}} */
    1575             : 
    1576             : static zend_always_inline void i_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
    1577             : {
    1578             :         ZEND_ASSERT(EX(func) == (zend_function*)op_array);
    1579             : 
    1580      490909 :         EX(opline) = op_array->opcodes;
    1581      490909 :         EX(call) = NULL;
    1582      490909 :         EX(return_value) = return_value;
    1583      490909 :         EX(scope) = EG(scope);
    1584      490909 :         EX(delayed_exception) = NULL;
    1585      490909 :         EX(silence_op_num) = -1;
    1586             : 
    1587      490909 :         if (UNEXPECTED(EX(symbol_table) != NULL)) {
    1588       20268 :                 zend_attach_symbol_table(execute_data);
    1589             :         } else {
    1590             :                 uint32_t first_extra_arg, num_args;
    1591             :                 
    1592             :                 /* Handle arguments */
    1593      470641 :                 first_extra_arg = op_array->num_args;
    1594      470641 :                 if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {
    1595           0 :                         first_extra_arg--;
    1596             :                 }
    1597      470641 :                 num_args = EX(num_args);
    1598      470641 :                 if (UNEXPECTED(num_args > first_extra_arg)) {
    1599             :                         zval *end, *src, *dst;
    1600             : 
    1601         972 :                         if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
    1602             :                                 /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
    1603         970 :                                 EX(opline) += first_extra_arg;
    1604             :                         }
    1605             : 
    1606             :                         /* move extra args into separate array after all CV and TMP vars */
    1607         972 :                         end = EX_VAR_NUM(first_extra_arg - 1);
    1608         972 :                         src = end + (num_args - first_extra_arg);
    1609         972 :                         dst = src + (op_array->last_var + op_array->T - first_extra_arg);
    1610         972 :                         if (EXPECTED(src != dst)) {
    1611             :                                 do {
    1612        1297 :                                         ZVAL_COPY_VALUE(dst, src);
    1613        1297 :                                         ZVAL_UNDEF(src);
    1614        1297 :                                         src--;
    1615        1297 :                                         dst--;
    1616        1297 :                                 } while (src != end);
    1617             :                         }
    1618      469669 :                 } else if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
    1619             :                         /* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
    1620      469652 :                         EX(opline) += num_args;
    1621             :                 }
    1622             : 
    1623             :                 /* Initialize CV variables (skip arguments) */
    1624      470641 :                 if (EXPECTED(num_args < op_array->last_var)) {
    1625      232664 :                         zval *var = EX_VAR_NUM(num_args);
    1626      232664 :                         zval *end = EX_VAR_NUM(op_array->last_var);
    1627             : 
    1628             :                         do {
    1629      671495 :                                 ZVAL_UNDEF(var);
    1630      671495 :                                 var++;
    1631      671495 :                         } while (var != end);
    1632             :                 }
    1633             :         }
    1634             : 
    1635      490909 :         if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
    1636       17466 :                 ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
    1637       17466 :                 GC_REFCOUNT(Z_OBJ(EX(This)))++;
    1638             :         }
    1639             : 
    1640      490909 :         if (!op_array->run_time_cache && op_array->last_cache_slot) {
    1641       19304 :                 if (op_array->function_name) {
    1642        3396 :                         op_array->run_time_cache = zend_arena_calloc(&CG(arena), op_array->last_cache_slot, sizeof(void*));
    1643             :                 } else {
    1644       17606 :                         op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*));
    1645             :                 }
    1646             :         }
    1647      490909 :         EX(run_time_cache) = op_array->run_time_cache;
    1648             : 
    1649      490909 :         EG(current_execute_data) = execute_data;
    1650             : }
    1651             : /* }}} */
    1652             : 
    1653          82 : ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data *call, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
    1654             : {
    1655             :         /*
    1656             :          * Normally the execute_data is allocated on the VM stack (because it does
    1657             :          * not actually do any allocation and thus is faster). For generators
    1658             :          * though this behavior would be suboptimal, because the (rather large)
    1659             :          * structure would have to be copied back and forth every time execution is
    1660             :          * suspended or resumed. That's why for generators the execution context
    1661             :          * is allocated using a separate VM stack, thus allowing to save and
    1662             :          * restore it simply by replacing a pointer.
    1663             :          */
    1664             :         zend_execute_data *execute_data;
    1665          82 :         uint32_t num_args = call->num_args;
    1666          82 :         size_t stack_size = (ZEND_CALL_FRAME_SLOT + MAX(op_array->last_var + op_array->T, num_args)) * sizeof(zval);
    1667             : 
    1668         164 :         EG(vm_stack) = zend_vm_stack_new_page(
    1669          82 :                 EXPECTED(stack_size < ZEND_VM_STACK_FREE_PAGE_SIZE) ?
    1670             :                         ZEND_VM_STACK_PAGE_SIZE :
    1671           0 :                         ZEND_VM_STACK_PAGE_ALIGNED_SIZE(stack_size),
    1672             :                 NULL);
    1673          82 :         EG(vm_stack_top) = EG(vm_stack)->top;
    1674          82 :         EG(vm_stack_end) = EG(vm_stack)->end;
    1675             : 
    1676         164 :         execute_data = zend_vm_stack_push_call_frame(
    1677             :                 VM_FRAME_TOP_FUNCTION,
    1678             :                 (zend_function*)op_array,
    1679             :                 num_args,
    1680             :                 call->called_scope,
    1681             :                 Z_OBJ(call->This),
    1682             :                 NULL TSRMLS_CC);
    1683          82 :         EX(num_args) = num_args;
    1684             : 
    1685             :         /* copy arguments */
    1686          82 :         if (num_args > 0) {
    1687          25 :                 zval *arg_src = ZEND_CALL_ARG(call, 1);
    1688          25 :                 zval *arg_dst = ZEND_CALL_ARG(execute_data, 1);
    1689             :                 uint32_t i;
    1690             : 
    1691          59 :                 for (i = 0; i < num_args; i++) {
    1692          34 :                         ZVAL_COPY_VALUE(arg_dst + i, arg_src + i);
    1693             :                 }
    1694             :         }
    1695             : 
    1696          82 :         EX(symbol_table) = NULL;
    1697          82 :         EX(scope) = EG(scope);
    1698             : 
    1699             :         i_init_func_execute_data(execute_data, op_array, return_value TSRMLS_CC);
    1700             : 
    1701          82 :         return execute_data;
    1702             : }
    1703             : /* }}} */
    1704             : 
    1705      470641 : ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
    1706             : {
    1707      470641 :         EX(prev_execute_data) = EG(current_execute_data);
    1708             :         i_init_execute_data(execute_data, op_array, return_value TSRMLS_CC);
    1709      470641 : }
    1710             : /* }}} */
    1711             : 
    1712             : static zend_always_inline zend_bool zend_is_by_ref_func_arg_fetch(const zend_op *opline, zend_execute_data *call TSRMLS_DC) /* {{{ */
    1713             : {
    1714        3443 :         uint32_t arg_num = opline->extended_value & ZEND_FETCH_ARG_MASK;
    1715        6886 :         return ARG_SHOULD_BE_SENT_BY_REF(call->func, arg_num);
    1716             : }
    1717             : /* }}} */
    1718             : 
    1719           3 : static zend_execute_data *zend_vm_stack_copy_call_frame(zend_execute_data *call, uint32_t passed_args, uint32_t additional_args TSRMLS_DC) /* {{{ */
    1720             : {
    1721             :         zend_execute_data *new_call;
    1722           3 :         int used_stack = (EG(vm_stack_top) - (zval*)call) + additional_args;
    1723             :                 
    1724             :         /* copy call frame into new stack segment */
    1725           3 :         new_call = zend_vm_stack_extend(used_stack * sizeof(zval) TSRMLS_CC);
    1726           3 :         *new_call = *call;
    1727           3 :         if (passed_args) {
    1728           1 :                 zval *src = ZEND_CALL_ARG(call, 1);
    1729           1 :                 zval *dst = ZEND_CALL_ARG(new_call, 1);
    1730             :                 do {
    1731       10000 :                         ZVAL_COPY_VALUE(dst, src);
    1732       10000 :                         passed_args--;
    1733       10000 :                         src++;
    1734       10000 :                         dst++;
    1735       10000 :                 } while (passed_args);
    1736             :         }
    1737             : 
    1738             :         /* delete old call_frame from previous stack segment */
    1739           3 :         EG(vm_stack)->prev->top = (zval*)call;
    1740             : 
    1741             :         /* delete previous stack segment if it becames empty */
    1742           3 :         if (UNEXPECTED(EG(vm_stack)->prev->top == ZEND_VM_STACK_ELEMETS(EG(vm_stack)->prev))) {
    1743           0 :                 zend_vm_stack r = EG(vm_stack)->prev;
    1744             : 
    1745           0 :                 EG(vm_stack)->prev = r->prev;
    1746           0 :                 efree(r);
    1747             :         }
    1748             : 
    1749           3 :         return new_call;
    1750             : }
    1751             : /* }}} */
    1752             : 
    1753             : static zend_always_inline void zend_vm_stack_extend_call_frame(zend_execute_data **call, uint32_t passed_args, uint32_t additional_args TSRMLS_DC) /* {{{ */
    1754             : {
    1755         204 :         if (EXPECTED(EG(vm_stack_end) - EG(vm_stack_top) > additional_args)) {
    1756         201 :                 EG(vm_stack_top) += additional_args;
    1757             :         } else {
    1758           3 :                 *call = zend_vm_stack_copy_call_frame(*call, passed_args, additional_args TSRMLS_CC);
    1759             :         }
    1760             : }
    1761             : /* }}} */
    1762             : 
    1763             : #define ZEND_VM_NEXT_OPCODE() \
    1764             :         CHECK_SYMBOL_TABLES() \
    1765             :         ZEND_VM_INC_OPCODE(); \
    1766             :         ZEND_VM_CONTINUE()
    1767             : 
    1768             : #define ZEND_VM_SET_OPCODE(new_op) \
    1769             :         CHECK_SYMBOL_TABLES() \
    1770             :         OPLINE = new_op
    1771             : 
    1772             : #define ZEND_VM_SET_RELATIVE_OPCODE(opline, offset) \
    1773             :         CHECK_SYMBOL_TABLES() \
    1774             :         OPLINE = ((zend_op*)(((char*)opline)+(offset)))
    1775             : 
    1776             : #define ZEND_VM_JMP(new_op) \
    1777             :         if (EXPECTED(!EG(exception))) { \
    1778             :                 ZEND_VM_SET_OPCODE(new_op); \
    1779             :         } else { \
    1780             :                 LOAD_OPLINE(); \
    1781             :         } \
    1782             :         ZEND_VM_CONTINUE()
    1783             : 
    1784             : #define ZEND_VM_INC_OPCODE() \
    1785             :         OPLINE++
    1786             : 
    1787             : #ifdef __GNUC__
    1788             : # define ZEND_VM_GUARD(name) __asm__("#" #name)
    1789             : #else
    1790             : # define ZEND_VM_GUARD(name)
    1791             : #endif
    1792             : 
    1793             : #include "zend_vm_execute.h"
    1794             : 
    1795           0 : ZEND_API int zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler)
    1796             : {
    1797           0 :         if (opcode != ZEND_USER_OPCODE) {
    1798           0 :                 if (handler == NULL) {
    1799             :                         /* restore the original handler */
    1800           0 :                         zend_user_opcodes[opcode] = opcode;
    1801             :                 } else {
    1802           0 :                         zend_user_opcodes[opcode] = ZEND_USER_OPCODE;
    1803             :                 }
    1804           0 :                 zend_user_opcode_handlers[opcode] = handler;
    1805           0 :                 return SUCCESS;
    1806             :         }
    1807           0 :         return FAILURE;
    1808             : }
    1809             : 
    1810           0 : ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode)
    1811             : {
    1812           0 :         return zend_user_opcode_handlers[opcode];
    1813             : }
    1814             : 
    1815           0 : 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 TSRMLS_DC) {
    1816           0 :         return get_zval_ptr(op_type, node, execute_data, should_free, type);
    1817             : }
    1818             : 
    1819             : /*
    1820             :  * Local variables:
    1821             :  * tab-width: 4
    1822             :  * c-basic-offset: 4
    1823             :  * indent-tabs-mode: t
    1824             :  * End:
    1825             :  */

Generated by: LCOV version 1.10

Generated at Tue, 14 Oct 2014 07:25:36 +0000 (6 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.