@@ -147,19 +147,24 @@ struct DeferredFunctionStub
147147 // capturedNamePointers is not nullptr.
148148 Field (uint) capturedNameCount;
149149
150- // After the parser memory is cleaned-up, we no longer have access to
151- // the IdentPtrs allocated from the Parser arena. We keep a list of
152- // ids into the string table deserialized from the parser state cache.
153- // This list is Recycler-allocated.
154- Field (int *) capturedNameSerializedIds;
155-
156- // The set of names which are captured by this function.
157- // A function captures a name when it references a name not defined within
158- // the function.
159- // A function also captures all names captured by nested functions.
160- // The IdentPtrs in this set and the set itself are allocated from Parser
161- // arena memory.
162- Field (IdentPtrSet *) capturedNamePointers;
150+ // Note: We only need to access either the list of serialized ids or the
151+ // set of IdentPtr captured names so these are in a union.
152+ union
153+ {
154+ // After the parser memory is cleaned-up, we no longer have access to
155+ // the IdentPtrs allocated from the Parser arena. We keep a list of
156+ // ids into the string table deserialized from the parser state cache.
157+ // This list is Recycler-allocated.
158+ Field (int *) capturedNameSerializedIds;
159+
160+ // The set of names which are captured by this function.
161+ // A function captures a name when it references a name not defined within
162+ // the function.
163+ // A function also captures all names captured by nested functions.
164+ // The IdentPtrs in this set and the set itself are allocated from Parser
165+ // arena memory.
166+ Field (IdentPtrSet *) capturedNamePointers;
167+ };
163168
164169 // List of deferred stubs for further nested functions.
165170 // Length of this list is equal to nestedCount.
0 commit comments