summaryrefslogtreecommitdiff
path: root/packaging/0016-Fix-copying-of-FieldMarshaler-structures-in-EEClassL.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/0016-Fix-copying-of-FieldMarshaler-structures-in-EEClassL.patch')
-rw-r--r--packaging/0016-Fix-copying-of-FieldMarshaler-structures-in-EEClassL.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/packaging/0016-Fix-copying-of-FieldMarshaler-structures-in-EEClassL.patch b/packaging/0016-Fix-copying-of-FieldMarshaler-structures-in-EEClassL.patch
new file mode 100644
index 0000000..4b05131
--- /dev/null
+++ b/packaging/0016-Fix-copying-of-FieldMarshaler-structures-in-EEClassL.patch
@@ -0,0 +1,42 @@
+From 1c2a01cd07c9893ea296794d4df542092759ed94 Mon Sep 17 00:00:00 2001
+From: Ruben Ayrapetyan <r.ayrapetyan@samsung.com>
+Date: Fri, 7 Jul 2017 15:54:14 +0300
+Subject: [PATCH 16/32] Fix copying of FieldMarshaler structures in
+ EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing.
+
+Related issue: #12643
+---
+ src/vm/fieldmarshaler.cpp | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/src/vm/fieldmarshaler.cpp b/src/vm/fieldmarshaler.cpp
+index 9415b94..0685093 100644
+--- a/src/vm/fieldmarshaler.cpp
++++ b/src/vm/fieldmarshaler.cpp
+@@ -1606,11 +1606,19 @@ VOID EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing(
+ {
+ CONSISTENCY_CHECK(fParentHasLayout);
+ PREFAST_ASSUME(pParentLayoutInfo != NULL); // See if (fParentHasLayout) branch above
+-
++
+ UINT numChildCTMFields = pEEClassLayoutInfoOut->m_numCTMFields - pParentLayoutInfo->m_numCTMFields;
+- memcpyNoGCRefs( ((BYTE*)pEEClassLayoutInfoOut->GetFieldMarshalers()) + MAXFIELDMARSHALERSIZE*numChildCTMFields,
+- pParentLayoutInfo->GetFieldMarshalers(),
+- MAXFIELDMARSHALERSIZE * (pParentLayoutInfo->m_numCTMFields) );
++
++ BYTE *pParentCTMFieldSrcArray = (BYTE*)pParentLayoutInfo->GetFieldMarshalers();
++ BYTE *pParentCTMFieldDestArray = ((BYTE*)pEEClassLayoutInfoOut->GetFieldMarshalers()) + MAXFIELDMARSHALERSIZE*numChildCTMFields;
++
++ for (UINT parentCTMFieldIndex = 0; parentCTMFieldIndex < pParentLayoutInfo->m_numCTMFields; parentCTMFieldIndex++)
++ {
++ FieldMarshaler *pParentCTMFieldSrc = (FieldMarshaler *)(pParentCTMFieldSrcArray + MAXFIELDMARSHALERSIZE*parentCTMFieldIndex);
++ FieldMarshaler *pParentCTMFieldDest = (FieldMarshaler *)(pParentCTMFieldDestArray + MAXFIELDMARSHALERSIZE*parentCTMFieldIndex);
++
++ pParentCTMFieldSrc->CopyTo(pParentCTMFieldDest, MAXFIELDMARSHALERSIZE);
++ }
+ }
+
+ }
+--
+2.7.4
+