ID: 30074
Comment by: shire at facebook dot com
Reported By: owen dot beresford at murphx dot com
Status: No Feedback
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 5.0.1
New Comment:
I forgot to specify that in this case extract is setting the
EG(uninitialized_zval_ptr)->is_ref = 1, causing further problems later
in the code.
Previous Comments:
------------------------------------------------------------------------
[2006-12-10 00:54:25] shire at facebook dot com
I'm able to reproduce this using current CVS. The problem appears to
be when a CV value is passed into extract() either as the array or an
array value. Looks like in this case the IS_CV value is assigned to
EG(uninitialized_zval_ptr). The following patch will correct the
problem for this case (and still pass a php 'make test'). However I'm
not familiar enough with CV to know if there's a better way to correct
to this problem:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index fad4bf2..fdc9a88 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1438,7 +1438,7 @@ PHP_FUNCTION(extract)
*orig_var = *entry;
} else {
- if
((*var_array)->refcount > 1) {
+ if
((*var_array)->refcount > 1 || *entry == EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
} else {
(*entry)->is_ref = 1;
------------------------------------------------------------------------
[2005-06-15 23:06:27] t3 at rohms dot com
Has this bug been fixed in a release yet? I'd like to see comments
added to these to indicate so and with what versions.
------------------------------------------------------------------------
[2005-03-15 01:00:12] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-03-07 21:42:05] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-01-29 21:36:34] t3 at rohms dot com
I believe my problem may be related; I also filed a <a
href="http://bugs.php.net/?id=31753">report</a> but not every isntance
of extract() was causing problems. I was running 4.3.6 with no
problems; upgraded to 4.3.10 and code didn't work; updated to latest
version of zend; didn't work; downgraded back to 4.3.6, didn't work;
downgraded to 4.3.6 and switched back to previous version of zend:
worked. It seems that the new version of zend may be invovled in the
problem. I wonder if turning down the optimization level would help?
------------------------------------------------------------------------
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
http://bugs.php.net/30074
--
Edit this bug report at http://bugs.php.net/?id=30074&edit=1