summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-06-21 12:05:23 +0000
committerDmitry Stogov <dmitry@php.net>2005-06-21 12:05:23 +0000
commitd1b80a614af4b98e812edd66f8056aa27b59b7dd (patch)
tree680666d6c6b9d5c8a760d95382d5c5cc045918f7 /Zend/zend_compile.c
parent0857ef4e0e00363ac14469067ac00f7dcdb7f388 (diff)
downloadphp-git-d1b80a614af4b98e812edd66f8056aa27b59b7dd.tar.gz
Remove unnecessary ZEND_FETCH_CLASS together with ZEND_DECLARE_INHERITED_CLASS
in case of early binding
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 16b24ca17a..67a6d27e1c 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2190,6 +2190,19 @@ void zend_do_early_binding(TSRMLS_D)
if (do_bind_inherited_class(opline, CG(class_table), *pce, 1 TSRMLS_CC) == NULL) {
return;
}
+ /* clear unnecessary ZEND_FETCH_CLASS opcode */
+ if (opline > CG(active_op_array)->opcodes &&
+ (opline-1)->opcode == ZEND_FETCH_CLASS) {
+ zend_op *fetch_class_opline = opline-1;
+
+ zval_dtor(&fetch_class_opline->op2.u.constant);
+ fetch_class_opline->opcode = ZEND_NOP;
+ memset(&fetch_class_opline->op1, 0, sizeof(znode));
+ memset(&fetch_class_opline->op2, 0, sizeof(znode));
+ SET_UNUSED(fetch_class_opline->op1);
+ SET_UNUSED(fetch_class_opline->op2);
+ SET_UNUSED(fetch_class_opline->result);
+ }
} else {
/* We currently don't early-bind classes that implement interfaces */
return;