[amd64] Allocate stack space for saving argument registers in the generic trampoline...
authorZoltan Varga <vargaz@gmail.com>
Thu, 30 Jul 2015 02:43:05 +0000 (22:43 -0400)
committerZoltan Varga <vargaz@gmail.com>
Thu, 30 Jul 2015 02:43:05 +0000 (22:43 -0400)
mono/mini/tramp-amd64.c

index ec9368052defc45361ed021eaa0df4939f3169d4..374e3a3dd4aea19b4c6dab41bf11d56cf5af2fa8 100644 (file)
@@ -349,6 +349,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        offset += sizeof (MonoLMFTramp);
        lmf_offset = -offset;
 
+#ifdef TARGET_WIN32
+       /* Reserve space where the callee can save the argument registers */
+       offset += 4 * sizeof (mgreg_t);
+#endif
+
        framesize = ALIGN_TO (offset, MONO_ARCH_FRAME_ALIGNMENT);
 
        // CFA = sp + 16 (the trampoline address is on the stack)