Skip to content
Permalink
Browse files

[1.11>master] [MERGE #6267 @zenparsing] Prevent a use after free in m…

…emop

Merge pull request #6267 from zenparsing:use-after-free-memop
  • Loading branch information...
Kevin Smith
Kevin Smith committed Sep 5, 2019
2 parents b2c0518 + c5297b8 commit e79d68a8c0f9d31b4074bbf6d7a9013693f142ec
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/Backend/GlobOpt.cpp
RemoveMemOpSrcInstr(memopInstr, emitData->stElemInstr, emitData->block);
if (!isMemset)
{
if (((MemCopyEmitData*)emitData)->ldElemInstr->GetSrc1()->IsIndirOpnd())
IR::Instr* ldElemInstr = ((MemCopyEmitData*)emitData)->ldElemInstr;
if (ldElemInstr->GetSrc1()->IsIndirOpnd())
{
baseOpnd = ((MemCopyEmitData*)emitData)->ldElemInstr->GetSrc1()->AsIndirOpnd()->GetBaseOpnd();
baseOpnd = ldElemInstr->GetSrc1()->AsIndirOpnd()->GetBaseOpnd();
isLikelyJsArray = baseOpnd->GetValueType().IsLikelyArrayOrObjectWithArray();
ProcessNoImplicitCallArrayUses(baseOpnd, baseOpnd->IsArrayRegOpnd() ? baseOpnd->AsArrayRegOpnd() : nullptr, emitData->stElemInstr, isLikelyJsArray, true);
ProcessNoImplicitCallArrayUses(baseOpnd, baseOpnd->IsArrayRegOpnd() ? baseOpnd->AsArrayRegOpnd() : nullptr, ldElemInstr, isLikelyJsArray, true);
}
RemoveMemOpSrcInstr(memopInstr, ((MemCopyEmitData*)emitData)->ldElemInstr, emitData->block);
RemoveMemOpSrcInstr(memopInstr, ldElemInstr, emitData->block);
}
InsertNoImplicitCallUses(memopInstr);
noImplicitCallUsesToInsert->Clear();

0 comments on commit e79d68a

Please sign in to comment.
You can’t perform that action at this time.