From eae1b9e2692cd9256aabd016d2776e72acc713fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 29 Apr 2025 10:49:59 +0100 Subject: [PATCH] Fix Interop get field --- src/CLR/Core/CLR_RT_Interop.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CLR/Core/CLR_RT_Interop.cpp b/src/CLR/Core/CLR_RT_Interop.cpp index 90386e23c4..286a77ecf0 100644 --- a/src/CLR/Core/CLR_RT_Interop.cpp +++ b/src/CLR/Core/CLR_RT_Interop.cpp @@ -1,4 +1,4 @@ -// +// // Copyright (c) .NET Foundation and Contributors // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. @@ -978,7 +978,8 @@ signed __int64 &Interop_Marshal_GetField_double(CLR_RT_HeapBlock *pThis, unsigne #endif UNSUPPORTED_TYPE &Interop_Marshal_GetField_UNSUPPORTED_TYPE(CLR_RT_HeapBlock *pThis, unsigned int fieldIndex) { - return (UNSUPPORTED_TYPE &)(*((UNSUPPORTED_TYPE *)nullptr)); + static UNSUPPORTED_TYPE dummy; + return dummy; } #ifdef __GNUC__ #pragma GCC diagnostic pop