-
Notifications
You must be signed in to change notification settings - Fork 3
/
hhvm_fixes.patch
90 lines (84 loc) · 3.33 KB
/
hhvm_fixes.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff --git a/hphp/legacy/run.sh b/hphp/legacy/run.sh
index bede609..cc75d66 100755
--- a/hphp/legacy/run.sh
+++ b/hphp/legacy/run.sh
@@ -5,6 +5,15 @@
#echo make -j $3 PROJECT_NAME=$2 TIME_LINK=1 -C $1
cp $HPHP_HOME/hphp/legacy/CMakeLists.base.txt $1/CMakeLists.txt
cd $1
+
+# If hphc was called from a makefile, don't propogate
+# environment nonsense to the child, because this breaks tests
+# I wish there was an exhaustive list of these somewhere
+unset MAKEFLAGS
+unset MAKEOVERRIDES
+unset MFLAGS
+unset MAKELEVEL
+
cmake -D PROGRAM_NAME:string=$2 . || exit $?
if [ -n "$HPHP_VERBOSE" ]; then
diff --git a/hphp/runtime/base/type_string.cpp b/hphp/runtime/base/type_string.cpp
index 0290872..fc25f4f 100644
--- a/hphp/runtime/base/type_string.cpp
+++ b/hphp/runtime/base/type_string.cpp
@@ -41,8 +41,6 @@ const StaticString empty_string("");
StringData const **String::converted_integers_raw;
StringData const **String::converted_integers;
-String::IntegerStringDataMap String::integer_string_data_map;
-
static const StringData *convert_integer_helper(int64 n) {
char tmpbuf[21];
char *p;
@@ -55,6 +53,7 @@ static const StringData *convert_integer_helper(int64 n) {
}
void String::PreConvertInteger(int64 n) {
+ IntegerStringDataMap& integer_string_data_map = GetIntegerStringDataMap();
IntegerStringDataMap::const_iterator it =
integer_string_data_map.find(n);
if (it != integer_string_data_map.end()) return;
diff --git a/hphp/runtime/base/type_string.h b/hphp/runtime/base/type_string.h
index a69d0b8..e5dd7ac 100644
--- a/hphp/runtime/base/type_string.h
+++ b/hphp/runtime/base/type_string.h
@@ -60,7 +60,13 @@ public:
static const int MaxPrecomputedInteger = 4095 + SCHAR_MIN;
static StringData const **converted_integers_raw;
static StringData const **converted_integers;
- static IntegerStringDataMap integer_string_data_map;
+
+ // see for details:
+ // https://github.com/facebook/hhvm/issues/570#issuecomment-8831861
+ static IntegerStringDataMap& GetIntegerStringDataMap() {
+ static IntegerStringDataMap integer_string_data_map;
+ return integer_string_data_map;
+ }
static bool HasConverted(int64 n) {
return MinPrecomputedInteger <= n && n <= MaxPrecomputedInteger;
@@ -84,6 +90,7 @@ public:
}
return sd;
}
+ IntegerStringDataMap& integer_string_data_map = GetIntegerStringDataMap();
IntegerStringDataMap::const_iterator it =
integer_string_data_map.find(n);
if (it != integer_string_data_map.end()) return it->second;
diff --git a/hphp/runtime/tmp/test.mk b/hphp/runtime/tmp/test.mk
index 1ad42c8..3e903e6 100644
--- a/hphp/runtime/tmp/test.mk
+++ b/hphp/runtime/tmp/test.mk
@@ -19,7 +19,7 @@ TARGET = hphp
EXTRA_RUNTIME_OPTIONS:=-vEval.Jit=$(if $(filter TestCodeRunRepoJit,$(SUITE)),1,0)
endif
-ZEND = /home/engshare/externals/cpp/hphp/centos-dev/php/bin/php
+ZEND = php
ZEND_WARN = -ddisplay_errors=stderr -dapc.enable_cli=1
ZEND_NOWARN = -ddisplay_errors=off -dapc.enable_cli=1
diff --git a/hphp/test/test_memcached_info.inc b/hphp/test/test_memcached_info.inc
index c36489a..603529e 100644
--- a/hphp/test/test_memcached_info.inc
+++ b/hphp/test/test_memcached_info.inc
@@ -1,3 +1,3 @@
// Fill the following macros with hostname and port of memcached
-#define TEST_MEMCACHED_HOSTNAME ""
+#define TEST_MEMCACHED_HOSTNAME "localhost"
#define TEST_MEMCACHED_PORT 11211