From cbe9cdafd78cefdcc12ece6aba7f2036d1598814 Mon Sep 17 00:00:00 2001 From: Aaron R Robinson Date: Wed, 4 Dec 2024 17:56:16 -0800 Subject: [PATCH] Fix conversion of void* to OBJECTREF --- src/coreclr/vm/invokeutil.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/vm/invokeutil.cpp b/src/coreclr/vm/invokeutil.cpp index ff6f1f51b4d70..c58710e1de1b1 100644 --- a/src/coreclr/vm/invokeutil.cpp +++ b/src/coreclr/vm/invokeutil.cpp @@ -554,7 +554,7 @@ OBJECTREF InvokeUtil::CreateObjectAfterInvoke(TypeHandle th, void * pValue) { case ELEMENT_TYPE_PTR: { - obj = CreatePointer(th, *(void **)pValue); + obj = CreatePointer(th, *(LPVOID*)pValue); break; } @@ -564,7 +564,7 @@ OBJECTREF InvokeUtil::CreateObjectAfterInvoke(TypeHandle th, void * pValue) { case ELEMENT_TYPE_STRING: case ELEMENT_TYPE_OBJECT: case ELEMENT_TYPE_VAR: - obj = *(OBJECTREF *)pValue; + obj = ObjectToOBJECTREF(*(Object**)pValue); break; case ELEMENT_TYPE_FNPTR: