diff --git a/src/coreclr/classlibnative/bcltype/varargsnative.cpp b/src/coreclr/classlibnative/bcltype/varargsnative.cpp index a53c0b09ba55a..a5f206aeef5de 100644 --- a/src/coreclr/classlibnative/bcltype/varargsnative.cpp +++ b/src/coreclr/classlibnative/bcltype/varargsnative.cpp @@ -116,7 +116,7 @@ static void InitCommon(VARARGS *data, VASigCookie** cookie) // Always skip over the varargs_cookie. const bool isValueType = false; const bool isFloatHfa = false; - data->ArgPtr += StackElemSize(sizeof(LPVOID), isValueType, isFloatHfa); + data->ArgPtr += StackElemSize(TARGET_POINTER_SIZE, isValueType, isFloatHfa); #endif } diff --git a/src/coreclr/vm/amd64/cgencpu.h b/src/coreclr/vm/amd64/cgencpu.h index 4f40b0cf0a635..7312ad0a019fe 100644 --- a/src/coreclr/vm/amd64/cgencpu.h +++ b/src/coreclr/vm/amd64/cgencpu.h @@ -149,7 +149,7 @@ void R8ToFPSpill(void* pSpillSlot, SIZE_T srcDoubleAsSIZE_T) inline unsigned StackElemSize(unsigned parmSize, bool isValueType = false /* unused */, bool isFloatHfa = false /* unused */) { - const unsigned stackSlotSize = sizeof(void*); + const unsigned stackSlotSize = 8; return ALIGN_UP(parmSize, stackSlotSize); } diff --git a/src/coreclr/vm/arm/cgencpu.h b/src/coreclr/vm/arm/cgencpu.h index 68c70cda7b817..c68e763e8945d 100644 --- a/src/coreclr/vm/arm/cgencpu.h +++ b/src/coreclr/vm/arm/cgencpu.h @@ -103,7 +103,7 @@ EXTERN_C void setFPReturn(int fpSize, INT64 retVal); inline unsigned StackElemSize(unsigned parmSize, bool isValueType = false /* unused */, bool isFloatHfa = false /* unused */) { - const unsigned stackSlotSize = sizeof(void*); + const unsigned stackSlotSize = 4; return ALIGN_UP(parmSize, stackSlotSize); } diff --git a/src/coreclr/vm/arm64/cgencpu.h b/src/coreclr/vm/arm64/cgencpu.h index 42bf8038e716c..c87dbb11601f8 100644 --- a/src/coreclr/vm/arm64/cgencpu.h +++ b/src/coreclr/vm/arm64/cgencpu.h @@ -101,7 +101,7 @@ inline unsigned StackElemSize(unsigned parmSize, bool isValueType, bool isFloatH } #endif - const unsigned stackSlotSize = sizeof(void*); + const unsigned stackSlotSize = 8; return ALIGN_UP(parmSize, stackSlotSize); } diff --git a/src/coreclr/vm/i386/cgencpu.h b/src/coreclr/vm/i386/cgencpu.h index 3c7d700e8d953..04de3f584ae9e 100644 --- a/src/coreclr/vm/i386/cgencpu.h +++ b/src/coreclr/vm/i386/cgencpu.h @@ -104,7 +104,7 @@ EXTERN_C void SinglecastDelegateInvokeStub(); inline unsigned StackElemSize(unsigned parmSize, bool isValueType = false /* unused */, bool isFloatHfa = false /* unused */) { - const unsigned stackSlotSize = sizeof(void*); + const unsigned stackSlotSize = 4; return ALIGN_UP(parmSize, stackSlotSize); }