diff options
author | Dmitry Stogov <dmitry@php.net> | 2008-04-29 08:15:20 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2008-04-29 08:15:20 +0000 |
commit | 2ecf4bb0a7c66bc882ff82d66d86ac6be5bffdf7 (patch) | |
tree | 128afacc2d1cf3234b0f59dccb3bf63633f0c7e7 /Zend/zend_vm_execute.skl | |
parent | c75658c477cead4cb7c4a9ae6a72c6d8a1d98cee (diff) | |
download | php-git-2ecf4bb0a7c66bc882ff82d66d86ac6be5bffdf7.tar.gz |
Lazy EG(active_symbol_table) initialization
Diffstat (limited to 'Zend/zend_vm_execute.skl')
-rw-r--r-- | Zend/zend_vm_execute.skl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index a32b34a701..32e26aff56 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -14,12 +14,12 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) /* Initialize execute_data */ execute_data = (zend_execute_data *)zend_vm_stack_alloc( sizeof(zend_execute_data) + - sizeof(zval**) * op_array->last_var + + sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2) + sizeof(temp_variable) * op_array->T TSRMLS_CC); EX(CVs) = (zval***)((char*)execute_data + sizeof(zend_execute_data)); memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var); - EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var); + EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var * (EG(active_symbol_table) ? 1 : 2)); EX(fbc) = NULL; EX(called_scope) = NULL; EX(object) = NULL; @@ -37,7 +37,7 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) ZEND_VM_SET_OPCODE(op_array->opcodes); } - if (op_array->uses_this && EG(This)) { + if (op_array->uses_this && EG(This) && EG(active_symbol_table)) { Z_ADDREF_P(EG(This)); /* For $this pointer */ if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { Z_DELREF_P(EG(This)); |