Bug #65845 [Csd]: Error when Zend Opcache Optimizer is fully enabled

From: Date: Thu, 10 Oct 2013 11:39:19 +0000
Subject: Bug #65845 [Csd]: Error when Zend Opcache Optimizer is fully enabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182116@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65845&edit=1 ID: 65845 Updated by: dmitry@php.net Reported by: bruno+php at ahennezel dot info Summary: Error when Zend Opcache Optimizer is fully enabled Status: Closed Type: Bug Package: opcache Operating System: Linux 3.11.2-1-ARCH PHP Version: 5.5.4 Assigned To: dmitry Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2013-10-10 11:33:29] dmitry@php.net Automatic comment on behalf of dmitry@zend.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=ef8cf76815e10db08d07897296c09b925a1511a1 Log: Fixed bug #65845 (Error when Zend Opcache Optimizer is fully enabled). ------------------------------------------------------------------------ [2013-10-10 04:29:40] laruence@php.net The following patch has been added/updated: Patch Name: bug65845.patch Revision: 1381379379 URL: https://bugs.php.net/patch-display.php?bug=65845&patch=bug65845.patch&revision=1381379379 ------------------------------------------------------------------------ [2013-10-09 16:08:02] laruence@php.net more simple reproduce script: <?php function table_valeur($table) { return $table['toto']; } $Pile['vars'][(string)'toto'] = 'tutu'; var_dump(table_valeur($Pile['vars'])); ------------------------------------------------------------------------ [2013-10-09 16:06:42] laruence@php.net I have got a fix: $ git diff diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 795b954..9ef7d8a 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -157,8 +157,8 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { if (ZEND_OP1_TYPE(opline) == IS_CONST && opline->extended_value != IS_ARRAY && opline->extended_value != IS_OBJECT && - opline->extended_value != IS_RESOURCE) { - /* cast of constant operand */ + opline->extended_value != IS_RESOURCE && + Z_TYPE(ZEND_OP1_LITERAL(opline)) != opline->extended_value) { zval res; res = ZEND_OP1_LITERAL(opline); zval_copy_ctor(&res); to Dmitry: this is because precalculted hash is lost while doing a nop cast... could you please review it? ------------------------------------------------------------------------ [2013-10-09 16:05:14] laruence@php.net sorry, I used wrong branch of opcache. and now I can reproduce that. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65845 -- Edit this bug report at https://bugs.php.net/bug.php?id=65845&edit=1

« previous php.bugs (#182116) next »