Fix handling of FP args on stack in the ArgIterator (dotnet/coreclr#4729)
authorJan Vorlicek <janvorli@microsoft.com>
Tue, 3 May 2016 04:22:11 +0000 (06:22 +0200)
committerJan Kotas <jkotas@microsoft.com>
Tue, 3 May 2016 04:22:11 +0000 (21:22 -0700)
This change fixes a bug in the ArgIterator that resulted in assigning
floating point arguments that didn't fit to the xmm registers to general
purpose registers in the ArgIterator if there were some general purpose
registers available.

Commit migrated from https://github.com/dotnet/coreclr/commit/92e2d4e6fe1d1af3ee761637f1c99e4e8616282c

src/coreclr/src/vm/callingconvention.h

index fbf966f..e637ff4 100644 (file)
@@ -954,8 +954,8 @@ int ArgIteratorTemplate<ARGITERATOR_BASE>::GetNextOffset()
     m_fArgInRegisters = true;
 
     int cFPRegs = 0;
+    int cGenRegs = 0;
     int cbArg = StackElemSize(argSize);
-    int cGenRegs = cbArg / 8; // GP reg size
 
     switch (argType)
     {
@@ -1027,6 +1027,7 @@ int ArgIteratorTemplate<ARGITERATOR_BASE>::GetNextOffset()
     }
 
     default:
+        cGenRegs = cbArg / 8; // GP reg size
         break;
     }