Commit 81d7b164 authored by Dan Elphick's avatar Dan Elphick Committed by V8 LUCI CQ

[msvc] Fix debug build due to nodiscard

Adds a USE(...) around a std::accumulate which appears to have nodiscard
on it in MSVC builds. Probably only manifests with debug flags on as
otherwise code is not compiled.

Change-Id: I78f4f2c07161598336fedcdd4a204379c4deb81b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3141579
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76671}
parent 5681a656
......@@ -667,12 +667,13 @@ class CheckWritableMemoryRegions {
DCHECK(std::none_of(writable_memory_.begin(), writable_memory_.end(),
[](auto region) { return region.is_empty(); }));
// Regions are sorted and disjoint.
std::accumulate(writable_memory_.begin(), writable_memory_.end(),
// Regions are sorted and disjoint. (std::accumulate has nodiscard on msvc
// so USE is required to prevent build failures in debug builds).
USE(std::accumulate(writable_memory_.begin(), writable_memory_.end(),
Address{0}, [](Address previous_end, auto region) {
DCHECK_LT(previous_end, region.begin());
return region.end();
});
}));
}
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment