Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Generate non-null assertion for byrefs if we can't find corresponding refs #21944

Merged
merged 1 commit into from
Jan 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,8 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,

//
// We only perform null-checks on GC refs
// so only make non-null assertions about GC refs
// so only make non-null assertions about GC refs or byrefs if we can't determine
// the corresponding ref.
//
if (lclVar->TypeGet() != TYP_REF)
{
Expand Down Expand Up @@ -957,7 +958,7 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
}
}

if (fgIsBigOffset(offset) || (vnStore->TypeOfVN(vn) != TYP_REF))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also should update the comment on line: 926:

// so only make non-null assertions about GC refs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if (fgIsBigOffset(offset))
{
goto DONE_ASSERTION; // Don't make an assertion
}
Expand Down