Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2f65b3f

Browse filesBrowse files
bnoordhuistargos
authored andcommitted
deps: V8: partially cherry-pick 8953e49478
Very partial cherry-pick of upstream commit v8/v8@8953e49478 that fixes a hang that shows up in debug builds because of a buggy sanity check when computing relationships between command line flags. Example of the hang: #include "v8.h" #include "libplatform/libplatform.h" int main(void) { // works: v8::V8::SetFlagsFromString("--gc-global --noincremental-marking"); v8::V8::SetFlagsFromString("--gc-global"); v8::V8::SetFlagsFromString("--noincremental-marking"); v8::V8::InitializePlatform(v8::platform::NewDefaultPlatform().release()); v8::V8::Initialize(); // hangs in ComputeFlagListHash when defined(DEBUG) } PR-URL: #55274 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 0999949 commit 2f65b3f
Copy full SHA for 2f65b3f

File tree

Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Open diff view settings
Collapse file

‎deps/v8/src/flags/flags-impl.h‎

Copy file name to clipboardExpand all lines: deps/v8/src/flags/flags-impl.h
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef V8_FLAGS_FLAGS_IMPL_H_
66
#define V8_FLAGS_FLAGS_IMPL_H_
77

8+
#include <unordered_set>
9+
810
#include "src/base/macros.h"
911
#include "src/base/optional.h"
1012
#include "src/base/vector.h"
@@ -91,9 +93,12 @@ struct Flag {
9193
#ifdef DEBUG
9294
bool ImpliedBy(const void* ptr) const {
9395
const Flag* current = this->implied_by_ptr_;
96+
std::unordered_set<const Flag*> visited_flags;
9497
while (current != nullptr) {
98+
visited_flags.insert(current);
9599
if (current->PointsTo(ptr)) return true;
96100
current = current->implied_by_ptr_;
101+
if (visited_flags.contains(current)) break;
97102
}
98103
return false;
99104
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.