Commit 5cb6033a authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

Check for __has_feature() macro to fix MSVC compile

Bug: v8:12165
Change-Id: I6852686d67fac46fab536e93f8a63843f0580d3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3251172Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77606}
parent 34c0f0fc
......@@ -802,12 +802,14 @@ bool GlobalHandles::OnStackTracedNodeSpace::IsOnStack(uintptr_t slot) const {
return true;
}
#endif // V8_USE_ADDRESS_SANITIZER
#if defined(__has_feature)
#if __has_feature(safe_stack)
if (reinterpret_cast<uintptr_t>(__builtin___get_unsafe_stack_top()) >= slot &&
slot > reinterpret_cast<uintptr_t>(__builtin___get_unsafe_stack_ptr())) {
return true;
}
#endif // __has_feature(safe_stack)
#endif // defined(__has_feature)
return stack_start_ >= slot && slot > base::Stack::GetCurrentStackPosition();
}
......
......@@ -32,12 +32,14 @@ bool Stack::IsOnStack(void* slot) const {
// Fall through as there is still a regular stack present even when running
// with ASAN fake stacks.
#endif // V8_USE_ADDRESS_SANITIZER
#if defined(__has_feature)
#if __has_feature(safe_stack)
if (__builtin___get_unsafe_stack_top() >= slot &&
slot > __builtin___get_unsafe_stack_ptr()) {
return true;
}
#endif // __has_feature(safe_stack)
#endif // defined(__has_feature)
return v8::base::Stack::GetCurrentStackPosition() <= slot &&
slot <= stack_start_;
}
......
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