Skip to content

Commit ee3b0e5

Browse files
committed
try addaleax workaround
1 parent aff4494 commit ee3b0e5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

deps/v8/src/heap/base/stack.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ void Stack::IteratePointers(StackVisitor* visitor) const {
172172
visitor, reinterpret_cast<const void* const*>(context_->stack_marker),
173173
stack_start_, asan_fake_stack);
174174

175-
for (const auto& stack : inactive_stacks_) {
176-
IteratePointersInStack(visitor, stack.top, stack.start, asan_fake_stack);
175+
if (inactive_stacks_) {
176+
for (const auto& stack : *inactive_stacks_) {
177+
IteratePointersInStack(visitor, stack.top, stack.start, asan_fake_stack);
178+
}
177179
}
178180

179181
IterateUnsafeStackIfNecessary(visitor);
@@ -234,9 +236,12 @@ void Stack::ClearContext(bool check_invariant) {
234236

235237
void Stack::AddStackSegment(const void* start, const void* top) {
236238
DCHECK_LE(top, start);
237-
inactive_stacks_.push_back({start, top});
239+
if (!inactive_stacks_) {
240+
inactive_stacks_ = std::make_unique<std::remove_reference_t<decltype(*inactive_stacks_)>>();
241+
}
242+
inactive_stacks_->push_back({start, top});
238243
}
239244

240-
void Stack::ClearStackSegments() { inactive_stacks_.clear(); }
245+
void Stack::ClearStackSegments() { if (inactive_stacks_) inactive_stacks_->clear(); }
241246

242247
} // namespace heap::base

deps/v8/src/heap/base/stack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class V8_EXPORT_PRIVATE Stack final {
124124
const void* start;
125125
const void* top;
126126
};
127-
std::vector<StackSegments> inactive_stacks_;
127+
std::unique_ptr<std::vector<StackSegments>> inactive_stacks_;
128128
};
129129

130130
} // namespace heap::base

0 commit comments

Comments
 (0)