]> granicus.if.org Git - php/commitdiff
Fixed bug #52001 (Memory allocation problems after using variable variables)
authorDmitry Stogov <dmitry@php.net>
Thu, 10 Jun 2010 09:13:22 +0000 (09:13 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 10 Jun 2010 09:13:22 +0000 (09:13 +0000)
NEWS
Zend/tests/bug52001.phpt [new file with mode: 0644]
Zend/zend_compile.h

diff --git a/NEWS b/NEWS
index dfbb46cd9073b281a6b45bb3feb147713e6e55b3..38bfe84493e4ddd36eca76530cf4aa45ddc2cfa5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -69,6 +69,8 @@ PHP                                                                        NEWS
 
 - Fixed bug #52010 (open_basedir restrictions mismatch on vacuum command).
   (Ilia)
+- Fixed bug #52001 (Memory allocation problems after using variable variables).
+  (Dmitry)
 - Fixed bug #51991 (spl_autoload and *nix support with namespace). (Felipe)
 - Fixed bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with
   constant array). (Felipe)
diff --git a/Zend/tests/bug52001.phpt b/Zend/tests/bug52001.phpt
new file mode 100644 (file)
index 0000000..cf55d19
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+Bug #52001 (Memory allocation problems after using variable variables)
+--FILE--
+<?php
+a(0,$$var);
+
+$temp1=1;
+$temp2=2;
+var_dump($temp1);
+
+function a($b,$c) {}
+?>
+--EXPECTF--
+Notice: Undefined variable: var in %sbug52001.php on line 2
+
+Notice: Undefined variable:  in %sbug52001.php on line 2
+int(1)
index faff1ec691bed8d6a948f971dcb0a66a6e5a62c6..d47ff3e389465276deb8d4b1ec85ccd81b75f838 100644 (file)
@@ -687,9 +687,9 @@ int zendlex(znode *zendlval TSRMLS_DC);
 #define ZEND_CT        (1<<0)
 #define ZEND_RT (1<<1)
 
-#define ZEND_FETCH_STANDARD            0
-#define ZEND_FETCH_ADD_LOCK            (1<<0)
-#define ZEND_FETCH_MAKE_REF            (1<<1)
+#define ZEND_FETCH_STANDARD        0x00000000
+#define ZEND_FETCH_ADD_LOCK        0x08000000
+#define ZEND_FETCH_MAKE_REF        0x04000000
 
 #define ZEND_FE_FETCH_BYREF    1
 #define ZEND_FE_FETCH_WITH_KEY 2