@@ -4620,7 +4620,8 @@ BasicBlock::CheckLegalityAndFoldPathDepBranches(GlobOpt* globOpt)
4620
4620
BVSparse<JitArenaAllocator> currentPathDefines (globOpt->alloc );
4621
4621
IR::Instr *currentInlineeEnd = nullptr , *unskippedInlineeEnd = nullptr ;
4622
4622
4623
- auto UpdateValueForCopyTypeInstr = [&](IR::Instr *instr) {
4623
+ auto UpdateValueForCopyTypeInstr = [&](IR::Instr *instr) -> Value* {
4624
+ Value * dstValue = nullptr ;
4624
4625
if (instr->m_opcode == Js::OpCode::LdFld)
4625
4626
{
4626
4627
// Special handling for LdFld
@@ -4635,43 +4636,44 @@ BasicBlock::CheckLegalityAndFoldPathDepBranches(GlobOpt* globOpt)
4635
4636
PropertySym *prop = PropertySym::Find (objSym ? objSym->m_id : originalPropertySym->m_stackSym ->m_id , originalPropertySym->m_propertyId , globOpt->func );
4636
4637
if (prop)
4637
4638
{
4638
- FindValueInLocalThenGlobalValueTableAndUpdate (globOpt, localSymToValueMap, instr, instr->GetDst ()->GetStackSym (), prop);
4639
+ dstValue = FindValueInLocalThenGlobalValueTableAndUpdate (globOpt, localSymToValueMap, instr, instr->GetDst ()->GetStackSym (), prop);
4639
4640
}
4640
4641
else
4641
4642
{
4642
4643
Value ** localDstValue = localSymToValueMap->FindOrInsertNew (instr->GetDst ()->GetStackSym ());
4643
- *localDstValue = nullptr ;
4644
+ dstValue = *localDstValue = nullptr ;
4644
4645
}
4645
4646
}
4646
4647
}
4647
4648
else if (instr->GetSrc1 ()->GetStackSym ())
4648
4649
{
4649
4650
StackSym* src1Sym = instr->GetSrc1 ()->GetStackSym ();
4650
- FindValueInLocalThenGlobalValueTableAndUpdate (globOpt, localSymToValueMap, instr, instr->GetDst ()->GetSym (), src1Sym);
4651
+ dstValue = FindValueInLocalThenGlobalValueTableAndUpdate (globOpt, localSymToValueMap, instr, instr->GetDst ()->GetSym (), src1Sym);
4651
4652
}
4652
4653
else if (instr->GetSrc1 ()->IsIntConstOpnd ())
4653
4654
{
4654
4655
Value **localValue = localSymToValueMap->FindOrInsertNew (instr->GetDst ()->GetSym ());
4655
- *localValue = globOpt->GetIntConstantValue (instr->GetSrc1 ()->AsIntConstOpnd ()->AsInt32 (), instr);
4656
+ dstValue = *localValue = globOpt->GetIntConstantValue (instr->GetSrc1 ()->AsIntConstOpnd ()->AsInt32 (), instr);
4656
4657
}
4657
4658
else if (instr->GetSrc1 ()->IsInt64ConstOpnd ())
4658
4659
{
4659
4660
Value **localValue = localSymToValueMap->FindOrInsertNew (instr->GetDst ()->GetSym ());
4660
- *localValue = globOpt->GetIntConstantValue (instr->GetSrc1 ()->AsInt64ConstOpnd ()->GetValue (), instr);
4661
+ dstValue = *localValue = globOpt->GetIntConstantValue (instr->GetSrc1 ()->AsInt64ConstOpnd ()->GetValue (), instr);
4661
4662
}
4662
4663
else
4663
4664
{
4664
4665
ValueType src1Value = instr->GetSrc1 ()->GetValueType ();
4665
4666
Value **localValue = localSymToValueMap->FindOrInsertNew (instr->GetDst ()->GetSym ());
4666
4667
if (src1Value.IsUndefined () || src1Value.IsBoolean ())
4667
4668
{
4668
- *localValue = globOpt->GetVarConstantValue (instr->GetSrc1 ()->AsAddrOpnd ());
4669
+ dstValue = *localValue = globOpt->GetVarConstantValue (instr->GetSrc1 ()->AsAddrOpnd ());
4669
4670
}
4670
4671
else
4671
4672
{
4672
- *localValue = nullptr ;
4673
+ dstValue = *localValue = nullptr ;
4673
4674
}
4674
4675
}
4676
+ return dstValue;
4675
4677
};
4676
4678
4677
4679
FOREACH_INSTR_IN_BLOCK (instr, this )
0 commit comments