WebKit-JavaScriptCore-clang-6-fix.patch 2.28 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
From 798c5c2ba53396ed9a885e74228e534a9cf963c8 Mon Sep 17 00:00:00 2001
From: "mark.lam@apple.com"
 <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri, 22 Jun 2018 03:01:52 +0000
Subject: [PATCH] =?UTF-8?q?WebKit=20(JavaScriptCore)=20compilation=20error?=
 =?UTF-8?q?=20with=20Clang=20=E2=89=A5=206.=20https://bugs.webkit.org/show?=
 =?UTF-8?q?=5Fbug.cgi=3Fid=3D185947=20<rdar://problem/40131933>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed by Saam Barati.

Newer Clang versions (due to C++17 support) is not happy with how I implemented
conversions between CodeLocation types.  We'll fix this by adding a conversion
operator for converting between CodeLocation types.

* assembler/CodeLocation.h:
(JSC::CodeLocationCommon::operator T):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@233070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
---
 Source/JavaScriptCore/ChangeLog                | 15 +++++++++++++++
 Source/JavaScriptCore/assembler/CodeLocation.h |  6 ++++++
 2 files changed, 21 insertions(+)

2018-06-21  Mark Lam  <mark.lam@apple.com>

        WebKit (JavaScriptCore) compilation error with Clang ≥ 6.
        https://bugs.webkit.org/show_bug.cgi?id=185947
        <rdar://problem/40131933>

        Reviewed by Saam Barati.

        Newer Clang versions (due to C++17 support) is not happy with how I implemented
        conversions between CodeLocation types.  We'll fix this by adding a conversion
        operator for converting between CodeLocation types.

        * assembler/CodeLocation.h:
        (JSC::CodeLocationCommon::operator T):

diff --git a/Source/JavaScriptCore/assembler/CodeLocation.h b/Source/JavaScriptCore/assembler/CodeLocation.h
index 75446df3dc2..41d251e73f0 100644
--- a/Source/JavaScriptCore/assembler/CodeLocation.h
+++ b/Source/JavaScriptCore/assembler/CodeLocation.h
@@ -71,6 +71,12 @@ public:
     template<typename T = void*>
     T dataLocation() const { return Base::template dataLocation<T>(); }
 
+    template<typename T, typename = std::enable_if_t<std::is_base_of<CodeLocationCommon<tag>, T>::value>>
+    operator T()
+    {
+        return T(MacroAssemblerCodePtr<tag>::createFromExecutableAddress(this->executableAddress()));
+    }
+
 protected:
     CodeLocationCommon()
     {
-- 
2.18.0