ソースを参照

[MERGE #5554 @atulkatti] MSFT:18321215 Unroot the temporary guest arena created by parser before releasing it to the ThreadContext.

Merge pull request #5554 from atulkatti:Bug18321215.UnrootParserGuestArena.1
Atul Katti 7 年 前
コミット
80b8ddeba9
3 ファイル変更6 行追加10 行削除
  1. 1 0
      lib/Parser/Parse.cpp
  2. 4 10
      lib/Runtime/Base/ScriptContext.h
  3. 1 0
      test/Array/rlexe.xml

+ 1 - 0
lib/Parser/Parse.cpp

@@ -13904,6 +13904,7 @@ void Parser::ReleaseTemporaryGuestArena()
         if (this->m_scriptContext != nullptr)
         {
             this->m_scriptContext->ReleaseTemporaryGuestAllocator(m_tempGuestArena);
+            m_tempGuestArena.Unroot();
         }
 
         m_tempGuestArenaReleased = true;

+ 4 - 10
lib/Runtime/Base/ScriptContext.h

@@ -2034,16 +2034,10 @@ private:
     ArenaAllocator * allocator = nullptr;
 
 #define ACQUIRE_TEMP_GUEST_ALLOCATOR(allocator, scriptContext, name) \
-    TryFinally([&]() \
-    { \
-        tempGuest##allocator = scriptContext->GetTemporaryGuestAllocator(name); \
-        allocator = tempGuest##allocator->GetAllocator();
+    tempGuest##allocator = scriptContext->GetTemporaryGuestAllocator(name); \
+    allocator = tempGuest##allocator->GetAllocator();
 
 #define RELEASE_TEMP_GUEST_ALLOCATOR(allocator, scriptContext) \
-    }, \
-    [&](bool /*hasException*/) \
-    { \
-        if (tempGuest##allocator) \
-        scriptContext->ReleaseTemporaryGuestAllocator(tempGuest##allocator); \
-    });
+    if (tempGuest##allocator) \
+    scriptContext->ReleaseTemporaryGuestAllocator(tempGuest##allocator);
 

+ 1 - 0
test/Array/rlexe.xml

@@ -646,6 +646,7 @@
       <files>memset_invariant.js</files>
       <tags>Slow</tags>
       <compile-flags>-mic:1 -off:simplejit -mmoc:0 -off:JITLoopBody</compile-flags>
+      <timeout>300</timeout>
     </default>
   </test>
   <!--