Fix StubLinkerCPU::EmitMovConstant (#53510)
authorJan Vorlicek <jan.vorlicek@volny.cz>
Tue, 1 Jun 2021 04:59:48 +0000 (06:59 +0200)
committerGitHub <noreply@github.com>
Tue, 1 Jun 2021 04:59:48 +0000 (21:59 -0700)
commit92db46e0fefbf9a5713bb487648b99949aa8ce30
treeec216bed82c1b9987be923cbaa21a45d39b7d6f3
parentb80226304367cd296a5c7632a13f415f8a34fb34
Fix StubLinkerCPU::EmitMovConstant (#53510)

The method has a bug that caused it to early out for constants with
lowest 16, 24 or 32 bit being zero. The checks are inverse.
This issue caused failures in System.CodeDom.Tests after my change that
changed code heaps and resulted in the allocations starting at 64kB
aligned address. The failure could happen even before my change, but
extremely rarely, depending on where the heap virtual memory is located.

This change fixes the problem.
src/coreclr/vm/arm64/stubs.cpp