Fix PerformCastCheck on v8::Data (again)
See crrev.com/c/2383030 PerformCheckCast<Data>() itself should not invoke Data::Cast(), since there is no such method and every publicly available value can be casted to it anyway. This is an issue in e.g. GetDataFromSnapshotOnce<Data>(). Change-Id: I4acbff86ffd4537b744dafc588733428e792b4bd Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2399052 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Gus Caplan <snek@chromium.org> Cr-Commit-Position: refs/heads/master@{#69771}
This commit is contained in:
parent
92236da279
commit
74ede07103
@ -415,7 +415,7 @@ void CastCheck<false>::Perform(T* data) {}
|
|||||||
template <class T>
|
template <class T>
|
||||||
V8_INLINE void PerformCastCheck(T* data) {
|
V8_INLINE void PerformCastCheck(T* data) {
|
||||||
CastCheck<std::is_base_of<Data, T>::value &&
|
CastCheck<std::is_base_of<Data, T>::value &&
|
||||||
!std::is_same<Data, std::remove_cv<T>>::value>::Perform(data);
|
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// A base class for backing stores, which is needed due to vagaries of
|
// A base class for backing stores, which is needed due to vagaries of
|
||||||
|
@ -3389,6 +3389,12 @@ UNINITIALIZED_TEST(SnapshotCreatorAddData) {
|
|||||||
DisableEmbeddedBlobRefcounting();
|
DisableEmbeddedBlobRefcounting();
|
||||||
v8::StartupData blob;
|
v8::StartupData blob;
|
||||||
|
|
||||||
|
// i::PerformCastCheck(Data*) should compile and be no-op
|
||||||
|
{
|
||||||
|
v8::Local<v8::Data> data;
|
||||||
|
i::PerformCastCheck(*data);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
v8::SnapshotCreator creator;
|
v8::SnapshotCreator creator;
|
||||||
v8::Isolate* isolate = creator.GetIsolate();
|
v8::Isolate* isolate = creator.GetIsolate();
|
||||||
|
Loading…
Reference in New Issue
Block a user