File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,9 @@ class InterpState final : public State, public SourceMapper {
122
122
StdAllocatorCaller getStdAllocatorCaller (StringRef Name) const ;
123
123
124
124
void *allocate (size_t Size, unsigned Align = 8 ) const {
125
- return Allocator.Allocate (Size, Align);
125
+ if (!Allocator)
126
+ Allocator.emplace ();
127
+ return Allocator->Allocate (Size, Align);
126
128
}
127
129
template <typename T> T *allocate (size_t Num = 1 ) const {
128
130
return static_cast <T *>(allocate (Num * sizeof (T), alignof (T)));
@@ -188,7 +190,7 @@ class InterpState final : public State, public SourceMapper {
188
190
// / for.
189
191
llvm::SmallVector<const Block *> InitializingBlocks;
190
192
191
- mutable llvm::BumpPtrAllocator Allocator;
193
+ mutable std::optional< llvm::BumpPtrAllocator> Allocator;
192
194
};
193
195
194
196
class InterpStateCCOverride final {
You can’t perform that action at this time.
0 commit comments