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 {
122122 StdAllocatorCaller getStdAllocatorCaller (StringRef Name) const ;
123123
124124 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);
126128 }
127129 template <typename T> T *allocate (size_t Num = 1 ) const {
128130 return static_cast <T *>(allocate (Num * sizeof (T), alignof (T)));
@@ -188,7 +190,7 @@ class InterpState final : public State, public SourceMapper {
188190 // / for.
189191 llvm::SmallVector<const Block *> InitializingBlocks;
190192
191- mutable llvm::BumpPtrAllocator Allocator;
193+ mutable std::optional< llvm::BumpPtrAllocator> Allocator;
192194};
193195
194196class InterpStateCCOverride final {
You can’t perform that action at this time.
0 commit comments