JIT: add extra check to struct of struct of x promotion (dotnet/coreclr#19156)
authorAndy Ayers <andya@microsoft.com>
Fri, 27 Jul 2018 18:09:02 +0000 (11:09 -0700)
committerGitHub <noreply@github.com>
Fri, 27 Jul 2018 18:09:02 +0000 (11:09 -0700)
commitb4122532e621f0c303251de3feaf348244a5b0a8
treecfb97126729fe4e2a4daab0a9ac5ca9b16136d87
parent86794f1e5a38c87f0d7d109dcf983dca94fd592c
JIT: add extra check to struct of struct of x promotion (dotnet/coreclr#19156)

Avoid promoting structs that contain struct fields that themselves
wrap single simple fields, if those single simple fields are smaller
than their enclosing struct.

Otherwise we run the risk of losing track of the "extra" bytes in the
innner struct.

Addresses dotnet/coreclr#19149.

Commit migrated from https://github.com/dotnet/coreclr/commit/d38774d80e07436eadc28f7255a8c9f8edb1e570
src/coreclr/src/jit/lclvars.cpp
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19022/GitHub_19022.cs
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19149/GitHub_19149.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19149/GitHub_19149.csproj [new file with mode: 0644]