summaryrefslogtreecommitdiff
path: root/src/jit/assertionprop.cpp
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2017-08-02 18:48:48 -0700
committerBrian Sullivan <briansul@microsoft.com>2017-08-03 16:16:04 -0700
commit0d390cceb7ab0c8a271afce315fe4456211fdc6c (patch)
treeddce8637754f30dccc8a27db629db762866541f0 /src/jit/assertionprop.cpp
parentf275f4593d4d4e5f604df79d213b0540ea1f0d41 (diff)
downloadcoreclr-0d390cceb7ab0c8a271afce315fe4456211fdc6c.tar.gz
coreclr-0d390cceb7ab0c8a271afce315fe4456211fdc6c.tar.bz2
coreclr-0d390cceb7ab0c8a271afce315fe4456211fdc6c.zip
Fixes issue #13093
Removed the legacy JIT32 assert regarding 4-byte alignment inArenaAllocator::allocateMemory Immediately after this assert we roundUp to an pointer size allocation amount. Fixed a couple of allocations in assertionprop to use CMF_AssertionProp so that we correctly attribute which phase uses the memory being allocated. Added range check for the array writes in Compiler::optMapComplementary Removed the now unnecessary AlignUp to 4-byte in operator new and new[] in compiler.hpp
Diffstat (limited to 'src/jit/assertionprop.cpp')
-rw-r--r--src/jit/assertionprop.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp
index bcdae634e0..9b7bedd87b 100644
--- a/src/jit/assertionprop.cpp
+++ b/src/jit/assertionprop.cpp
@@ -524,7 +524,7 @@ ASSERT_TP& Compiler::GetAssertionDep(unsigned lclNum)
void Compiler::optAssertionTraitsInit(AssertionIndex assertionCount)
{
- apTraits = new (getAllocator()) BitVecTraits(assertionCount, this);
+ apTraits = new (this, CMK_AssertionProp) BitVecTraits(assertionCount, this);
apFull = BitVecOps::MakeFull(apTraits);
}
@@ -547,9 +547,9 @@ void Compiler::optAssertionInit(bool isLocalProp)
optMaxAssertionCount = countFunc[isLocalProp ? lowerBound : min(upperBound, codeSize)];
optLocalAssertionProp = isLocalProp;
- optAssertionTabPrivate = new (getAllocator()) AssertionDsc[optMaxAssertionCount];
+ optAssertionTabPrivate = new (this, CMK_AssertionProp) AssertionDsc[optMaxAssertionCount];
optComplementaryAssertionMap =
- new (getAllocator()) AssertionIndex[optMaxAssertionCount](); // zero-inited (NO_ASSERTION_INDEX.)
+ new (this, CMK_AssertionProp) AssertionIndex[optMaxAssertionCount + 1](); // zero-inited (NO_ASSERTION_INDEX)
assert(NO_ASSERTION_INDEX == 0);
if (!isLocalProp)
@@ -559,7 +559,7 @@ void Compiler::optAssertionInit(bool isLocalProp)
if (optAssertionDep == nullptr)
{
- optAssertionDep = new (getAllocator()) ExpandArray<ASSERT_TP>(getAllocator(), max(1, lvaCount));
+ optAssertionDep = new (this, CMK_AssertionProp) ExpandArray<ASSERT_TP>(getAllocator(), max(1, lvaCount));
}
optAssertionTraitsInit(optMaxAssertionCount);
@@ -2150,6 +2150,10 @@ void Compiler::optMapComplementary(AssertionIndex assertionIndex, AssertionIndex
{
return;
}
+
+ assert(assertionIndex <= optMaxAssertionCount);
+ assert(index <= optMaxAssertionCount);
+
optComplementaryAssertionMap[assertionIndex] = index;
optComplementaryAssertionMap[index] = assertionIndex;
}