summaryrefslogtreecommitdiff
path: root/packaging/0020-Add-FixupPlainOrRelativePointerField-for-MethodDesc-.patch
blob: 91b0639ea9a54280e9cbb1156ff74dd22851eda6 (plain)
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
From 0d08b9471178521765ea41dff5f95ea49f5e10c5 Mon Sep 17 00:00:00 2001
From: Gleb Balykov <g.balykov@samsung.com>
Date: Wed, 21 Jun 2017 20:53:41 +0300
Subject: [PATCH 20/32] Add FixupPlainOrRelativePointerField for MethodDesc
 fields

---
 src/vm/method.cpp | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/src/vm/method.cpp b/src/vm/method.cpp
index 1407264..6bd49fb 100644
--- a/src/vm/method.cpp
+++ b/src/vm/method.cpp
@@ -3651,14 +3651,7 @@ MethodDesc::Fixup(
             }
         }
 
-        if (decltype(InstantiatedMethodDesc::m_pPerInstInfo)::isRelative)
-        {
-            image->FixupRelativePointerField(this, offsetof(InstantiatedMethodDesc, m_pPerInstInfo));
-        }
-        else
-        {
-            image->FixupPointerField(this, offsetof(InstantiatedMethodDesc, m_pPerInstInfo));
-        }
+        image->FixupPlainOrRelativePointerField((InstantiatedMethodDesc*) this, &InstantiatedMethodDesc::m_pPerInstInfo);
 
         // Generic methods are dealt with specially to avoid encoding the formal method type parameters
         if (IsTypicalMethodDefinition())
@@ -3737,14 +3730,7 @@ MethodDesc::Fixup(
 
         NDirectMethodDesc *pNMD = (NDirectMethodDesc *)this;
 
-        if (decltype(NDirectMethodDesc::ndirect.m_pWriteableData)::isRelative)
-        {
-            image->FixupRelativePointerField(this, offsetof(NDirectMethodDesc, ndirect.m_pWriteableData));
-        }
-        else
-        {
-            image->FixupPointerField(this, offsetof(NDirectMethodDesc, ndirect.m_pWriteableData));
-        }
+        image->FixupPlainOrRelativePointerField(pNMD, &NDirectMethodDesc::ndirect, &decltype(NDirectMethodDesc::ndirect)::m_pWriteableData);
 
         NDirectWriteableData *pWriteableData = pNMD->GetWriteableData();
         NDirectImportThunkGlue *pImportThunkGlue = pNMD->GetNDirectImportThunkGlue();
-- 
2.7.4