Fix "harmless" bug in ZapImport - use AppendByte to emit fixup type (#21621)
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)
commitb1e2c668693b7905709db90ff829584826134ce0
tree8f2fd5ea476c282b42a4c1e5cce0130f45cdb21e
parent75c8c54950c78f1192e481a5bbd6eeff1b3bd1cd
Fix "harmless" bug in ZapImport - use AppendByte to emit fixup type (#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.
src/zap/zapimport.cpp