cvs: ZendEngine2 / zend_execute.c
| From: | Antony Dovgal | Date: | Thu, 01 Jun 2006 11:56:23 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4959@lists.php.net to get a copy of this message | ||
tony2001 Thu Jun 1 11:56:23 2006 UTC
Modified files:
/ZendEngine2 zend_execute.c
Log:
throw a warning when using invalid offset types with strings
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.745&r2=1.746&diff_format=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.745 ZendEngine2/zend_execute.c:1.746
--- ZendEngine2/zend_execute.c:1.745 Fri May 26 00:26:44 2006
+++ ZendEngine2/zend_execute.c Thu Jun 1 11:56:23 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.745 2006/05/26 00:26:44 helly Exp $ */
+/* $Id: zend_execute.c,v 1.746 2006/06/01 11:56:23 tony2001 Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -1112,6 +1112,20 @@
}
if (Z_TYPE_P(dim) != IS_LONG) {
+ switch(Z_TYPE_P(dim)) {
+ /* case IS_LONG: */
+ case IS_STRING:
+ case IS_UNICODE:
+ 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);