cvs: ZendEngine2(PHP_5_2) / zend_execute.c
| From: | Antony Dovgal | Date: | Thu, 01 Jun 2006 11:56:44 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_2) / zend_execute.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4960@lists.php.net to get a copy of this message | ||
tony2001 Thu Jun 1 11:56:44 2006 UTC
Modified files: (Branch: PHP_5_2)
/ZendEngine2 zend_execute.c
Log:
MFH: throw a warning when using invalid offset types with strings
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.716.2.12.2.7&r2=1.716.2.12.2.8&diff_format=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.716.2.12.2.7 ZendEngine2/zend_execute.c:1.716.2.12.2.8
--- ZendEngine2/zend_execute.c:1.716.2.12.2.7 Sat May 27 18:04:13 2006
+++ ZendEngine2/zend_execute.c Thu Jun 1 11:56:44 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.716.2.12.2.7 2006/05/27 18:04:13 helly Exp $ */
+/* $Id: zend_execute.c,v 1.716.2.12.2.8 2006/06/01 11:56:44 tony2001 Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -1016,6 +1016,19 @@
}
if (Z_TYPE_P(dim) != IS_LONG) {
+ switch(Z_TYPE_P(dim)) {
+ /* case IS_LONG: */
+ case IS_STRING:
+ case IS_DOUBLE:
+ case IS_NULL:
+ case IS_BOOL:
+ /* do nothing */
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type");
+ break;
+ }
+
tmp = *dim;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);