summaryrefslogtreecommitdiff
path: root/src/jit/rangecheck.cpp
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2017-02-28 20:51:07 -0800
committerPat Gavlin <pagavlin@microsoft.com>2017-02-28 20:51:07 -0800
commit06cdb2191857b6fab899b8ae1150604447e064ad (patch)
tree36e4cdf6443e4f5d457257134061916d89bd1135 /src/jit/rangecheck.cpp
parent0420ddd5fd141620cf4a3cfba91913b8efe54b27 (diff)
downloadcoreclr-06cdb2191857b6fab899b8ae1150604447e064ad.tar.gz
coreclr-06cdb2191857b6fab899b8ae1150604447e064ad.tar.bz2
coreclr-06cdb2191857b6fab899b8ae1150604447e064ad.zip
Guard a use of a possibly-uninitialized BitSet.
Part of the range check optimization pass was not checking to ensure that a bitset was initialized before attempting to access it. This was causing one of the new tests for Vector.Narrow to fail with an AV.
Diffstat (limited to 'src/jit/rangecheck.cpp')
-rw-r--r--src/jit/rangecheck.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/jit/rangecheck.cpp b/src/jit/rangecheck.cpp
index 8d16cce31a..22b5328b08 100644
--- a/src/jit/rangecheck.cpp
+++ b/src/jit/rangecheck.cpp
@@ -869,10 +869,13 @@ Range RangeCheck::ComputeRangeForLocalDef(
case GT_ASG:
{
Range range = GetRange(loc->block, loc->stmt, asg->gtGetOp2(), path, monotonic DEBUGARG(indent));
- JITDUMP("Merge assertions from BB%02d:%s for assignment about %p\n", block->bbNum,
- BitVecOps::ToString(m_pCompiler->apTraits, block->bbAssertionIn), dspPtr(asg->gtGetOp1()));
- MergeEdgeAssertions(asg->gtGetOp1(), block->bbAssertionIn, &range);
- JITDUMP("done merging\n");
+ if (!BitVecOps::MayBeUninit(block->bbAssertionIn))
+ {
+ JITDUMP("Merge assertions from BB%02d:%s for assignment about %p\n", block->bbNum,
+ BitVecOps::ToString(m_pCompiler->apTraits, block->bbAssertionIn), dspPtr(asg->gtGetOp1()));
+ MergeEdgeAssertions(asg->gtGetOp1(), block->bbAssertionIn, &range);
+ JITDUMP("done merging\n");
+ }
return range;
}