summaryrefslogtreecommitdiff
path: root/src/jit/assertionprop.cpp
diff options
context:
space:
mode:
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;
}