Skip to content

Commit 050ec90

Browse files
Joseph Griegofacebook-github-bot
authored andcommitted
Tag default array in TypeAliasReq
Summary: As far as I can tell, the default value is always overwritten and it triggers the provenance diagnostics instrumentation since we often don't have a vmpc set when creating these structures. Reviewed By: billf Differential Revision: D20290084 fbshipit-source-id: 0db54bd82836a044ae1613aee2492d9c6d6aa82b
1 parent 829e329 commit 050ec90

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

hphp/runtime/base/array-data-inl.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,31 +78,31 @@ ALWAYS_INLINE ArrayData* ArrayData::Create() {
7878
return staticEmptyArray();
7979
}
8080

81-
ALWAYS_INLINE ArrayData* ArrayData::CreateVArray() {
81+
ALWAYS_INLINE ArrayData* ArrayData::CreateVArray(arrprov::Tag tag /* = {} */) {
8282
return RO::EvalArrayProvenanceEmpty &&
8383
RO::EvalArrProvDVArrays
84-
? arrprov::tagStaticArr(staticEmptyVArray())
84+
? arrprov::tagStaticArr(staticEmptyVArray(), tag)
8585
: staticEmptyVArray();
8686
}
8787

88-
ALWAYS_INLINE ArrayData* ArrayData::CreateVec() {
88+
ALWAYS_INLINE ArrayData* ArrayData::CreateVec(arrprov::Tag tag /* = {} */) {
8989
return RO::EvalArrayProvenanceEmpty &&
9090
RO::EvalArrProvHackArrays
91-
? arrprov::tagStaticArr(staticEmptyVecArray())
91+
? arrprov::tagStaticArr(staticEmptyVecArray(), tag)
9292
: staticEmptyVecArray();
9393
}
9494

95-
ALWAYS_INLINE ArrayData* ArrayData::CreateDArray() {
95+
ALWAYS_INLINE ArrayData* ArrayData::CreateDArray(arrprov::Tag tag /* = {} */) {
9696
return RO::EvalArrayProvenanceEmpty &&
9797
RO::EvalArrProvDVArrays
98-
? arrprov::tagStaticArr(staticEmptyDArray())
98+
? arrprov::tagStaticArr(staticEmptyDArray(), tag)
9999
: staticEmptyDArray();
100100
}
101101

102-
ALWAYS_INLINE ArrayData* ArrayData::CreateDict() {
102+
ALWAYS_INLINE ArrayData* ArrayData::CreateDict(arrprov::Tag tag /* = {} */) {
103103
return RO::EvalArrayProvenanceEmpty &&
104104
RO::EvalArrProvHackArrays
105-
? arrprov::tagStaticArr(staticEmptyDictArray())
105+
? arrprov::tagStaticArr(staticEmptyDictArray(), tag)
106106
: staticEmptyDictArray();
107107
}
108108

hphp/runtime/base/array-data.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ struct ArrayData : MaybeCountable {
148148
* Create a new empty ArrayData with the appropriate ArrayKind.
149149
*/
150150
static ArrayData* Create();
151-
static ArrayData* CreateVec();
152-
static ArrayData* CreateDict();
151+
static ArrayData* CreateVec(arrprov::Tag tag = {});
152+
static ArrayData* CreateDict(arrprov::Tag tag = {});
153153
static ArrayData* CreateKeyset();
154-
static ArrayData* CreateVArray();
155-
static ArrayData* CreateDArray();
154+
static ArrayData* CreateVArray(arrprov::Tag tag = {});
155+
static ArrayData* CreateDArray(arrprov::Tag tag = {});
156156

157157
/*
158158
* Create a new kPackedKind ArrayData with a single element, `value'.

hphp/runtime/vm/type-alias.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct TypeAlias {
5555
AnnotType type;
5656
bool nullable; // null is allowed; for ?Foo aliases
5757
UserAttributeMap userAttrs;
58-
Array typeStructure{Array::CreateDArray()};
58+
Array typeStructure{ArrayData::CreateDArray(ARRPROV_HERE())};
5959

6060
template<class SerDe>
6161
typename std::enable_if<!SerDe::deserializing>::type
@@ -135,7 +135,7 @@ struct TypeAliasReq {
135135
LowPtr<RecordDesc> rec{nullptr};
136136
// Needed for error messages; nullptr if not defined.
137137
LowStringPtr name{nullptr};
138-
Array typeStructure{Array::CreateDArray()};
138+
Array typeStructure{ArrayData::CreateDArray(ARRPROV_HERE())};
139139
UserAttributeMap userAttrs;
140140
Unit* unit{nullptr};
141141
};

0 commit comments

Comments
 (0)