summaryrefslogtreecommitdiff
path: root/src/zap
diff options
context:
space:
mode:
authorTomáš Rylek <trylek@microsoft.com>2018-12-21 05:40:38 +0100
committerJan Kotas <jkotas@microsoft.com>2018-12-20 20:40:38 -0800
commitb1e2c668693b7905709db90ff829584826134ce0 (patch)
tree8f2fd5ea476c282b42a4c1e5cce0130f45cdb21e /src/zap
parent75c8c54950c78f1192e481a5bbd6eeff1b3bd1cd (diff)
downloadcoreclr-b1e2c668693b7905709db90ff829584826134ce0.tar.gz
coreclr-b1e2c668693b7905709db90ff829584826134ce0.tar.bz2
coreclr-b1e2c668693b7905709db90ff829584826134ce0.zip
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.
Diffstat (limited to 'src/zap')
-rw-r--r--src/zap/zapimport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zap/zapimport.cpp b/src/zap/zapimport.cpp
index 5e1a42c119..d3010af30f 100644
--- a/src/zap/zapimport.cpp
+++ b/src/zap/zapimport.cpp
@@ -2289,7 +2289,7 @@ ZapImport * ZapImportTable::GetHelperImport(ReadyToRunHelper helperNum)
{
SigBuilder sigBuilder;
- sigBuilder.AppendData(ENCODE_READYTORUN_HELPER);
+ sigBuilder.AppendByte(ENCODE_READYTORUN_HELPER);
sigBuilder.AppendData(helperNum);
pImport->SetBlob(GetBlob(&sigBuilder));