Fix shuffling thunk for Unix AMD64 (#16904)
authorJan Vorlicek <janvorli@microsoft.com>
Tue, 13 Mar 2018 18:56:34 +0000 (19:56 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Mar 2018 18:56:34 +0000 (19:56 +0100)
commit41c02957420988f42275c789e06de32a3a3913b9
treef5054c1edb845791ba163a2b31d2b59973c8c4f5
parent5afdabcc7c29339b263266a20ef183a2fad04e3b
Fix shuffling thunk for Unix AMD64 (#16904)

The shufflign thunk was generated incorrectly for some edge cases when
a struct was passed in a register or a pair of registers in the
destination, but on stack in the source.
This change implements a new algorithm that ensures that argument slots
are never overwritten before their current value is moved out.

It also adds an extensive regression test that checks various
interesting combinations of arguments that were causing issues before.
src/vm/comdelegate.cpp
src/vm/i386/stublinkerx86.cpp
tests/src/Regressions/coreclr/GitHub_16833/Test16833.csproj [new file with mode: 0644]
tests/src/Regressions/coreclr/GitHub_16833/test16833.cs [new file with mode: 0644]