From: Dmitry Stogov Date: Fri, 3 Jun 2005 15:02:49 +0000 (+0000) Subject: Fixed bug #30080 (Passing array or non array of objects) X-Git-Tag: php-5.0.1b1~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89e53d5ab231b64163d7908aa0259019f439b1c9;p=php Fixed bug #30080 (Passing array or non array of objects) --- diff --git a/Zend/tests/bug30080.phpt b/Zend/tests/bug30080.phpt new file mode 100755 index 0000000000..bd8401e1be --- /dev/null +++ b/Zend/tests/bug30080.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #30080 (Passing array or non array of objects) +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + object(stdClass)#2 (0) { + } +} diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d2afe43b6b..31cded48c5 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -972,7 +972,8 @@ void zend_do_free(znode *op1 TSRMLS_DC) * Find JMP_NO_CTOR, mark the preceding ASSIGN and the * proceeding INIT_FCALL_BY_NAME as unused */ - if (opline->opcode == ZEND_JMP_NO_CTOR) { + if (opline->opcode == ZEND_JMP_NO_CTOR && + opline->op1.u.var == op1->u.var) { opline->op1.u.EA.type |= EXT_TYPE_UNUSED; (opline-1)->result.u.EA.type |= EXT_TYPE_UNUSED; (opline+1)->op1.u.EA.type |= EXT_TYPE_UNUSED;