Skip to content

Commit c1caa8f

Browse files
committed
Update CLR_RT_Interop.cpp
Speculative fix (may need improvement).
1 parent 7ff868b commit c1caa8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/CLR/Core/CLR_RT_Interop.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ unsigned int &Interop_Marshal_GetField_UINT32(CLR_RT_HeapBlock *pThis, unsigned
891891

892892
unsigned __int64 &Interop_Marshal_GetField_UINT64(CLR_RT_HeapBlock *pThis, unsigned int fieldIndex)
893893
{
894-
return (unsigned __int64 &)pThis[fieldIndex].NumericByRef().u8;
894+
return *reinterpret_cast<unsigned __int64 *>(&pThis[fieldIndex].NumericByRef().u8);
895895
}
896896

897897
#ifdef __GNUC__
@@ -925,7 +925,7 @@ signed int &Interop_Marshal_GetField_INT32(CLR_RT_HeapBlock *pThis, unsigned int
925925

926926
signed __int64 &Interop_Marshal_GetField_INT64(CLR_RT_HeapBlock *pThis, unsigned int fieldIndex)
927927
{
928-
return (signed __int64 &)pThis[fieldIndex].NumericByRef().s8;
928+
return *reinterpret_cast<signed __int64 *>(&pThis[fieldIndex].NumericByRef().s8);
929929
}
930930

931931
#ifdef __GNUC__
@@ -947,7 +947,7 @@ float &Interop_Marshal_GetField_float(CLR_RT_HeapBlock *pThis, unsigned int fiel
947947

948948
double &Interop_Marshal_GetField_double(CLR_RT_HeapBlock *pThis, unsigned int fieldIndex)
949949
{
950-
return (double &)pThis[fieldIndex].NumericByRef().r8;
950+
return *reinterpret_cast<double *>(&pThis[fieldIndex].NumericByRef().r8);
951951
}
952952

953953
#ifdef __GNUC__

0 commit comments

Comments
 (0)