Skip to content

Commit 9172709

Browse files
author
Meghana Gupta
committed
Add return value
1 parent ae7360a commit 9172709

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lib/Backend/FlowGraph.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4620,7 +4620,8 @@ BasicBlock::CheckLegalityAndFoldPathDepBranches(GlobOpt* globOpt)
46204620
BVSparse<JitArenaAllocator> currentPathDefines(globOpt->alloc);
46214621
IR::Instr *currentInlineeEnd = nullptr, *unskippedInlineeEnd = nullptr;
46224622

4623-
auto UpdateValueForCopyTypeInstr = [&](IR::Instr *instr) {
4623+
auto UpdateValueForCopyTypeInstr = [&](IR::Instr *instr) -> Value* {
4624+
Value * dstValue = nullptr;
46244625
if (instr->m_opcode == Js::OpCode::LdFld)
46254626
{
46264627
// Special handling for LdFld
@@ -4635,43 +4636,44 @@ BasicBlock::CheckLegalityAndFoldPathDepBranches(GlobOpt* globOpt)
46354636
PropertySym *prop = PropertySym::Find(objSym ? objSym->m_id : originalPropertySym->m_stackSym->m_id, originalPropertySym->m_propertyId, globOpt->func);
46364637
if (prop)
46374638
{
4638-
FindValueInLocalThenGlobalValueTableAndUpdate(globOpt, localSymToValueMap, instr, instr->GetDst()->GetStackSym(), prop);
4639+
dstValue = FindValueInLocalThenGlobalValueTableAndUpdate(globOpt, localSymToValueMap, instr, instr->GetDst()->GetStackSym(), prop);
46394640
}
46404641
else
46414642
{
46424643
Value ** localDstValue = localSymToValueMap->FindOrInsertNew(instr->GetDst()->GetStackSym());
4643-
*localDstValue = nullptr;
4644+
dstValue = *localDstValue = nullptr;
46444645
}
46454646
}
46464647
}
46474648
else if (instr->GetSrc1()->GetStackSym())
46484649
{
46494650
StackSym* src1Sym = instr->GetSrc1()->GetStackSym();
4650-
FindValueInLocalThenGlobalValueTableAndUpdate(globOpt, localSymToValueMap, instr, instr->GetDst()->GetSym(), src1Sym);
4651+
dstValue = FindValueInLocalThenGlobalValueTableAndUpdate(globOpt, localSymToValueMap, instr, instr->GetDst()->GetSym(), src1Sym);
46514652
}
46524653
else if (instr->GetSrc1()->IsIntConstOpnd())
46534654
{
46544655
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);
46564657
}
46574658
else if (instr->GetSrc1()->IsInt64ConstOpnd())
46584659
{
46594660
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);
46614662
}
46624663
else
46634664
{
46644665
ValueType src1Value = instr->GetSrc1()->GetValueType();
46654666
Value **localValue = localSymToValueMap->FindOrInsertNew(instr->GetDst()->GetSym());
46664667
if (src1Value.IsUndefined() || src1Value.IsBoolean())
46674668
{
4668-
*localValue = globOpt->GetVarConstantValue(instr->GetSrc1()->AsAddrOpnd());
4669+
dstValue = *localValue = globOpt->GetVarConstantValue(instr->GetSrc1()->AsAddrOpnd());
46694670
}
46704671
else
46714672
{
4672-
*localValue = nullptr;
4673+
dstValue = *localValue = nullptr;
46734674
}
46744675
}
4676+
return dstValue;
46754677
};
46764678

46774679
FOREACH_INSTR_IN_BLOCK(instr, this)

0 commit comments

Comments
 (0)