summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2004-10-04 19:54:35 +0000
committerAndi Gutmans <andi@php.net>2004-10-04 19:54:35 +0000
commitdb507dd153fa668fef95863afee4d04f33b80b85 (patch)
tree67ffc59fbd97a93c94e37ae6a8cb735b6755e221 /Zend/zend_opcode.c
parentbb77132391aaeb07daa0e057ea5c11cdb151dfda (diff)
downloadphp-git-db507dd153fa668fef95863afee4d04f33b80b85.tar.gz
- Commit the variable fetch optimization.
- Extensions which delete global variables need to use new special function - delete_global_variable() (I'm about to rename it) to remove them. - Will post to internals@ or via commit messages if there's anything else.
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 0c47ceaa50..22d03ac8ee 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -67,6 +67,10 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz
op_array->opcodes = NULL;
op_array_alloc_ops(op_array);
+ op_array->size_var = 0; /* FIXME:??? */
+ op_array->last_var = 0;
+ op_array->vars = NULL;
+
op_array->T = 0;
op_array->function_name = NULL;
@@ -209,6 +213,15 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
efree(op_array->refcount);
+ if (op_array->vars) {
+ i = op_array->last_var;
+ while (i > 0) {
+ i--;
+ efree(op_array->vars[i].name);
+ }
+ efree(op_array->vars);
+ }
+
while (opline<end) {
if (opline->op1.op_type==IS_CONST) {
#if DEBUG_ZEND>2