Skip to content

Commit 9836062

Browse files
Meghana GuptaMikeHolman
authored andcommitted
[CVE-2018-8456] Edge - Chakra JIT Loop LandingPad ImplicitCall Bypass - Qihoo 360
1 parent f12d847 commit 9836062

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/Backend/GlobOpt.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14500,13 +14500,23 @@ GlobOpt::OptHoistUpdateValueType(
1450014500
// Replace above will free srcOpnd, so reassign it
1450114501
*srcOpndPtr = srcOpnd = reinterpret_cast<IR::Opnd *>(strOpnd);
1450214502

14503-
if (loop->bailOutInfo->bailOutInstr)
14503+
if (IsImplicitCallBailOutCurrentlyNeeded(convPrimStrInstr, opndValueInLandingPad, nullptr, landingPad, landingPad->globOptData.liveFields->IsEmpty(), true, true))
1450414504
{
14505+
EnsureBailTarget(loop);
1450514506
loop->bailOutInfo->bailOutInstr->InsertBefore(convPrimStrInstr);
14507+
convPrimStrInstr = convPrimStrInstr->ConvertToBailOutInstr(convPrimStrInstr, IR::BailOutOnImplicitCallsPreOp, loop->bailOutInfo->bailOutOffset);
14508+
convPrimStrInstr->ReplaceBailOutInfo(loop->bailOutInfo);
1450614509
}
1450714510
else
1450814511
{
14509-
landingPad->InsertAfter(convPrimStrInstr);
14512+
if (loop->bailOutInfo->bailOutInstr)
14513+
{
14514+
loop->bailOutInfo->bailOutInstr->InsertBefore(convPrimStrInstr);
14515+
}
14516+
else
14517+
{
14518+
landingPad->InsertAfter(convPrimStrInstr);
14519+
}
1451014520
}
1451114521

1451214522
// If we came here opndSym can't be PropertySym

0 commit comments

Comments
 (0)