Fix "harmless" bug in ZapImport - use AppendByte to emit fixup type (dotnet/coreclr...
authorTomáš Rylek <trylek@microsoft.com>
Fri, 21 Dec 2018 04:40:38 +0000 (05:40 +0100)
committerJan Kotas <jkotas@microsoft.com>
Fri, 21 Dec 2018 04:40:38 +0000 (20:40 -0800)
commit84e518eed634e936a13c6fe1293ee0b858d548c6
tree8e4db51b4fecb4e235d75fd3c510de306978e0bf
parent43d655eaf58add56258a405f62febe06545e4603
Fix "harmless" bug in ZapImport - use AppendByte to emit fixup type (dotnet/coreclr#21621)

During my work on the CPAOT compiler I found out that in the past
I had believed we should use the compressed uint signature encoding
for emitting fixup types. This place may have contributed to my
mistake. I have audited all places in CoreCLR where signatures are
decoded and in all cases the fixup type is assumed to be a byte,
not a signature-compressed uint.

As I said, the bug is harmless (after all, Crossgen works) because
the enum code of READYTORUN_FIXUP_Helper is less than 128 and for
values 0-127 the compressed uint encoding is identical with the
byte value; I however believe it's useful to make this change
nonetheless for the sake of code clarity and to help avoid future
confusions similar to mine.

Commit migrated from https://github.com/dotnet/coreclr/commit/b1e2c668693b7905709db90ff829584826134ce0
src/coreclr/src/zap/zapimport.cpp