From 37070745728cd7744e12fa5110cde304ab6a048d Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 15 Sep 2020 16:55:19 +0200 Subject: [PATCH] GCC: avoid GCC getting confused with wrong using resolution in CrossThreadPersistent In the method to assign a CrossThreadWeakPersistent to a CrossThreadPersistent, there is a call to the parent class implementation of Get. It uses Parent, that is, in CrossThreadPersistent an alias to its parent. GCC resolves it as that, but that's wrong, and it should resolve to the parent of CrossThreadWeakPersistent. To avoid the problem, we define in that method ParentU resolving to the right parent, and use a static cast to it. Bug: 819294 Change-Id: I0152dac92d4a28eb1f1abbc56473204b62f33797 --- diff --git a/third_party/blink/renderer/platform/heap/persistent.h b/third_party/blink/renderer/platform/heap/persistent.h index f08f42f..32cadc0 100644 --- a/third_party/blink/renderer/platform/heap/persistent.h +++ b/third_party/blink/renderer/platform/heap/persistent.h @@ -784,7 +784,9 @@ CrossThreadPersistent& CrossThreadPersistent::operator=( const CrossThreadWeakPersistent& other) { MutexLocker locker(ProcessHeap::CrossThreadPersistentMutex()); - this->AssignUnsafe(other.Parent::Get()); + using ParentU = PersistentBase; + this->AssignUnsafe(static_cast(other).Get()); return *this; }