diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2016-11-02 14:08:41 -0700 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2016-11-02 14:08:41 -0700 |
commit | 90a7e86fb9f83691ee11e7205c3fcef06c60e26f (patch) | |
tree | 25e0cf0a10e80387fa80f96158ee168a02c01dfa /src/jit/valuenum.cpp | |
parent | e568823f22ec1dccc4ea785630c837e776d4ee09 (diff) | |
download | coreclr-90a7e86fb9f83691ee11e7205c3fcef06c60e26f.tar.gz coreclr-90a7e86fb9f83691ee11e7205c3fcef06c60e26f.tar.bz2 coreclr-90a7e86fb9f83691ee11e7205c3fcef06c60e26f.zip |
Make a few VN methods tolerant of NoVN.
There were a few methods on the VN store that were not resilient to
being provided with the "no value number" sentinel value. This lack of
resilience caused assertion failures during assertion propagation when
generating assertions for trees marked with "no value number".
Diffstat (limited to 'src/jit/valuenum.cpp')
-rw-r--r-- | src/jit/valuenum.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/jit/valuenum.cpp b/src/jit/valuenum.cpp index fe23e71938..0a38a5f313 100644 --- a/src/jit/valuenum.cpp +++ b/src/jit/valuenum.cpp @@ -2918,6 +2918,11 @@ ValueNum Compiler::fgValueNumberArrIndexVal(GenTreePtr tree, var_types ValueNumStore::TypeOfVN(ValueNum vn) { + if (vn == NoVN) + { + return TYP_UNDEF; + } + Chunk* c = m_chunks.GetNoExpand(GetChunkNum(vn)); return c->m_typ; } @@ -2937,6 +2942,11 @@ var_types ValueNumStore::TypeOfVN(ValueNum vn) BasicBlock::loopNumber ValueNumStore::LoopOfVN(ValueNum vn) { + if (vn == NoVN) + { + return MAX_LOOP_NUM; + } + Chunk* c = m_chunks.GetNoExpand(GetChunkNum(vn)); return c->m_loopNum; } @@ -3402,6 +3412,11 @@ bool ValueNumStore::IsVNFunc(ValueNum vn) bool ValueNumStore::GetVNFunc(ValueNum vn, VNFuncApp* funcApp) { + if (vn == NoVN) + { + return false; + } + Chunk* c = m_chunks.GetNoExpand(GetChunkNum(vn)); unsigned offset = ChunkOffset(vn); assert(offset < c->m_numUsed); |