summaryrefslogtreecommitdiff
path: root/src/jit/compiler.hpp
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2019-03-07 14:20:44 -0800
committerBrian Sullivan <briansul@microsoft.com>2019-03-13 15:23:35 -0700
commitef1d1e86da8406ca86ca98b8d92b038fe1f08d7a (patch)
tree334222be94dfdfad3951f23ad08daa2b16e652b2 /src/jit/compiler.hpp
parente73c7bca3ebc46055cbdfb87adb39334474abb96 (diff)
downloadcoreclr-ef1d1e86da8406ca86ca98b8d92b038fe1f08d7a.tar.gz
coreclr-ef1d1e86da8406ca86ca98b8d92b038fe1f08d7a.tar.bz2
coreclr-ef1d1e86da8406ca86ca98b8d92b038fe1f08d7a.zip
Fix for Issue 21231
When transferring a Zero offset from one GenTree node to another, we need to check if there already is a FieldSeq and append to it. Added third parameter 'kind' to JitHashTable::Set, and Added enum SetKind Only allow Set to overwrite an existing entry when kind is set to Overwrite. Added validation for all calls to JitHashTable::Set asserting that we don't expect the key to already exist or that we passed Overwrite indicating that we expect to handle it properly. Added two test cases for Issue 21231
Diffstat (limited to 'src/jit/compiler.hpp')
-rw-r--r--src/jit/compiler.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp
index a9dc3bbc5f..c1be6acbbe 100644
--- a/src/jit/compiler.hpp
+++ b/src/jit/compiler.hpp
@@ -3291,7 +3291,7 @@ inline void Compiler::LoopDsc::AddModifiedField(Compiler* comp, CORINFO_FIELD_HA
lpFieldsModified =
new (comp->getAllocatorLoopHoist()) Compiler::LoopDsc::FieldHandleSet(comp->getAllocatorLoopHoist());
}
- lpFieldsModified->Set(fldHnd, true);
+ lpFieldsModified->Set(fldHnd, true, FieldHandleSet::Overwrite);
}
inline void Compiler::LoopDsc::AddModifiedElemType(Compiler* comp, CORINFO_CLASS_HANDLE structHnd)
@@ -3301,7 +3301,7 @@ inline void Compiler::LoopDsc::AddModifiedElemType(Compiler* comp, CORINFO_CLASS
lpArrayElemTypesModified =
new (comp->getAllocatorLoopHoist()) Compiler::LoopDsc::ClassHandleSet(comp->getAllocatorLoopHoist());
}
- lpArrayElemTypesModified->Set(structHnd, true);
+ lpArrayElemTypesModified->Set(structHnd, true, ClassHandleSet::Overwrite);
}
inline void Compiler::LoopDsc::VERIFY_lpIterTree()