From 06cdb2191857b6fab899b8ae1150604447e064ad Mon Sep 17 00:00:00 2001 From: Pat Gavlin Date: Tue, 28 Feb 2017 20:51:07 -0800 Subject: 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. --- src/jit/rangecheck.cpp | 11 +++++++---- 1 file 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; } -- cgit v1.2.3