php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43696 op2 of OP_DATA which after INIT_NS_FCALL_BY_NAME is uninitialized
Submitted: 2007-12-28 09:07 UTC Modified: 2007-12-28 14:56 UTC
From: phpxcache at gmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2007-12-28 (CVS) OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpxcache at gmail dot com
New email:
PHP Version: OS:

 

 [2007-12-28 09:07 UTC] phpxcache at gmail dot com
Description:
------------
as you can see in zend_compile.c
        opline->opcode = ZEND_INIT_NS_FCALL_BY_NAME;
ZEND_INIT_NS_FCALL_BY_NAME's op1 is initialized, so is op2
.........
        opline->opcode = ZEND_OP_DATA;
ZEND_OP_DATA's op1 is initialized here but op2 is not

it may not cause problem in zend executor but may in opcode optimizers/cachers

suggested fix:
Index: zend_compile.c
===================================================================
RCS file: /repository/ZendEngine2/zend_compile.c,v
retrieving revision 1.647.2.27.2.41.2.32
diff -u -r1.647.2.27.2.41.2.32 zend_compile.c
--- zend_compile.c  27 Dec 2007 13:52:05 -0000  1.647.2.27.2.41.2.32
+++ zend_compile.c  28 Dec 2007 08:56:41 -0000
@@ -1504,6 +1504,7 @@
        Z_TYPE(opline->op1.u.constant) = IS_STRING;
        Z_STRLEN(opline->op1.u.constant) = Z_STRLEN(function_name->u.constant) - prefix_len;
        Z_STRVAL(opline->op1.u.constant) = zend_str_tolower_dup(Z_STRVAL(function_name->u.constant) + prefix_len, Z_STRLEN(opline->op1.u.constant));
+       SET_UNUSED(opline->op2);
        opline->extended_value = zend_hash_func(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant) + 1);
    } else {
        opline->opcode = ZEND_INIT_FCALL_BY_NAME;



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-28 14:56 UTC] felipe@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 01:01:29 2025 UTC