Răsfoiți Sursa

[1.11>master] [MERGE #6328 @boingoing] ChakraCore servicing update for 19-11

Merge pull request #6328 from boingoing:servicing/1911

Addresses the following issues:
CVE-2019-1426
CVE-2019-1427
CVE-2019-1428
Taylor Woll 6 ani în urmă
părinte
comite
bcc9abe035
3 a modificat fișierele cu 12 adăugiri și 2 ștergeri
  1. 2 1
      lib/Backend/GlobOptFields.cpp
  2. 1 1
      lib/Backend/GlobOptIntBounds.cpp
  3. 9 0
      lib/Parser/Parse.cpp

+ 2 - 1
lib/Backend/GlobOptFields.cpp

@@ -249,7 +249,8 @@ GlobOpt::KillLiveElems(IR::IndirOpnd * indirOpnd, IR::Opnd * valueOpnd, BVSparse
             IR::RegOpnd *baseOpnd = indirOpnd->GetBaseOpnd();
             Value * baseValue = baseOpnd ? this->currentBlock->globOptData.FindValue(baseOpnd->m_sym) : nullptr;
             ValueInfo * baseValueInfo = baseValue ? baseValue->GetValueInfo() : nullptr;
-            if (!baseValueInfo || !baseValueInfo->IsNotNativeArray())
+            if (!baseValueInfo || !baseValueInfo->IsNotNativeArray() || 
+                (this->IsLoopPrePass() && !this->IsSafeToTransferInPrepass(baseOpnd->m_sym, baseValueInfo)))
             {
                 if (this->currentBlock->globOptData.maybeWrittenTypeSyms == nullptr)
                 {

+ 1 - 1
lib/Backend/GlobOptIntBounds.cpp

@@ -803,7 +803,7 @@ void GlobOpt::TrackIntSpecializedAddSubConstant(
 
                 // Ensure that the sym is live in the landing pad, and that its value has not changed in an unknown way yet
                 Value *const landingPadValue = currentBlock->loop->landingPad->globOptData.FindValue(sym);
-                if(!landingPadValue || srcValueNumber != landingPadValue->GetValueNumber())
+                if(!landingPadValue || srcValueNumber != landingPadValue->GetValueNumber() || currentBlock->loop->symsDefInLoop->Test(sym->m_id))
                 {
                     updateInductionVariableValueNumber = false;
                     break;

+ 9 - 0
lib/Parser/Parse.cpp

@@ -10021,6 +10021,15 @@ ParseNodeCatch * Parser::ParseCatch()
             GetCurrentBlock()->SetChildCallsEval(true);
         }
 
+        if (pnodeCatchScope->GetCallsEval())
+        {
+            pnodeBody->AsParseNodeBlock()->SetCallsEval(true);
+        }
+        if (pnodeCatchScope->GetChildCallsEval())
+        {
+            pnodeBody->AsParseNodeBlock()->SetChildCallsEval(true);
+        }
+
         if (buildAST)
         {
             PopStmt(&stmt);