Skip to content

Commit

Permalink
Do not try to access the operation that has been folded
Browse files Browse the repository at this point in the history
  • Loading branch information
SingleAccretion committed Jan 21, 2021
1 parent beb589d commit e329cae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13479,6 +13479,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
*/

type = genActualType(lclTyp);

// If this is a no-op cast, just use op1.
if (!ovfl && (type == op1->TypeGet()) && (genTypeSize(type) == genTypeSize(lclTyp)))
{
Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12211,8 +12211,11 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac)
{
tree = gtFoldExpr(tree);
}
else
{
tree->AsOp()->CheckDivideByConstOptimized(this);
}

tree->AsOp()->CheckDivideByConstOptimized(this);
return tree;
}
}
Expand Down

0 comments on commit e329cae

Please sign in to comment.