summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>1999-11-17 17:21:15 +0000
committerAndi Gutmans <andi@php.net>1999-11-17 17:21:15 +0000
commit52045afb0881d645155515f2d492deb1d51cb2e2 (patch)
treebd48bf7d4e2eced09b774b01921585604f9554a9 /Zend/zend_compile.c
parent3150bd63e9472aacd84df531fcf477f829e4695a (diff)
downloadphp-git-52045afb0881d645155515f2d492deb1d51cb2e2.tar.gz
- If a function's return value is unused then don't create a ZEND_FREE
opcode but free it after the function call in zend_execute.
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 9955453190..c5483d19ee 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -623,15 +623,16 @@ void do_free(znode *op1 CLS_DC)
{
if (op1->op_type==IS_TMP_VAR) {
zend_op *last_opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
- zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
if ((last_opline->opcode == ZEND_DO_FCALL) || (last_opline->opcode == ZEND_DO_FCALL_BY_NAME)) {
last_opline->result.u.EA.type |= EXT_TYPE_UNUSED;
- }
+ } else {
+ zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
- opline->opcode = ZEND_FREE;
- opline->op1 = *op1;
- SET_UNUSED(opline->op2);
+ opline->opcode = ZEND_FREE;
+ opline->op1 = *op1;
+ SET_UNUSED(opline->op2);
+ }
} else if (op1->op_type==IS_VAR) {
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];