summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2010-06-10 09:13:22 +0000
committerDmitry Stogov <dmitry@php.net>2010-06-10 09:13:22 +0000
commitcac310d87e5b75a6ded397ba0857f8a8abb7bc18 (patch)
treeed85a5f58b17019e796a076537f32fa7a6697e2e
parent442fa8dc1be1264f25beac50d1ed2fc28107e3b8 (diff)
downloadphp-git-cac310d87e5b75a6ded397ba0857f8a8abb7bc18.tar.gz
Fixed bug #52001 (Memory allocation problems after using variable variables)
-rw-r--r--NEWS2
-rw-r--r--Zend/tests/bug52001.phpt17
-rw-r--r--Zend/zend_compile.h6
3 files changed, 22 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index dfbb46cd90..38bfe84493 100644
--- 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
index 0000000000..cf55d195b9
--- /dev/null
+++ b/Zend/tests/bug52001.phpt
@@ -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)
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index faff1ec691..d47ff3e389 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -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